Repository navigation
Conversation
…h protections When a GitHub branch needs a review the viewer cannot give (a code owner's, say), auto-merge has nothing it can ever finish waiting on, and the host may refuse to arm it at all. GitHub already lets administrators merge past those protections, which is what `gh pr merge --admin` does. Read GitHub's `viewerCanMergeAsAdmin` into a new `mergeAsAdmin` viewer permission, accept a `bypassRequirements` flag on merge actions that sends the direct `mergePullRequest` mutation instead of arming auto-merge or joining the merge queue, and offer it as a checkbox in the merge and auto-merge confirm dialogs for viewers GitHub says may use it. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This PR adds a cross-layer GitHub administrator-merge workflow that can bypass required reviews, checks, and merge queues through a new destructive confirmation path. Although it is explicitly opt-in and permission-gated, the privileged and consequential production behavior requires human review. You can add or adjust custom eligibility rules. Learn more. |
relax |
|
To the reviewer, human or agent.. the bots are really misrepresenting the size/risk of the change.. this is all trivially possible if you have the required permissions on the repo just by adding a --admin on the gh pr merge command anyway, the only thing im trying to do is benefit from the in app auto-settle behaviour by doing this from within t3 code so i can let my agents close the loop. |
|
Note Written by Thanks for proposing administrator merges. The checkbox and bypassRequirements flag introduce an explicit workflow for merging past branch protections and the merge queue, and the PR states that maintainer approval is missing. This intentional product behavior change requires prior approval. Please discuss the blocked auto-merge scenario in an Ideas discussion and link explicit approval of the direction and scope when requesting reconsideration. |
Problem
On a GitHub branch that needs a review the viewer can't give, such as a code owner's approval on their own PR, auto-merge never has anything it can finish waiting on. GitHub can also refuse to arm it at all, which shows up as "Could not turn on auto-merge: The host refused it…". The only way through is
gh pr merge --adminin a terminal, even when GitHub would let the viewer bypass the protections.Change
viewerCanMergeAsAdminwith the core detail and with the viewer-permissions check. Expose it as a newmergeAsAdminviewer permission. It is only set when GitHub saystrueand the viewer can write; absent means no.bypassRequirementstoPullRequestActionInput. Formergeandenable-auto-mergeit sends the directmergePullRequestmutation rather thanenablePullRequestAutoMerge, and skips the merge queue. That matchesgh pr merge --admin.PullRequestService.runActionrefuses the flag for stack merges, for any other action, and for viewers withoutmergeAsAdmin.docs/user/source-control.md.Mobile has no PR merge UI, so nothing changes there. Other hosts never set
mergeAsAdmin, so they never see the checkbox.Scope and approval
Proposed in #17771; no maintainer approval yet. It reuses the existing merge and auto-merge actions and adds one GitHub-only option to them.
Screenshots
Before: turning on auto-merge on a branch that needs a code owner's review fails, and there's no way through from the app.
After: viewers GitHub lets bypass protections get a checkbox in the dialog. Ticking it turns the action into a direct admin merge. Captured on a real BLOCKED pull request; the dialog was cancelled each time.
Verification
vp test runpasses onGitHubPullRequestApi.test.ts,GitHubPullRequestProvider.test.ts,gitHubPullRequestJson.test.ts,PullRequestService.test.ts(450 tests) andpackages/contracts/src/pullRequest.test.ts. New tests cover:mergePullRequest, notenablePullRequestAutoMerge, for a BLOCKED branch and for a merge-queue branch.viewerCanMergeAsAdmindecodes only when true, and an unknown or missing value grants nothing.tsc --noEmitis clean for contracts, server and web. Lint on the changed files shows only warnings that already exist on main.viewerCanMergeAsAdmin: true. The checkbox appears and the dialog switches to the admin merge, as in the screenshots above.Opus 5.5 (1M context) via Claude Code in T3 Code.
🤖 Generated with Claude Code
Closes discussions