chore: Update valid permissions for organization repository role#3444
chore: Update valid permissions for organization repository role#3444w1mvy wants to merge 2 commits into
Conversation
|
👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labeled with |
| } | ||
|
|
||
| // Snapshot of the response to https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/custom-roles?apiVersion=2022-11-28#list-repository-fine-grained-permissions-for-an-organization | ||
| // Snapshot of the response to https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/custom-roles?apiVersion=2026-03-10#list-repository-fine-grained-permissions-for-an-organization |
There was a problem hiding this comment.
issue: Please don't change the API version, since the SDK hasn't upgraded API Version yet either.
|
|
||
| // Snapshot of the response to https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/custom-roles?apiVersion=2022-11-28#list-repository-fine-grained-permissions-for-an-organization | ||
| // Snapshot of the response to https://docs.github.com/en/enterprise-cloud@latest/rest/orgs/custom-roles?apiVersion=2026-03-10#list-repository-fine-grained-permissions-for-an-organization | ||
| // The endpoint isn't covered in the SDK yet. |
There was a problem hiding this comment.
This line isn't accurate anymore: https://github.com/google/go-github/blob/master/github/orgs_custom_repository_roles.go#L168
stevehipwell
left a comment
There was a problem hiding this comment.
@deiga I think we were planning on revisiting this once I got the endpoint added to go-github. We could generate the data, but it would still need a release to keep it up to date. How about we look at adding a singleton pattern to make it available in the provider?
Before the change?
validRolePermissionsingithub/resource_github_organization_repository_role.gowas a snapshot of the GitHub repository fine-grained permissions API and had drifted from the upstream response. It rejected newer permissions (read_copilot_agent_settings,write_copilot_agent_settings,write_repository_agent_secrets,write_repository_agent_variables) at plan time viaCustomizeDiff, even though the GitHub API would accept them.apiVersion=2022-11-28, which is no longer the current version on the linked GitHub docs page.After the change?
validRolePermissions(kept alphabetically sorted) so configurations using them now pass validation.apiVersion=2026-03-10to match the current GitHub docs page forGET /orgs/{org}/repository-fine-grained-permissions.GET /orgs/{org}/repository-fine-grained-permissionsagainst a real org and diffing the returnednames against the existing slice; only additions were observed (no permissions removed upstream).Pull request checklist
Notes:
make generatedocsproduced no diff (the generated docs do not enumerate individual permissions).make fmt,make lint, andmake testall pass locally.Does this introduce a breaking change?