Skip to content

UID2-6799 Call merge endpoint directly to honor ruleset bypass#221

Merged
swibi-ttd merged 5 commits intomainfrom
swi-UID2-6799-commit-pr-and-merge-via-rest-api
Apr 22, 2026
Merged

UID2-6799 Call merge endpoint directly to honor ruleset bypass#221
swibi-ttd merged 5 commits intomainfrom
swi-UID2-6799-commit-pr-and-merge-via-rest-api

Conversation

@swibi-ttd
Copy link
Copy Markdown
Contributor

@swibi-ttd swibi-ttd commented Apr 21, 2026

Summary

Replace gh pr merge with gh api PUT .../merge in commit_pr_and_merge.

Why

gh pr merge reads mergeStateStatus client-side and refuses if BLOCKED. That status seems to be computed without regard for the caller's bypass rights, so PRs that would merge fine via a ruleset bypass actor get pre-emptively rejected with:

X Pull request ... is not mergeable: the base branch policy prohibits the merge.

Other changes

  • Move branch name generation into its own step so it can be referenced

Replace `gh pr merge` with `gh api PUT .../merge`. `gh pr merge` reads
`mergeStateStatus` client-side and refuses if BLOCKED, but that status
ignores ruleset bypass actors — so PRs that would merge fine via a
bypass actor get pre-emptively rejected with "base branch policy
prohibits the merge" (cli/cli#9145). Hitting the endpoint directly lets
the server evaluate rules and bypass at merge time.

Effective merge strategy is unchanged (rebase on all branches; the
`github.ref_protected == 'true'` comparison continues to return false).
@swibi-ttd swibi-ttd force-pushed the swi-UID2-6799-commit-pr-and-merge-via-rest-api branch from 39d9dd6 to dc432d9 Compare April 21, 2026 23:22
Comment thread .github/workflows/shared-publish-java-to-docker-versioned.yaml Outdated
Comment thread .github/workflows/shared-publish-java-to-docker-versioned.yaml Outdated
@swibi-ttd swibi-ttd merged commit be5592b into main Apr 22, 2026
3 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.

2 participants