Repository navigation
Watch the Merge Bot's Auto-Merge and Re-Arm a Disable GitHub Makes - #4310
Conversation
GitHub can disable an armed auto-merge with every check green, as it did for workflow-file bumps the codegen App may not merge after the base moved. gh pr merge --auto only arms the merge, so the stall left no failure. A new watch-auto-merge job runs after arming, and after the bot's own push while armed. It re-arms a disable the App was recorded for once the base branch has settled, and fails on a second disable or on a 30-minute window with no merge. A person's disable is left in place, and any head push hands the watch to the run for that push. The App's permissions are unchanged. WORKFLOW.md D8.1, the branch-protection reference, and the reusable workflows doc state the watch. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A watch that saw GitHub disable auto-merge ended when the bot pushed before the re-arm, and the run for that push read the PR as unarmed and did nothing. That run now treats a disable the App is recorded for as its own to re-arm. The base-to-method mapping moves to one workflow-level MERGE_METHOD, so the two merge steps and the re-arm share it rather than each carrying a case statement. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The disabler of a refused merge is the App that minted the arming token, so the watch compares it against that token's app-slug rather than the app-login input, which a caller may point at another App. The settle wait ends on a close, a merge, a head push, or another arming, so the loop's own checks act on it rather than holding the concurrency group. The re-arm warning no longer credits GitHub with a disable the maintainer-push job made, and D8.1 drops a warning the synchronize path does not emit. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 5 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
A recorded local strict-review pass covers head |
The bot-push path could re-arm an App pull request the rules leave unmerged, such as a no-auto-merge- head a maintainer had armed by hand. merge-app now resolves its rule on the bot's own push too, arming nothing there, and the watch takes that path only for Dependabot or a matched App head. The re-arm pins the head it read, so a push landing after that read is not armed. The watch step drops an unused BASE_REF, the re-arm error names the method it used, and the merge jobs' comments no longer call the maintainer-push disable sticky. Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
🟡 Changes recommended
Multiple active critical issues remain in the merge-bot workflow, including unsafe re-arming, incorrect maintainer-disable detection, and failure to pin the Dependabot head before arming.
6 open issues
Pin Dependabot auto-merge to the event head · New Re-check merge rules before re-arming on a bot push · New Preserve maintainer disables made with the App token · New Clarify that a bot push can re-arm an App-recorded disable · New Remove the stale sticky-disable claim · New Validate the merge method before re-arming · New
What changed in this PR
This pull request hardens the reusable merge bot against GitHub disabling auto-merge after workflow-file changes by adding bounded monitoring and recovery, then updates the related workflow contracts and generated references.
Changes:
- Adds shared merge-method mapping, arming outputs, and a 30-minute auto-merge watcher with one re-arm attempt.
- Documents watcher behavior and visible failure handling across workflow and branching references.
- Regenerates the affected skill distributions and source digests.
| File | Description |
|---|---|
| WORKFLOW.md | Updates D8.1 with the merge-bot auto-merge monitoring and recovery contract. |
| docs/reusable-workflows.md | Documents watcher behavior and failure handling for downstream workflow callers. |
| .github/workflows/merge-bot-task.yml | Implements shared merge-method mapping, arming outputs, auto-merge monitoring, and re-arming. |
| .github/skills/workflow-ci-contract/references/d-guarantees.md | Regenerates the workflow guarantee reference. |
| .github/skills/branching-and-release-model/references/branch-protection-and-promotion.md | Updates branch-protection and merge-bot behavior guidance. |
| .claude-plugin/fleet-skills/skills/workflow-ci-contract/references/d-guarantees.md | Regenerates the Claude workflow guarantee skill copy. |
| .claude-plugin/fleet-skills/skills/branching-and-release-model/references/branch-protection-and-promotion.md | Regenerates the Claude branching and promotion skill copy. |
| .claude-plugin/fleet-skills/.source-digests/workflow-ci-contract | Updates the generated workflow skill source digest. |
| .claude-plugin/fleet-skills/.source-digests/branching-and-release-model | Updates the generated branching skill source digest. |
| .agents/skills/workflow-ci-contract/references/d-guarantees.md | Updates the authored workflow guarantee reference. |
| .agents/skills/branching-and-release-model/references/branch-protection-and-promotion.md | Updates the authored branching and promotion reference. |
Review effort: Lite
merge-app now runs its rule step on the bot's own push, so the branch-protection reference says the merge jobs arm only on opened or reopened rather than fire only then. A settle cut short by the watch window's end now says the window ran out, rather than pointing at base churn that may not have happened. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #4310 +/- ##
===========================================
- Coverage 81.60% 79.06% -2.55%
===========================================
Files 26 43 +17
Lines 9070 15739 +6669
===========================================
+ Hits 7402 12444 +5042
- Misses 1668 3295 +1627
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
D8.1 now says the maintainer-push disable holds until the bot itself pushes again, and that a head push ends the watch while only the bot's own push starts a new one. The deadline error names the watch's start rather than the arming, which on a bot push may be hours earlier. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
A recorded local strict-review pass covers head |
The maintainer chose an event-driven re-arm on #4063. The polling watch-auto-merge job is gone, so no runner slot is held while waiting. The caller stubs, the hub's own and the catalog snippet, add the auto_merge_disabled event, and a short rearm-auto-merge job answers it. The job answers only a pull request the merge jobs would arm: Dependabot, or an App head merge-app's rule matches, which it resolves on the event. It acts on a disable recorded under the App when the head commit is the bot's own. It waits up to five minutes for the base to settle, then re-arms once, pinned to the head it read. A second such disable on the head fails it. Where every check is green gh merges at once, so a refused merge fails the job, which D8.1 now states as visibility rather than recovery. D8.1's merges-or-fails sentence is limited to a pull request the merge-bot armed. Co-Authored-By: Claude Opus 5.5 <[email protected]>
An amend or rebase keeps the bot as the head commit's author, so the re-arm job also requires that no force push onto the head came from anyone but the bot. It reads the head commit through the head ref rather than the last listed commit. The initial arming pins the event's head, the rule and re-arm jobs skip an auto_merge_disabled payload whose pull request is no longer open, and the comment above check_pr says why it re-reads. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
A recorded local strict-review pass covers head |
|
@coderabbitai review |
|
/review |
Action not completed
|
…d, and Hub Pin Drift (#4315) ## Summary Promotes `develop` to `main`. It carries these changes: - [#4303](#4303) orders the STANDUP.md seed push, carry commits, and secret hand-over. - [#4304](#4304) forbids state-changing probes and routes observed secrets to revocation. - [#4305](#4305) routes SIGINT and SIGTERM through one handler, bounds the child wait, and states two stop paths. - [#4306](#4306) holds `pr_review.py merge` for a hosted review not registered yet. - [#4309](#4309) reads the branch before the tree so an empty root commit resolves its secrets. - [#4310](#4310) watches the merge bot's auto-merge and re-arms a disable GitHub makes. - [#4311](#4311) counts untracked files in the dirty stamp and states the session tree bound. - [#4314](#4314) reports each caller's hub pin behind the newest release as drift past a 30-day bound. Related issues #4308, #4312, and #4313 stay open. Fixes #1418 Fixes #4137 Fixes #4063 Fixes #4147 Fixes #2598 Fixes #4128 Fixes #4240 Fixes #4229 Fixes #3806 Fixes #4146 Fixes #4100 Fixes #4218 Fixes #4223 Fixes #4228 Fixes #4224 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **New Features** * Repository audits now report outdated reusable-workflow pins as advisories or drift, with advisory findings kept separate from blocking issues. * Merge automation can retry enabling auto-merge after the base branch settles; unsupported target branches and refused merges are reported as failures. * Pull-request checks now account for a brief hosted-review registration window before reporting checks as pending. * **Bug Fixes** * Empty repositories and empty root commits are handled correctly when resolving repository secrets. * Long-running tools improve cleanup and signal handling when interrupted. * **Documentation** * Updated guidance for repository setup, review handling, workflow automation, and safe verification practices. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
…4326) ## Summary #4310 moved the merge bot's re-arm onto the pull request `auto_merge_disabled` event, which each caller stub has to subscribe to. Nothing audited that subscription. `requireTokensInJob` reads one job, and a stub's `on:` types sit outside every job, so a repository keeping its old stub passed the audit while the re-arm job never ran there. - `spec/audit_contract.py` (new): a file-level `requireTokens` contract key, read against the whole caller file's code view, so a comment naming the token does not satisfy it. A missing token is `DRIFT`, matching the other interface contract keys. The module holds every contract token check, so `artifactNameToken`, `requireTokensInJob`, and `forbidTokensInJob` move here too, with their findings, messages, and order unchanged. - `spec/audit.py`: `check_interface` calls the new module. The file goes from 2996 to 2977 lines. Its 3000-line ceiling is unchanged. - `spec/files.json`: the merge-bot entry requires `auto_merge_disabled`. - `spec/files.schema.json` and `spec/validate.py`: declare the key and validate it as an array of strings. - `tests/test_audit_helpers.py`: a pass case, a fail case, a comment-only case, and a check that the hub's own stub and the catalog snippet meet the carried contract. A further case runs the validator over a manifest whose `requireTokens` is a single string and asserts its refusal. The two shipped-stub cases share one contract lookup. - `tests/test_audit_size.py`: a 200-line ceiling for the new module. - `spec/fidelity-model.md`: a caller stub's contract now also covers an activity type its hub task needs it to subscribe to. ## Fleet effect: drift, not an advisory A read of each registry repository's default-branch stub found that 20 cataloged repositories still lack `auto_merge_disabled`, plus 1 archived one. Only the hub's own stub has it. Each of those now draws one `DRIFT` finding from the `interface` check on `merge-bot-pull-request.yml`. That is drift rather than an advisory, for these reasons: - The stub is carried content. A hub change to a carried unit puts every carrier out of line until that carrier's next resync, and the drift finding is what drives the resync to carry it. The new subscription rides each repository's next resync the way any other carried-stub change does. - Nothing else moves it. An advisory fits a gap an automatic mechanism closes on its own, as Dependabot does for a hub pin under `pins.age`. No mechanism edits a stub's `on:` types. - The gap is a functional one. Without the subscription the re-arm job never runs, which is the silent stall #4063 fixed. A repository that holds the old stub on purpose can say so with a registry `driftNote`, as for any other drift. ## Verification - `uv run --no-project --script spec/validate.py`: OK. - `python -m unittest discover -s tests` with `tests/requirements.txt`: 4618 tests, OK (12 skipped). - `spec/audit.py --selftest` passes. - `ruff check`, `ruff format --check`, `mypy`, and the prose gate are clean. Closes on promotion: #4313 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <[email protected]>


