Full list of groups should include group names as well as group_name:team_name
This commit is contained in:
parent
e5ebcf518a
commit
20bc6cd353
2 changed files with 5 additions and 3 deletions
|
@ -391,9 +391,8 @@ func (c *githubConnector) userGroups(ctx context.Context, client *http.Client) (
|
||||||
|
|
||||||
groups := make([]string, 0)
|
groups := make([]string, 0)
|
||||||
for _, o := range orgs {
|
for _, o := range orgs {
|
||||||
if teams, ok := orgTeams[o]; !ok {
|
groups = append(groups, o)
|
||||||
groups = append(groups, o)
|
if teams, ok := orgTeams[o]; ok {
|
||||||
} else {
|
|
||||||
for _, t := range teams {
|
for _, t := range teams {
|
||||||
groups = append(groups, formatTeamName(o, t))
|
groups = append(groups, formatTeamName(o, t))
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,9 +53,11 @@ func TestUserGroups(t *testing.T) {
|
||||||
|
|
||||||
expectNil(t, err)
|
expectNil(t, err)
|
||||||
expectEquals(t, groups, []string{
|
expectEquals(t, groups, []string{
|
||||||
|
"org-1",
|
||||||
"org-1:team-1",
|
"org-1:team-1",
|
||||||
"org-1:team-2",
|
"org-1:team-2",
|
||||||
"org-1:team-3",
|
"org-1:team-3",
|
||||||
|
"org-2",
|
||||||
"org-2:team-4",
|
"org-2:team-4",
|
||||||
"org-3",
|
"org-3",
|
||||||
})
|
})
|
||||||
|
@ -95,6 +97,7 @@ func TestUserGroupsWithTeamNameFieldConfig(t *testing.T) {
|
||||||
|
|
||||||
expectNil(t, err)
|
expectNil(t, err)
|
||||||
expectEquals(t, groups, []string{
|
expectEquals(t, groups, []string{
|
||||||
|
"org-1",
|
||||||
"org-1:team-1",
|
"org-1:team-1",
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue