1 |
Hi, everyone. |
2 |
|
3 |
Robin has given me some fresh inspiration to move our GitHub pull |
4 |
request business a little bit forward, and today I've finished |
5 |
deploying two new features: Gentoo org team syncing and pull request |
6 |
auto-assignment. |
7 |
|
8 |
The team syncing part means that we now have the automation to match |
9 |
developers to their GitHub accounts, and create GitHub teams from |
10 |
projects. The scripts are living in [1] (and require patched PyGithub |
11 |
[2]). I'm currently running them manually but they can be eventually |
12 |
put into a cronjob. |
13 |
|
14 |
The developer syncing part obtains developer GitHub usernames from LDAP |
15 |
(gentooGitHubUser attribute), and adds or removes the respective GitHub |
16 |
users from the 'developers' team appropriately. Therefore, if you |
17 |
haven't filled up your LDAP, please do so now: |
18 |
|
19 |
perl_ldap -C gentooGitHubUser <gh-username> <gentoo-username> |
20 |
|
21 |
The project syncing part obtains all projects and their members from |
22 |
projects.xml (generated from the Wiki), and updates the members of |
23 |
respective GitHub teams appropriately. The projects are matched by |
24 |
their e-mail user part, name or URL-name (i.e. a lot of guessing but |
25 |
works for all of them currently). GitHub teams that don't match any |
26 |
project are not altered. |
27 |
|
28 |
As far as updates are concerned, only GitHub users that match developer |
29 |
accounts are added to and removed from teams, i.e. you can add external |
30 |
team members without worrying that the script will remove them. |
31 |
|
32 |
The script is also capable of creating new teams. However, this |
33 |
requires manual confirmation (and choice of team name). |
34 |
|
35 |
Having full sync of GitHub organization members and project teams, I |
36 |
have went ahead and implemented auto-assignment of pull requests. |
37 |
The script runs every 4 minutes and assigns all pull requests that do |
38 |
not have an explicit assignee, and do not have either 'assigned' or |
39 |
'need assignment' labels. |
40 |
|
41 |
The assignment is done based on in-::gentoo (not in pull-request!) |
42 |
metadata.xml files, the LDAP mapping of developers and the projects.xml |
43 |
mapping of projects. Pull requests regarding new packages |
44 |
and maintainer-needed packages are special-cased for proxy-maint. |
45 |
Pure eclass and profile changes are left for manual assignment. Pull |
46 |
requests regarding packages that are maintained purely by developers |
47 |
refusing to work with users on GitHub are left for manual assignment |
48 |
as well. |
49 |
|
50 |
The automatic assignment is also disabled if the pull request affects |
51 |
packages with more than 5 unique sets of maintainers. |
52 |
|
53 |
To prevent your pull request from being auto-assigned, either assign it |
54 |
yourself or add an 'assigned' label. To have pull request re-assigned |
55 |
after changing the contents, remove the assignee and/or 'assigned' |
56 |
label. |
57 |
|
58 |
[1]:https://github.com/mgorny/dev2github |
59 |
[2]:https://github.com/PyGithub/PyGithub/pull/490 |
60 |
|
61 |
-- |
62 |
Best regards, |
63 |
Michał Górny |
64 |
<http://dev.gentoo.org/~mgorny/> |