Summary
GitHub can disable an armed auto-merge with every check green. It did so on Dependabot workflow-file bumps the codegen App armed, recording the App as the disabler with reason code
workflow_policy_update_error.gh pr merge --autoonly arms the merge, so the merge-bot job stayed green and the pull request stayed open.This follows the maintainer's decisions on the issue: the App keeps its permissions (option 1), and the merge bot answers the disable on its own event rather than by polling.
GET /apps/ptr727-codegenreportscontents: write,metadata: read, andpull_requests: write, with noworkflowspermission. That matches the recorded reason. Nothing here changes them..github/workflows/merge-bot-pull-request.yml, the catalog snippet, and the stub indocs/reusable-workflows.mdnow trigger onauto_merge_disabledas well. Every job of the currently pinned task skips that event, since each one'sif:needs opened, reopened, synchronize, or closed. So a stub carrying the event under an older pin is a no-op until its pin reaches the release with the re-arm job. Downstream stubs take it on their next resync.rearm-auto-mergejob in.github/workflows/merge-bot-task.yml, running on that event with no runner held while waiting for it. It acts only on a pull request the merge jobs would arm: an in-repo Dependabot pull request, or an App head that merge-app's rule matches. merge-app resolves that rule on the event without arming, so ano-auto-merge-head is never re-armed.app-slug): it leaves the disable alone.MERGE_METHODreplaces their twocaseblocks.WORKFLOW.mdD8.1 states the re-arm, and limits "merges or fails visibly" to a pull request the merge-bot armed. Thebranching-and-release-modelbranch-protection reference anddocs/reusable-workflows.mdsay the same. The include region in theworkflow-ci-contractD-guarantees reference and the generated skill copies are regenerated byscripts/build_dist.py.merge-codegenjob that does not exist; it ismerge-app. Corrected.Verification
gh. The cases: a first disable re-armed, a Dependabot rebase then re-armed, a maintainer amend with a force push, a maintainer commit, an older head's disable ignored, and a second disable failing. Also a person's disable, closed, already armed, an unreadable disable event, and a refused merge. Also a settle ending on a head move, a maintainer push, or a close, and a base that never settles. Each ended as described above.ptr727-codegen[bot]. Across 97 sampled fleet disables, onlyclosedandworkflow_policy_update_erroroccur.build_dist.py --check, the prose gate, and the unit tests (4550, OK, which include the stub-equals-snippet check) pass locally.Deferred
auto_merge_disabled. The merge-bot manifest contract reads only the job key and tokens inside the job, so a carrier keeping its old stub would pass. Deferred to Audit That a Merge-Bot Caller Stub Subscribes to auto_merge_disabled #4313.Earlier rounds
An earlier head of this branch carried a 30-minute polling watch. The maintainer replaced it with the event-driven re-arm, since a burst of watches could fill the account's concurrent-job limit. The hosted-review threads raised on that head are answered in their threads.
Closes on promotion: #4063
🤖 Generated with Claude Code