fix(coderd/database): match group name case-insensitively in search (#27894)

This commit is contained in:
david-fraley
2026-08-05 14:21:49 -05:00
committed by GitHub
parent dae41eb711
commit d458fe4941
5 changed files with 58 additions and 5 deletions
+21
View File
@@ -416,6 +416,27 @@ func TestSearchWorkspace(t *testing.T) {
SharedWithGroupID: uuid.MustParse("3c831688-0a5a-45a2-a796-f7648874df34"),
},
},
{
Name: "SharedWithGroupInOrgMixedCase",
// The parser lowercases the whole query, so a group whose stored
// name contains uppercase letters must still resolve. See
// GetGroupByOrgAndName, which matches the name case-insensitively.
Query: "shared_with_group:wibble/SupportShare",
Setup: func(t *testing.T, db database.Store) {
org := dbgen.Organization(t, db, database.Organization{
ID: uuid.MustParse("b5f9d1f4-6d0e-4f6a-9a4a-7b2c3d4e5f60"),
Name: "wibble",
})
dbgen.Group(t, db, database.Group{
ID: uuid.MustParse("1a2b3c4d-5e6f-4a1b-8c2d-3e4f5a6b7c8d"),
Name: "SupportShare",
OrganizationID: org.ID,
})
},
Expected: database.GetWorkspacesParams{
SharedWithGroupID: uuid.MustParse("1a2b3c4d-5e6f-4a1b-8c2d-3e4f5a6b7c8d"),
},
},
{
Name: "SharedWithGroupID",
Query: "shared_with_group:a7d1ba00-53c7-4aa6-92ea-83157dd57480",