terraform-provider-github icon indicating copy to clipboard operation
terraform-provider-github copied to clipboard

[MAINT] Fix Org Ruleset tests

Open deiga opened this issue 1 month ago • 4 comments

[!WARNING] This is waiting for https://github.com/integrations/terraform-provider-github/pull/2986 to be merged and rebased to go-github-v68

Resolves #2530, https://github.com/integrations/terraform-provider-github/issues/2536, https://github.com/integrations/terraform-provider-github/issues/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.
  • Tests for Organizations properly use GITHUB_TEST_ORGANIZATION and GITHUB_TEST_OWNER
  • 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)~
  • [x] 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!

  • [x] Yes-ish
  • [ ] No

The addition of a new required rules property: allowed_merge_methods does kind of constitute a breaking change. It is also entirely necessary as that field isn't omitted by the SDK and it's required by the API.


deiga avatar Dec 07 '25 18:12 deiga

👋 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[bot] avatar Dec 07 '25 18:12 github-actions[bot]

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

stevehipwell avatar Dec 08 '25 10:12 stevehipwell

@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?

deiga avatar Dec 08 '25 12:12 deiga

@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.

stevehipwell avatar Dec 08 '25 12:12 stevehipwell