fix(web): pull request tab stops offering a merge GitHub will refuse - #223
Merged
Conversation
While required checks were still running, the Merge button stayed live and the host answered with the `--admin` refusal, because the panel only greyed it out for a draft or a conflict and never asked GitHub whether its rules would take the merge. And after Update branch, the header re-read itself before GitHub had queued the new commit's checks, saw none, and stopped polling until the user hit Refresh. The GitHub driver now reads `mergeStateStatus`, the same field `gh pr merge` consults, and carries it as an optional `mergeGate` on the detail contract (other hosts leave it absent). When it is blocked, Merge stays on screen but disabled and the reason line says what is in the way: the checks still running, a failed check, a review still owed, or the branch rules. The header keeps polling for two minutes after a fresh push while it sees no checks or an undecided mergeability, then hands off to the existing poll-while-pending rule.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
While a pull request's required checks were still running, the tab's Merge button stayed live, and clicking it surfaced GitHub's "add the
--adminflag" refusal. The panel only disabled Merge for a draft or a conflict and never asked the host whether its branch rules would accept the merge. In the same flow, right after Update branch the header re-read itself before GitHub had queued the new commit's checks, saw an empty list, and stopped polling until the user hit Refresh.The GitHub driver now reads
mergeStateStatus(the fieldgh pr mergeitself checks) and carries it as an optionalmergeGateon the detail contract; GitLab, Bitbucket and Azure DevOps leave it absent and behave as before. When the gate is blocked, Merge stays on screen but disabled, with the reason written under it: "Waiting on 6 checks", "A check failed", "Needs an approving review", "Blocked by branch rules", or "Update the branch first". A running check with no rule requiring it no longer disables anything. The header keeps polling at the existing 20s pace for two minutes after a fresh push while it sees no checks or an undecided mergeability, then hands off to the poll-while-pending rule, so the checks rollup fills in on its own after Update branch.Verified with fmt, lint, typecheck, the server pull request tests, the web logic tests, and the full web browser suite.