Skip to content

Commit c5f59c7

Browse files
authored
[RFC]: GitHub Organization Management (#80)
This proposes a way to manage the OpenXLA GitHub organization while it's under the Google GitHub Enterprise account.
1 parent e559ec9 commit c5f59c7

File tree

2 files changed

+220
-0
lines changed

2 files changed

+220
-0
lines changed

rfcs/20230516-github-organization.md

+220
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,220 @@
1+
# GitHub Organization Management
2+
3+
As we are spinning up the governance of the OpenXLA project, we are still in a
4+
state where a number of things are managed by Google. In particular, the OpenXLA
5+
GitHub organization is a Google-affiliated organization under Google's GitHub
6+
Enterprise account. While we want to make the project as open as possible, this
7+
state does create a few constraints on how things are run that require adherence
8+
to Google policies. First, we want to acknowledge that this is sub-optimal and
9+
assure you that it is not the goal state. 🙂 Fortunately, all these policies are
10+
at least
11+
[documented publicly](https://opensource.google/documentation/reference).
12+
13+
We are also aiming to make
14+
[governance](https://github.com/openxla/community/blob/main/governance/GOVERNANCE.md)
15+
of the OpenXLA project based on individuals and their contributions to the
16+
project, not based on the organizations with whom they are affiliated. At the
17+
same time, we recognize that companies are making significant investments in the
18+
project and that work on OpenXLA is frequently coordinated within teams at a
19+
given company (note I use "company" throughout this RFC rather than
20+
"organization" to avoid ambiguity with GitHub organizations).
21+
22+
We'd like to set up the GitHub organization in a way that balances these
23+
concerns and makes permissions management as seamless as possible. Ideally,
24+
administration of the GitHub organization will be transparent and we can get it
25+
out of the way of working on the core aspects of the project.
26+
27+
## Basic Model
28+
29+
The OpenXLA project delegates administration of the OpenXLA GitHub organization
30+
to Google. This comes with GitHub Enterprise features including self-hosted
31+
GitHub Actions runners and large GitHub-managed runners. It also imposes the
32+
constraint, however, that the organization must conform to Google's policies for
33+
its GitHub organizations. This delegation can be revisited at any time by the
34+
Core Maintainers.
35+
36+
Google will appoint a few OpenXLA members who are also Google employees to
37+
manage the administration of the GitHub organization. These Googlers will be the
38+
contact point for questions about the GitHub organization and they will be
39+
responsible for maintaining compliance with relevant policies. For visibility,
40+
they will be added to an OpenXLA GitHub team, `github-owners`. They will also
41+
seek clarification of, alteration to, or exemption from Google's policies
42+
surrounding GitHub organizations when they create a hindrance for the project,
43+
though none of these can be guaranteed.
44+
45+
## Adding Organization Members
46+
47+
GitHub's auth model is such that it is extremely difficult to meaningfully
48+
develop a GitHub project without being a collaborator on that project. In
49+
particular, being a collaborator is required to be tagged, to be added as
50+
reviewer, to add reviewers, to add labels, to run presubmits, etc. Forking and
51+
sending a PR is fine for one-off or occasional contribution, but for day-to-day
52+
development you really need some level of explicit access. Read-only access will
53+
enable some of these, but "triage" access is needed for some of them and is
54+
generally a reasonable level for most people.
55+
56+
However, organization membership does grant some access that would be
57+
problematic if abused, such as the ability to run CI (which is effectively
58+
remote code execution as a service). We therefore do want to maintain *some*
59+
controls on who has access. Additionally, we want to maintain visibility and
60+
auditability of that that access. Managing collaborators at the level of an
61+
individual repository can make it quite difficult to keep track of. We would
62+
like to have it administered in such a way that access can be tracked and
63+
managed at the organization level instead.
64+
65+
Google's policies on GitHub organizations include that
66+
[only Googlers may be repository or organization admins](https://opensource.google/documentation/reference/github/owners).
67+
Even then, the number of organization admins is kept very limited. Admins have
68+
extremely broad access, which can be quite destructive if they are misused
69+
(intentionally or unintentionally). Unfortunately, these permissions are bundled
70+
with many permissions that are far more mundane and which would be appropriate
71+
to grant to other community members. In particular, this includes the ability to
72+
add people to the organization. Currently, the few of us who are organization
73+
admins have to manually add people each time it is requested. While it is
74+
possible to make organization members
75+
["maintainers" of a team](https://docs.github.com/en/organizations/organizing-members-into-teams/assigning-the-team-maintainer-role-to-a-team-member),
76+
which allows them to add people to that team, they are still restricted to only
77+
adding existing organization members. GitHub also allows creating
78+
[custom roles](https://docs.github.com/en/enterprise-cloud@latest/organizations/managing-peoples-access-to-your-organization-with-roles/managing-custom-repository-roles-for-an-organization),
79+
but the permissions available to give to a custom role do not include any of the
80+
admin permissions. So we are currently using the "human proxy" approach, which
81+
is cumbersome and extremely annoying for those of us who act as said human
82+
proxies.
83+
84+
This is particularly frustrating at the level of companies, because many,
85+
including Google, have a lot of people working on OpenXLA in some capacity and
86+
there is a high volume of requests. Further, adding new organization members who
87+
are contributing as part of their employment by a company may run afoul of
88+
company policies. For instance, Google requires that employees contributing on
89+
GitHub
90+
[register their GitHub account](https://opensource.google/documentation/reference/github/accounts).
91+
While the Google employees who are GitHub organization admins can enforce this
92+
policy (albeit somewhat manually), we have no knowledge of policies at other
93+
companies, and we don't want to lead people into accidentally violating them. It
94+
would be far preferable to empower contributors from other companies to add
95+
others from their company. Companies may also have existing tooling for syncing
96+
their internal user management to GitHub teams (Google has such tooling), which
97+
could automatically provide access when someone starts working on a project.
98+
Finally, companies have "skin in the game" when they grant someone access to a
99+
project and are unlikely to grant access to random people on the internet.
100+
101+
We would like to enable easy administration based on pragmatism without
102+
compromising the focus in OpenXLA on individual membership and meritocratic
103+
governance.
104+
105+
### Proposal
106+
107+
At a high level we enable trusted contributors to add community members to the
108+
OpenXLA GitHub organization and we create some GitHub teams managed along
109+
company lines that grant "triage" access.
110+
111+
We create a simple HTTP service using GCP Cloud Functions that proxies access to
112+
add organization members to the OpenXLA organization. The API will exactly match
113+
GitHub's own REST API for adding organization members. For some reason there are
114+
two methods for this, but we would use the
115+
[simpler one](https://docs.github.com/en/rest/orgs/members?apiVersion=2022-11-28#set-organization-membership-for-a-user)
116+
that makes use of the user's username rather than requiring looking up their ID.
117+
Passing a non-empty body (which allows adding someone with the role of admin)
118+
would be an error. Some contributors would then be granted access to the HTTP
119+
endpoint and could use it to add contributors at their own discretion. All
120+
project Maintainers (Core and Module) will be granted access to this API once
121+
those groups are established. Additional access will be decided upon by the Core
122+
Maintainers once that body is established and the Interim Steering Committee in
123+
the meantime.
124+
125+
Additionally, we will create GitHub teams for each company with at least 3
126+
employees contributing to OpenXLA. This cutoff was chosen somewhat arbitrarily
127+
for pragmatic reasons. Having a bunch of small teams is a bit of extra overhead
128+
to manage, and if there are only a few people from a company involved, then it
129+
is easier to add them manually than to set up a team with maintainer
130+
permissions, etc. We will grant representatives of each company "maintainer"
131+
permission on their respective teams (note that this is a GitHub teams concept
132+
entirely separate from the OpenXLA governance "module maintainer"). Depending on
133+
the preferences of the company in question, this could also have child teams
134+
within it. Upon request, we will also try to build integrations with other
135+
automation for managing these teams and adding organization members, provided it
136+
can be done so without enabling direct admin permissions.
137+
138+
We will also create an additional team for all other community members. This
139+
will be for anyone not participating as part of their affiliation with a company
140+
or who is one of a few members of a company without a dedicated GitHub team.
141+
142+
All of these teams will be child teams of a single "triage" team that will, in
143+
effect, contain all community members. This team will grant triage permissions
144+
to all repositories under the GitHub organization. Having separate sub-teams
145+
allows easier tracking
146+
147+
Write access and above, however, will continue to be administered manually. We
148+
believe that enabling triage-access management organized by company while
149+
keeping higher-level access tied to the individual strikes the right balance of
150+
pragmatism and promotes the OpenXLA membership and governance model that we seek
151+
to create. Module Maintainers, with the guidance of Core Maintainers, will
152+
determine who has write access to the repositories they maintain (the Interim
153+
Steering Committee will decide in the meantime). For each repository, we will
154+
create a `<repo>-write` team, containing people who have the write role in the
155+
GitHub repository access model. Module Maintainers will be made "maintainers" of
156+
this team. Initially, we expect write access to be granted quite liberally
157+
because GitHub makes it difficult to make significant contribution to a project
158+
without it. In particular, you can't hit merge on your own PRs, even if they're
159+
approved. We anticipate that this will not scale indefinitely however, and
160+
intend to make such access less necessary through automations such as a merge
161+
bot that handles merging of PRs when all conditions are met. We may subsequently
162+
want to revoke write access for this reason as it also has somewhat broad
163+
permissions such as creating new branches in the repository or editing releases.
164+
In the meantime, we trust community members to use good judgement. For instance:
165+
make sure to get code review from someone who is a primary contributor or
166+
maintainer of the codebase for your PR, don't edit releases unless you are part
167+
of managing releases, etc. Just because you *can* do something according to
168+
GitHub's permissions doesn't mean that you should. When in doubt, it never hurts
169+
to ask.
170+
171+
Since there will be far fewer people with admin and maintain roles, we propose
172+
managing these mostly at the repository level. An earlier draft of this proposal
173+
included corresponding `<repo>-admin` and `<repo>-maintain` teams, but 3 teams
174+
per repository seemed like a lot of overhead. Repository "maintain" access will
175+
mostly follow the OpenXLA "Module Maintainer" role, although may deviate
176+
slightly when modules don't follow strict repository boundaries or when Module
177+
and Core Maintainers deem it would be useful to give someone else that
178+
permission but it would not be appropriate to make them a module maintainer for
179+
whatever reason.
180+
181+
Admin privileges, per Google policy, will be restricted to Googlers, who will
182+
help non-Google maintainers with any settings they can't access. We anticipate
183+
that such settings will not need to be modified frequently, but if it becomes a
184+
significant issue, we can investigate additional proxy services, similar to the
185+
one for adding organization members.
186+
187+
To enable auditability and visibility of those with the "maintain" and "admin"
188+
roles on repositories we will create one team for each of these for the entire
189+
organization (not per repo): `repo-admins` and `repo-maintainers`. Any member
190+
who is an admin of any repository must be in the `repo-admins` team and
191+
similarly for the maintain role. We will also introduce automation to enforce
192+
this invariant as well as ensure that other permissions are not given at the
193+
repository level. For each repository it will check the collaborators and ensure
194+
that all admins are in the `repo-admins` team, all maintainers are in the
195+
`repo-maintainers` team, the `<repo>-write` team has write access, and there are
196+
no other collaborators. We can configure it to initially warn and then enforce
197+
these restrictions. We will use the organization setting that prevents adding
198+
collaborators who are not in the organization:
199+
200+
![outside_collaborators_setting](20230516-github-organization/outside_collaborators_setting.png)
201+
202+
## Creating Repositories
203+
204+
Creating new repositories in a Google-managed organization is subject to
205+
[Google's policy for "releasing"](https://opensource.google/documentation/reference/releasing).
206+
The OpenXLA process for creating new repositories has not been formally defined,
207+
so as with other things, the Interim Steering Committee has been making
208+
decisions ad-hoc as necessary to unblock the project. Any repo creation in the
209+
OpenXLA GitHub organization would first and foremost need to meet whatever
210+
guidelines are set out by the Core Maintainers. The Google OpenXLA GitHub admins
211+
will do our best to avoid the additional Google process causing issues. For
212+
instance, we can start the launch process as soon as an RFC is published or
213+
consensus is building that a new repo is required so that when a decision is
214+
made we only have to hit the appropriate button to create the repo. However, new
215+
repositories will need to conform with Google policies like having a LICENSE
216+
file, including license headers, etc. We will publish a template repository,
217+
analogous to [google/new-project](https://github.com/google/new-project), that
218+
should make creation of new repositories that comply with these policies
219+
straightforward. We are actively investigating what additional steps we can take
220+
to minimize the friction created here.
Loading

0 commit comments

Comments
 (0)