Repository navigation
Backport organization role assignments - #126
Merged
Merged
Conversation
GithubOrgMembers gains org_role_assignments, mapping an organization role name to the members who should hold it. create_org_role_assignments looks the role IDs up by name at deploy time and creates OrganizationRoleUser resources. fully_configure_teams validates that every assignee is an org member. The README and token comment note the extra Custom organization roles permission the deploy token then needs. Backported from a downstream project where it has been running since the summer, together with its tests.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 3 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Link to Issue or Message thread
None. Backport ahead of a ruleset change that touches the same files, so that change can be reviewed on its own.
Why is this change necessary?
A downstream project added organization role assignments (granting a predefined GitHub organization role, such as all-repository triage, to individual members) directly in its copy of the template-managed
github_reposfiles and never backported it. The next template change tolib/teams.pyorlib/program.pywould collide with that local divergence duringcopier update.How does this change address the issue?
Ports the feature as it runs downstream:
GithubOrgMembers.org_role_assignments: role name to list of usernames.create_org_role_assignmentslooks role IDs up by name at deploy time (get_organization_roles) and createsOrganizationRoleUserresources.fully_configure_teamsvalidates that every assignee is an org member, withGithubOrgRoleUserNotInOrgMembersErrorandGithubOrganizationRoleNotFoundErrorfor the failure cases.ALL_REPOSITORY_TRIAGE_ROLEconstant for the predefined Enterprise Cloud role.Custom organization roles: Read & writepermission the deploy token needs when assignments are configured.The one project-specific line in the downstream
program.py(an extra repo inroot_team_push_repos) was left out.What side effects does this change have?
None for projects that leave
org_role_assignmentsempty:create_org_role_assignmentsreturns before any API call, so no new token permission is needed until a role is assigned.How do we know this works?
ensure_full_repo_nameandroot_team_push_reposthat had only existed downstream.Other
🤖 Generated with Claude Code