MCPcopy Index your code
hub / github.com/coder/coder / Group

Function Group

coderd/database/dbgen/dbgen.go:1077–1091  ·  view source on GitHub ↗
(t testing.TB, db database.Store, orig database.Group)

Source from the content-addressed store, hash-verified

1075}
1076
1077func Group(t testing.TB, db database.Store, orig database.Group) database.Group {
1078 t.Helper()
1079
1080 name := takeFirst(orig.Name, testutil.GetRandomName(t))
1081 group, err := db.InsertGroup(genCtx, database.InsertGroupParams{
1082 ID: takeFirst(orig.ID, uuid.New()),
1083 Name: name,
1084 DisplayName: takeFirst(orig.DisplayName, name),
1085 OrganizationID: takeFirst(orig.OrganizationID, uuid.New()),
1086 AvatarURL: takeFirst(orig.AvatarURL, "https://logo.example.com"),
1087 QuotaAllowance: takeFirst(orig.QuotaAllowance, 0),
1088 })
1089 require.NoError(t, err, "insert group")
1090 return group
1091}
1092
1093// GroupMember requires a user + group to already exist.
1094// Example for creating a group member for a random group + user.

Callers 15

TestGroupParamFunction · 0.92
TestTelemetryFunction · 0.92
TestApplyGroupDifferenceFunction · 0.92
SetupOrganizationFunction · 0.92
TestOKFunction · 0.92
TestGroupRemovalTriggerFunction · 0.92

Calls 5

GetRandomNameFunction · 0.92
takeFirstFunction · 0.70
HelperMethod · 0.65
InsertGroupMethod · 0.65
NewMethod · 0.65

Tested by 15

TestGroupParamFunction · 0.74
TestTelemetryFunction · 0.74
TestApplyGroupDifferenceFunction · 0.74
SetupOrganizationFunction · 0.74
TestOKFunction · 0.74
TestGroupRemovalTriggerFunction · 0.74