Skip to content

fix: Fix org roles implementation#2968

Merged
nickfloyd merged 1 commit intointegrations:mainfrom
stevehipwell:fix-org-role
Dec 5, 2025
Merged

fix: Fix org roles implementation#2968
nickfloyd merged 1 commit intointegrations:mainfrom
stevehipwell:fix-org-role

Conversation

@stevehipwell
Copy link
Copy Markdown
Collaborator

@stevehipwell stevehipwell commented Dec 4, 2025

Resolves #2805
Resolves #2960

This PR improves on the code in #2487.


Before the change?

  • Org roles re-ran the read logic
  • Org roles didn't use a context correctly
  • github_organization_role didn't correctly support org only permissions

After the change?

  • Org roles don't re-read
  • Org roles use context
  • github_organization_role can support org only permissions or no permissions

Pull request checklist

  • Schema migrations have been created if needed (example)
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been reviewed and added / updated if needed (for bug fixes / features)

Does this introduce a breaking change?

Please see our docs on breaking changes to help!

  • Yes
  • No

@stevehipwell stevehipwell added this to the v6.x version wrap up milestone Dec 4, 2025
@stevehipwell stevehipwell self-assigned this Dec 4, 2025
@github-actions github-actions bot added the Type: Bug Something isn't working as documented label Dec 4, 2025
Copy link
Copy Markdown
Collaborator

@deiga deiga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you be able to add a test case which reproduces the error from the reported issue?

@stevehipwell
Copy link
Copy Markdown
Collaborator Author

Would you be able to add a test case which reproduces the error from the reported issue?

@deiga there is already a test for the org role error, that worked prior to the API changing. The other error is a distributed system error that can't easily be tested, as it'd be proving a negative; but we do have tests. We've seen the same problem in other areas in the API and need to get rid of the re-read pattern. Interestingly the resource failing here is having to use a list for get pattern as the get API was a later addition and needs v68. Also interesting is that at least one report is from GHES.

Signed-off-by: Steve Hipwell <steve.hipwell@gmail.com>
@nickfloyd nickfloyd moved this to In Review in Terraform Provider Dec 5, 2025
@nickfloyd nickfloyd merged commit 681609c into integrations:main Dec 5, 2025
8 checks passed
@github-project-automation github-project-automation bot moved this from In Review to Done in Terraform Provider Dec 5, 2025
@stevehipwell stevehipwell deleted the fix-org-role branch December 5, 2025 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: Bug Something isn't working as documented

Projects

3 participants