-
Notifications
You must be signed in to change notification settings - Fork 746
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
feat: support team organization role assignment #2322
base: main
Are you sure you want to change the base?
feat: support team organization role assignment #2322
Conversation
} | ||
|
||
octokitClient, err := pkg.NewApiClient( | ||
// pkg.WithUserAgent("my-user-agent"), // Should this be set to terraform-provider-github or similar? Doesn't look like the user-agent is set for the other clients |
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.
Seems like the provider is not setting the user-agent
for the other clients, but maybe it should?
} | ||
|
||
// There is no api for checking a specific team role assignment, so instead we iterate over all teams assigned to the role | ||
// go-github pagination (https://github.com/google/go-github?tab=readme-ov-file#pagination) |
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.
Using google/go-github
here instead of octokit/go-sdk
since the former doesn't support pagination
|
||
randomID := acctest.RandStringFromCharSet(5, acctest.CharSetAlphaNum) | ||
|
||
// Using the predefined roles since custom roles are a strictly Enterprise feature ((https://github.blog/changelog/2024-07-10-pre-defined-organization-roles-that-grant-access-to-all-repositories/)) |
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.
Since custom organization roles are a Enterprise level feature, I have elected to not use them in the tests and instead use the built-in roles instead. I've created a manual mapping for their role_id
:s here. Not ideal, but I don't have a better way of testing this
Looking forward to this feature! Any thoughts on when it might be implemented? |
Resolves #2314
Before the change?
After the change?
github_team_organization_role_assignment
resource which is used to assign an organization role to a teamoctokit/go-sdk
sincegoogle/go-github
lacked support for assigning a role to a team as far as I could see. go-github is still being used for this resource though, as go-sdk lacks support for pagination (Allow to easily use GitHub Pagination. microsoft/kiota#4698), which is needed in the READ implementationFiles changed
tab lags... https://github.com/orgs/community/discussions/39341Pull request checklist
Does this introduce a breaking change?
Please see our docs on breaking changes to help!