-
Notifications
You must be signed in to change notification settings - Fork 14
Introduce github-mgmt repository #99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
This would also finally open the doors to automatically list team members on nixos.org (ping @avocadoom)! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving conditional on testing against
- accidental deletions (e.g. can a repo and all its metadata be deleted or what would it take?)
- a plan B for the possibility that all admins that are managed by this system are locked out
As another data point: https://github.com/apache/infrastructure-asfyaml |
Thanks for the SC approval! We (org owners) will evaluate this more before committing because there's some security concerns:
We can do:
With some of the above I expect us to have enough confidence in the deployment, but we'll see |
Another data point: https://github.com/eclipse-csi/otterdog |
Some thoughts:
For this one specifically, I find it a bit odd that we can't restrict it -- realistically, we only need to give the app content access to the management repo, since we aren't using its capability to add files to other repos in the org.
Couldn't we give the app member permissions, but not make it an owner itself, which may allow some security in this sense (that is, it can't remove non-owners)?
I like this.
Doesn't prevent things like issues/wiki/etc from being wiped -- we'd need good backup solutions for those.
We'd have to ask, but this may be doable, esp. given we'll probably be its biggest (in terms of members) user.
Ah, yeah, exactly what I said above. :) |
Yeah so we need two GitHub Apps for that, because any single GitHub apps permissions are only restricted to essentially the cross product of repos and permissions, so it's not possible to give it certain permissions for one repo and different permissions for another/all.
Permissions of GitHub apps are separate from the user model, the App isn't an owner itself. That said, it's a really interesting idea to make it use the user model instead:
This way there would be no way for the tool to remove admins nor repos! Frankly this sounds like a really good option, probably medium difficulty since it requires some upstream changes. Separately I'd also like to highlight @arianvp's suggestion here and the associated discussion as a potential alternative security model. |
I've submitted ipdxco/github-as-code#198 to implement the above-mentioned idea, and confirmed that it works for team management! |
I looked into that briefly - am I correct that this is "only" about managing teams and memberships? Or can/will repo settings be managed this way as well, for example branch protection rules? Especially branch protection rules are potentially complicated, so would be very nice to have them transparently available as code.
Seems like only admins can configure branch protection rules, but not maintainers. So this approach would rule out the above. |
It seems like github-as-code only supports the old branch protection rules and not the newer rulesets, which are a lot more flexible. At least that's what the example in the repo tells me: https://github.com/Infinisil-s-Test-Organization/github-as-code/blob/master/docs/EXAMPLE.yml. Since the branch pattern to match on is the yaml key, it seems very unlikely that this can support the more advanced And since that's 2-way sync, I assume those rulesets would also not show up in the repo, when we configure them in the settings... it looks to me like github-as-code might be too limited. |
github-as-code supports repo settings as well, but for now we're only interested in managing team with it. I don't think it would be a big issue for github-as-code to support rulesets as well (in theory), YAML keys can just be quoted, and the DSL of the yaml can be arbitrary. The nice thing about rulesets though is that they are transparent by default. E.g. check out the branches in the nixfmt repo and click on the little 🛡️ icon next to |
After me and @winterqt have experimented with the suggestion in #40 of using github-as-code, we're confident that we should deploy for real, so that people can more easily request GitHub org changes by just making PRs.
As this is strictly outside the authority of the org owners, I am hereby formally requesting @NixOS/steering approval to give the org owners authority over the deployment of github-as-code.
Some notes: