Skip to content

Conversation

@deiga
Copy link
Contributor

@deiga deiga commented Dec 7, 2025

Resolves #2530, #2536, #2717


Before the change?

  • Running TEST="./github" TESTARGS="-run TestGithubOrganizationRulesets" make testacc would fail due to multiple issues in the test setup

After the change?

  • Running TEST="./github" TESTARGS="-run TestGithubOrganizationRulesets" make testacc will show all tests as passing
  • Switch from NewSubsystemLoggingHTTPTransport to NewLoggingHTTPTransport as we don't actually initialize a Subsystem anywhere, which creates spam.
  • Migrate github/resource_github_organization_ruleset.go and github/resource_github_repository.go to use Context aware CRUD methods
  • Add rules.pull_requests.allowed_merge_methods handling to github/resource_github_repository_ruleset.go and github/resource_github_organization_ruleset.go

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

@github-actions
Copy link

github-actions bot commented Dec 7, 2025

👋 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 Status: Up for grabs. You & others like you are the reason all of this works! So thank you & happy coding! 🚀

@github-actions github-actions bot added the Type: Bug Something isn't working as documented label Dec 7, 2025
@deiga deiga changed the title Ensure tests use GITHUB_TEST_* values for Owner and Organization [MAINT] Fix Org Ruleset tests Dec 7, 2025
@deiga deiga marked this pull request as ready for review December 7, 2025 18:14
@stevehipwell
Copy link
Collaborator

@deiga would it be possible to hold off on this until we get #2941 merged?

@deiga
Copy link
Contributor Author

deiga commented Dec 8, 2025

@deiga would it be possible to hold off on this until we get #2941 merged?

@stevehipwell Sure! Would you want to rebase that branch on top of go-github-v68, so that I could use it as a base for this PR?

@stevehipwell
Copy link
Collaborator

@deiga the acceptance tests PR should be compatible with the v6 releases, so the v7 branch would be rebased on it. I'm currently re-running the tests to get it ready to be merged and I'm picking up defects in the currently released code.

@deiga deiga marked this pull request as draft December 10, 2025 14:37
@deiga deiga changed the base branch from go-github-v68 to main January 7, 2026 22:14
@deiga deiga force-pushed the fix-org-ruleset-tests branch from 3752c16 to d222f43 Compare January 7, 2026 23:19
@deiga deiga marked this pull request as ready for review January 7, 2026 23:20
Copy link
Collaborator

@stevehipwell stevehipwell left a comment

Choose a reason for hiding this comment

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

I've added some minor suggestions on structuring the TF test code to make it easier to read and more idiomatic. But my main concern here is the actor ID change.

Also is there a reason you didn't add the other missing ruleset rules? Just curious.

@stevehipwell stevehipwell added this to the v6.10.0 Release milestone Jan 8, 2026
@deiga deiga changed the title [MAINT] Fix Org Ruleset tests [MAINT][FEAT] Fix Org Ruleset tests && enable allowed_merge_methods Jan 9, 2026
deiga and others added 15 commits January 9, 2026 20:26
…sport`

Updated the logging transport in the RateLimitedHTTPClient function to use NewLoggingHTTPTransport. As the subsystem would need to be explicitly inititated in each resource

Signed-off-by: Timo Sand <[email protected]>
Signed-off-by: Timo Sand <[email protected]>
It's a required field in the API and go-github doesn't use `omitempty`, so it submits `nil` if it isn't sent explicitly.

This change tries to keep it in the state, without having a configuration option for it (poor choice?)

And it defaults to all 3 available merge methods if it can't set something from the state.

Signed-off-by: Timo Sand <[email protected]>
This is a required field and the SDK doesn't omit if it's empty

Signed-off-by: Timo Sand <[email protected]>
…on_rulesets_without_errors` to pass

Signed-off-by: Timo Sand <[email protected]>
Signed-off-by: Timo Sand <[email protected]>
…_all_bypass_modes`

Main fix: `bypass_actors` is returned as sorted from GH API so tests need re-indexing

Signed-off-by: Timo Sand <[email protected]>
deiga added 5 commits January 9, 2026 20:26
Signed-off-by: Timo Sand <[email protected]>
Signed-off-by: Timo Sand <[email protected]>
With the recent changes to the SDK and the Create method we less often purely refresh state if it hasn't changed upstream, leading to us ignoring the return value of `actor_id` often

Signed-off-by: Timo Sand <[email protected]>
@deiga deiga force-pushed the fix-org-ruleset-tests branch from 62ed5c4 to ac1b510 Compare January 9, 2026 20:11
@deiga deiga requested a review from stevehipwell January 9, 2026 20:11
Copy link
Collaborator

@stevehipwell stevehipwell left a comment

Choose a reason for hiding this comment

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

This looks great.

LGTM

@nickfloyd nickfloyd merged commit 16c1e02 into integrations:main Jan 9, 2026
8 checks passed
@deiga deiga deleted the fix-org-ruleset-tests branch January 10, 2026 06:02
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

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT]: Support ruleset allowed_merge_methods

3 participants