1
1
# Team manager
2
2
3
- Team manager is a utility that allows an organization owner to add or remove
3
+ Team manager is a utility that allows an organization owner to:
4
+ - add or remove
4
5
people from existing teams and / or assign people for [ GitHub team review
5
- assignments] ( https://docs.github.com/en/github/setting-up-and-managing-organizations-and-teams/managing-code-review-assignment-for-your-team ) .
6
+ assignments] ( https://docs.github.com/en/github/setting-up-and-managing-organizations-and-teams/managing-code-review-assignment-for-your-team ) ;
7
+ - configure repository permissions for teams and individual users;
8
+ - keep track of all "outside collaborators" and the reason why they are outside
9
+ collaborators;
10
+ - check if all teams have enough reviewers;
6
11
7
12
## Features
8
13
@@ -11,14 +16,16 @@ assignments](https://docs.github.com/en/github/setting-up-and-managing-organizat
11
16
- [X] Sync local configuration file into GitHub.
12
17
- [X] Add and / or remove new members to / from teams.
13
18
- [X] Exclude team members from code review assignments.
19
+ - [x] Create or delete teams that are added or removed from the local
20
+ configuration file.
21
+ - [x] Sync team and user permissions of repositories.
22
+ - [x] Check Status of teams. Useful to know if teams have enough reviewers.
14
23
- [X] GitHub action (see example below)
15
24
16
25
## Missing features
17
26
18
27
- [ ] Retrieve excluded team members from the code review assignments
19
28
(not provided by GitHub API).
20
- - [ ] Create or delete teams that are added or removed from the local
21
- configuration file.
22
29
23
30
# Build
24
31
@@ -44,8 +51,18 @@ Creating configuration file "cilium-team-assignments.yaml"...
44
51
45
52
``` yaml
46
53
organization : cilium
47
- slackWorkspace : cilium.slack.com
48
- # List of members that belong to the organization, ordered by GitHub login (username).
54
+ repositories :
55
+ # Repository name
56
+ cilium :
57
+ # User-specific permissions. Always prefixed with 'USER'.
58
+ # Valid options: 'USER-ADMIN', 'USER-MAINTAIN', 'USER-WRITE', 'USER-TRIAGE', 'USER-READ'
59
+ USER-READ :
60
+ - ciliumbot
61
+ # Team-specific permissions.
62
+ # Valid options: 'ADMIN', 'MAINTAIN', 'WRITE', 'TRIAGE', 'READ'
63
+ WRITE :
64
+ - bpf
65
+ - sig-policy
49
66
members :
50
67
aanm :
51
68
# User ID, retrieved from GitHub
@@ -60,35 +77,62 @@ members:
60
77
joestringer :
61
78
id : MDQ6VXNlcjEyNDMzMzY=
62
79
name : Joe Stringer
63
- # List of teams that belong to the organization, ordered by team names.
80
+ # The list of 'outsideCollaborators' is automatically derived from the list of users that don't
81
+ # belong to the organization but have access to at least one of the repositories
82
+ # of the organization.
83
+ outsideCollaborators :
84
+ ciliumbot :
85
+ reason : " Only has access to some repositories"
86
+ # List of teams that belong to the organization.
64
87
teams :
65
- bpf :
88
+ # Team Name
89
+ Cilium Teams :
66
90
# team ID, retrieved from GitHub
67
- id : MDQ6VGVhbTI1MTk3Nzk=
68
- # List of members' logins that belong to this team.
69
- members :
70
- - aanm
71
- - borkmann
72
- - joestringer
73
- # codeReviewAssignment
74
- codeReviewAssignment :
75
- # algorithm, currently can be LOAD_BALANCE or ROUND_ROBIN.
76
- algorithm : LOAD_BALANCE
77
- # set 'true' if codeReviewAssignment should be enabled.
78
- enabled : true
79
- # Notify the entire team of the PR if it is delegated.
80
- notifyTeam : false
81
- # List of members that should be excluded from receiving reviews, and an
82
- # optional reason.
83
- excludedMembers :
84
- # GitHub login name (username).
85
- - login : aanm
86
- reason : Want to be part of team 'bpf' but will not be assigned to leave
87
- reviews.
88
- # The number of team members to assign.
89
- teamMemberCount : 1
91
+ id : T_kwDOAUFEZs4Ah5D3
92
+ # team restID, retrieved from GitHub
93
+ restID : 8884471
94
+ # Team's description
95
+ description : Teams and sigs used for Cilium projects
96
+ # Team's privacy settings. Valid values: VISIBLE|SECRET
97
+ privacy : VISIBLE
98
+ # Teams that are children of this parent team
99
+ children :
100
+ # Team Name
101
+ ebpf :
102
+ # team ID, retrieved from GitHub
103
+ id : MDQ6VGVhbTQ5MjY2ODE=
104
+ # team restID, retrieved from GitHub
105
+ restID : 4926681
106
+ # Team's description
107
+ description : All code related with ebpf.
108
+ # List of members' logins that belong to this team.
109
+ members :
110
+ - aanm
111
+ - borkmann
112
+ - joestringer
113
+ codeReviewAssignment :
114
+ # algorithm, currently can be LOAD_BALANCE or ROUND_ROBIN.
115
+ algorithm : LOAD_BALANCE
116
+ # set 'true' if codeReviewAssignment should be enabled.
117
+ enabled : true
118
+ # Notify the entire team of the PR if it is delegated.
119
+ notifyTeam : false
120
+ # List of members that should be excluded from receiving reviews, and
121
+ # an optional reason.
122
+ excludedMembers :
123
+ # GitHub login name (username).
124
+ - login : aanm
125
+ reason : Want to be part of team 'bpf' but will not be assigned to leave
126
+ reviews.
127
+ # The number of team members to assign.
128
+ teamMemberCount : 1
129
+ # Team's privacy settings. Valid values: VISIBLE|SECRET
130
+ privacy : VISIBLE
131
+ # Team Name
90
132
policy :
91
133
id : MDQ6VGVhbTI1MTk3ODY=
134
+ restID : 8884472
135
+ description : All control plane code related with Policy
92
136
members :
93
137
- aanm
94
138
- joestringer
@@ -97,6 +141,7 @@ teams:
97
141
enabled : true
98
142
notifyTeam : true
99
143
teamMemberCount : 1
144
+ privacy : SECRET
100
145
# List of members that should be excluded from review assignments for the teams
101
146
# that they belong. This list can exist for numerous reasons, person is
102
147
# currently PTO or busy with other work.
@@ -107,7 +152,7 @@ excludeCodeReviewAssignmentFromAllTeams:
107
152
4. Once the changes stored in a local configuration file, run ` ./team-manager push --org cilium`:
108
153
109
154
` ` ` bash
110
- $ ./team-manager push --org cilium
155
+ $ ./team-manager push --config-filename ./ cilium-team-assignments.yaml
111
156
Local config out of sync with upstream: Unified diff:
112
157
--- local
113
158
+++ remote
@@ -136,8 +181,30 @@ Excluding members from team: bpf
136
181
Excluding members from team: policy
137
182
` ` `
138
183
184
+ # Repository and members sync
185
+
186
+ Starting with v1.0.0, team-manager has the ability to also sync repository and
187
+ members permissions. Before changing the file locally to push new changes,
188
+ it is important to always perform a 'sync' :
189
+ ` ` ` bash
190
+ $ ./team-manager sync --config-filename ./team-assignments.yaml
191
+ ` ` `
192
+
193
+ Then, after modifying the file on `team-assignments.yaml`, push the changes :
194
+
195
+ ` ` ` bash
196
+ $ ./team-manager push --config-filename ./team-assignments.yaml
197
+ ` ` `
198
+
139
199
# GitHub action
140
200
201
+ On a large GitHub organization, it might be difficult to control who can create
202
+ repositories. Thus, when running team manager with a GitHub action, it should
203
+ run with `--repositories=false` and `--members=false` otherwise the GitHub
204
+ action might override repository permissions that were set from the web-ui
205
+ and remove or add members to the organization that were previously added or
206
+ removed from the web-ui.
207
+
141
208
` ` ` yaml
142
209
name: Team management
143
210
on:
@@ -152,11 +219,43 @@ jobs:
152
219
runs-on: ubuntu-20.04
153
220
steps:
154
221
- uses: actions/checkout@v1
155
- - uses: docker://quay.io/cilium/team-manager:v0 .0.1
222
+ - uses: docker://quay.io/cilium/team-manager:v1 .0.0
156
223
name: Sync team
157
224
with:
158
225
entrypoint: team-manager
159
- args: push --force --config-filename ./team-assignments.yaml
226
+ # With --repositories=false --members=false, it will have the same
227
+ # behavior as <= v0.0.8.
228
+ args: --force --repositories=false --members=false --config-filename ./team-assignments.yaml
160
229
env:
161
230
GITHUB_TOKEN: ${{ secrets.ADMIN_ORG_TOKEN }}
162
- ` ` `
231
+ ` ` `
232
+
233
+ # Check number of reviewers
234
+
235
+ To disable code review assignments, the GitHub user can either set its status as
236
+ ' busy' or the team maintainer can exclude them from the list of reviewers.
237
+
238
+ Since the team maintainer can't control the status of the user, it is important
239
+ to retrieve the list of teams that don't have enough reviewers, by checking
240
+ which users have their status as 'busy' or the ones that are excluded from
241
+ reviews.
242
+
243
+ ` ` ` bash
244
+ $ ./team-manager status --config-filename ./cilium-team-assignments.yaml
245
+ Checking status of "aanm"
246
+ Checking status of "joestringer"
247
+ Checking status of "borkmann"
248
+ Team "bpf" with 3 members doesn't have enough reviewers:
249
+ - aanm - excluded
250
+ - joestringer - busy
251
+ - borkmann - ok
252
+ ` ` `
253
+
254
+ # Upgrade from <=0.0.8 to 1.0.0
255
+
256
+ 1. Use 'sync' to sync the upstream configuration with the local file. It will
257
+ fetch the information from GitHub and merge it with the local file.
258
+
259
+ ` ` ` bash
260
+ $ ./team-manager sync --config-filename ./team-assignments.yaml
261
+ ` ` `
0 commit comments