Skip to content

[MAINT] Fix github_organization_ruleset and github_repository_ruleset with push target#2958

Merged
stevehipwell merged 56 commits intointegrations:mainfrom
F-Secure-web:org-ruleset-fix-push
Feb 3, 2026
Merged

[MAINT] Fix github_organization_ruleset and github_repository_ruleset with push target#2958
stevehipwell merged 56 commits intointegrations:mainfrom
F-Secure-web:org-ruleset-fix-push

Conversation

@deiga
Copy link
Collaborator

@deiga deiga commented Dec 2, 2025

Resolves #2929, #2467


Before the change?

  • The provider would crash from a 422 error response when following the example in the docs
  • Removing ref_name would cause the provider to Panic as ref_name is a required field
  • One could add rules which weren't valid for push rulesets

After the change?

  • The provider should correctly apply push rulesets to an organization
  • ref_name should no longer be needed to be set for push target
  • conditions & target validation logic should ensure correct fields are populated

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

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 think this change likely wants to wait for the SDK upgrade as a lot of this area is modified in future versions.

FYI the error behaviours previously seen should have been mitigated by #2705 so if there is an error the provider should handle it gracefully.

@deiga deiga force-pushed the org-ruleset-fix-push branch from 0531db8 to 9dd2965 Compare December 3, 2025 20:15
@deiga deiga changed the base branch from main to go-github-v68 December 3, 2025 20:15
@deiga deiga force-pushed the org-ruleset-fix-push branch from 1bdfa45 to efd67ae Compare December 7, 2025 00:20
@deiga deiga changed the title Fix github_organization_ruleset with push target [MAINT] Fix github_organization_ruleset with push target Dec 7, 2025
@deiga deiga force-pushed the org-ruleset-fix-push branch from 52d95d4 to 6782aab Compare December 8, 2025 13:42
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.

Would it be possible to either de-scope this PR or open a new PR with the smallest number of changes possible to fix the outstanding bugs?

@deiga
Copy link
Collaborator Author

deiga commented Dec 10, 2025

@stevehipwell Yes, I agree. I've done that already in this PR: #2976

But I can't switch the base of this PR to point to that :)

@deiga deiga changed the title [MAINT] Fix github_organization_ruleset with push target [MAINT] Fix github_organization_ruleset and github_repository_ruleset with push target Dec 17, 2025
@deiga deiga marked this pull request as ready for review December 19, 2025 06:35
@deiga deiga marked this pull request as draft January 6, 2026 08:06
@deiga deiga changed the base branch from go-github-v68 to main January 7, 2026 22:14
@deiga deiga force-pushed the org-ruleset-fix-push branch 2 times, most recently from 1fe74fc to 2a2277a Compare January 10, 2026 08:53
@deiga deiga marked this pull request as ready for review January 10, 2026 08:56
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 review comments, mainly about the code structure.

@deiga deiga force-pushed the org-ruleset-fix-push branch from c1019c3 to d51fea0 Compare January 14, 2026 20:14
@deiga deiga requested a review from stevehipwell January 14, 2026 23:59
@deiga deiga marked this pull request as draft January 15, 2026 18:21
@deiga deiga force-pushed the org-ruleset-fix-push branch from 5c0112b to c8d93e0 Compare January 18, 2026 20:49
@deiga deiga marked this pull request as ready for review January 18, 2026 20:49
@stevehipwell stevehipwell added this to the v6.11.0 Release milestone Jan 20, 2026
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.

@deiga I've added some comments but the main concern here is that we keep only the relevant changes in the PR. If you could tidy the PR up, rebase, and then I'll give this a full PR with the aim of getting it merged ASAP.

deiga added 26 commits February 3, 2026 17:25
Signed-off-by: Timo Sand <timo.sand@f-secure.com>
Signed-off-by: Timo Sand <timo.sand@f-secure.com>
Signed-off-by: Timo Sand <timo.sand@f-secure.com>
…anything

Signed-off-by: Timo Sand <timo.sand@f-secure.com>
Signed-off-by: Timo Sand <timo.sand@f-secure.com>
Signed-off-by: Timo Sand <timo.sand@f-secure.com>
Signed-off-by: Timo Sand <timo.sand@f-secure.com>
Signed-off-by: Timo Sand <timo.sand@f-secure.com>
Signed-off-by: Timo Sand <timo.sand@f-secure.com>
Signed-off-by: Timo Sand <timo.sand@f-secure.com>
…thing

Signed-off-by: Timo Sand <timo.sand@f-secure.com>
Signed-off-by: Timo Sand <timo.sand@f-secure.com>
Signed-off-by: Timo Sand <timo.sand@f-secure.com>
Signed-off-by: Timo Sand <timo.sand@f-secure.com>
Signed-off-by: Timo Sand <timo.sand@f-secure.com>
…o ruleset

Signed-off-by: Timo Sand <timo.sand@f-secure.com>
Signed-off-by: Timo Sand <timo.sand@f-secure.com>
Signed-off-by: Timo Sand <timo.sand@f-secure.com>
Signed-off-by: Timo Sand <timo.sand@f-secure.com>
Signed-off-by: Timo Sand <timo.sand@f-secure.com>
Signed-off-by: Timo Sand <timo.sand@f-secure.com>
Signed-off-by: Timo Sand <timo.sand@f-secure.com>
@deiga deiga force-pushed the org-ruleset-fix-push branch from 6da201a to 00afcdb Compare February 3, 2026 15:27
@stevehipwell stevehipwell enabled auto-merge (squash) February 3, 2026 15:29
@stevehipwell stevehipwell merged commit 11d233c into integrations:main Feb 3, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: github_organization_ruleset doesn't work with push rulesets

3 participants