You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Merge Bot Fails on an Operational Develop When a Check Is Still Running #4377
merge-bot-task.yml's merge-dependabot job fails intermittently on an operational repository's develop leg. That leaves the Dependabot pull request open, and the next develop -> main promotion conflicts on the pin lines.
The step runs gh pr merge --auto "$MERGE_METHOD" --match-head-commit "$HEAD_SHA" "$PR_URL". An operational develop ruleset has no required status checks, so GitHub cannot arm auto-merge on it. gh falls back to an immediate merge only when the pull request reads CLEAN at that instant. When another check is still running, the pull request reads UNSTABLE, gh calls enablePullRequestAutoMerge, and GitHub refuses:
GraphQL: Pull request Branch does not have required protected branch rules (enablePullRequestAutoMerge)
The job only runs on opened or reopened, so nothing retries it.
Evidence
ptr727/HomeAssistant-Config#101, the develop leg of a 2.0.1509 pin bump, failed this way in run 45174540907 at the pinned 2.0.1483 task. Rerunning the failed job after the other checks went green merged it.
The main leg, ptr727/HomeAssistant-Config#100, merged normally, since main's ruleset requires checks.
The step on hub main at 8ef8e96 is unchanged.
Shape of a fix
Not prescribed. One option: where the base branch's ruleset requires no checks, wait for the pull request's checks and merge directly, or let a failed arm trigger a bounded retry, rather than relying on --auto alone.
Hit while promoting ptr727/HomeAssistant-Config develop to main.
Parked on #4389 (away run 2026-11-24, round 1, group 1).
Done: diagnosis only. No code is written and no pull request is open.
Branch: burndown/merge-bot-operational-race, cut from origin/develop at 477c4d1f, holding no commits and not pushed.
Worktree: left standing and clean at ~/repos/worktrees/ProjectTemplate-merge-bot-operational-race.
Why parked: a fix that keeps D8.1's "the checks are the gate" must wait for the head's checks, and the App token every merge-bot call uses cannot read checks or commit statuses. Giving the job that read is an App setting or a change to every caller stub, and the alternative merges without checks. Decide How the Merge Bot Reads Checks to Wait on a Base Requiring None #4389 holds the measurements and the three options.
What remains, once Decide How the Merge Bot Reads Checks to Wait on a Base Requiring None #4389 is answered: under option 1 or 2, a merge step that reads the base's rules. With no required_status_checks rule there, it waits for every check on the pinned head except the merge-bot's own workflow's runs, under a bound inside the job's timeout. It then merges directly, and fails visibly on a failed check, a moved head, or the bound. A base with required checks keeps arming. Both merge-dependabot and merge-app share the step. Tests go in tests/test_merge_bot_rearm.py with a stubbed gh, and D8.1 and docs/reusable-workflows.md change only where the new path makes them false. Under option 3, a bounded re-run of the arm while the pull request reads UNKNOWN.
Correction to the defect text: gh pr merge --auto merges at once on UNSTABLE as well as CLEAN, so it arms only from a state such as UNKNOWN. The legs that merged did so before their lint job finished.
Blocked on a maintainer step (2026-11-24):#4389 was answered as option 1. Before this resumes, the maintainer changes the codegen GitHub App's permissions to add checks: read and statuses: read, and then accepts the new permissions on each installation. Remove the blocked label once every installation has accepted. The parked branch burndown/merge-bot-operational-race then resumes on #4389's design.
Activity
ptr727 commentedon Nov 24, 2026
Backlog burndown claim (away run 2026-11-24, round 1, group 1): branch
burndown/merge-bot-operational-race, issue #4377.Predicted files:
.github/workflows/merge-bot-task.yml, themerge-dependabotandmerge-appmerge steps, which share thegh pr merge --autocall.tests/test_merge_bot_rearm.py, or the test file that covers the changed step.WORKFLOW.md, D8.1, only where the change makes its "the required checks are the gate" statement false for an operationaldevelop.docs/reusable-workflows.md, only where it describes how the merge-bot arms.Any other group needing one of these files waits for this branch to merge.
Parked on #4389: the fix needs a check read the merge-bot token lacks. Branch holds no commits; worktree left standing. State: #4377 (comment)
docs/reusable-workflows.mdpassed (adjudicated 2026-11-24) to Finish the DevKitCIoT Republish: Archive, Delete the History Repository, Then Audit #3940 and Fix the Defects a First Whole-Unit Read of AUDIT.md Section 0 Found, Including Three Checks That Cannot Fire #1613, the round 4 refill group F on branchburndown/reuse-checklist-fidelity-docstring, for the two archivedDevKitCIoTchecklist bullets, since this group is parked with no commits ahead oforigin/develop. A worker resuming this group re-verifies the file is free before editing it.ptr727 commentedon Nov 24, 2026
Parked on #4389 (away run 2026-11-24, round 1, group 1).
burndown/merge-bot-operational-race, cut fromorigin/developat477c4d1f, holding no commits and not pushed.~/repos/worktrees/ProjectTemplate-merge-bot-operational-race.required_status_checksrule there, it waits for every check on the pinned head except the merge-bot's own workflow's runs, under a bound inside the job's timeout. It then merges directly, and fails visibly on a failed check, a moved head, or the bound. A base with required checks keeps arming. Bothmerge-dependabotandmerge-appshare the step. Tests go intests/test_merge_bot_rearm.pywith a stubbedgh, and D8.1 anddocs/reusable-workflows.mdchange only where the new path makes them false. Under option 3, a bounded re-run of the arm while the pull request readsUNKNOWN.gh pr merge --automerges at once onUNSTABLEas well asCLEAN, so it arms only from a state such asUNKNOWN. The legs that merged did so before their lint job finished.ptr727 commentedon Nov 24, 2026
Blocked on a maintainer step (2026-11-24): #4389 was answered as option 1. Before this resumes, the maintainer changes the codegen GitHub App's permissions to add
checks: readandstatuses: read, and then accepts the new permissions on each installation. Remove theblockedlabel once every installation has accepted. The parked branchburndown/merge-bot-operational-racethen resumes on #4389's design.