Repository navigation
Identify the Re-Arm's Head Pusher From the Branch Activity - #4319
Conversation
The re-arm job inferred who pushed the head from the commit's author and from force-push timeline events only. A maintainer's fast-forward push of a cherry-picked, bot-authored commit then read as the bot's own push, so the job re-armed auto-merge past the maintainer-push disable. The job now reads the head branch's activity and requires the push that produced the head to be the bot's, fast-forward and force push alike. A head with no recorded push fails visibly rather than passing. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
|
A recorded local strict-review pass covers head |
There was a problem hiding this comment.
🟡 Changes recommended
Committed tests are still needed for the merge-bot workflow’s new re-arm identity decision, including bot, maintainer, and missing-activity cases, leaving key regressions uncovered.
1 open issue
What changed in this PR
Updates merge-bot re-arm logic to identify who pushed the pull request head from branch activity, preventing maintainer-pushed bot-authored commits from being mistaken for bot pushes.
Changes:
- Replaces commit-author and force-push timeline inference with branch activity matching the current head SHA.
- Compares the matching activity actor with the pull request author.
- Shares retry handling across pull request and activity API reads.
- Fails visibly when no matching activity record identifies the head push.
| File | Description |
|---|---|
| .github/workflows/merge-bot-task.yml | Updates the re-arm job to use branch activity and actor matching to validate the head pusher before re-arming auto-merge. |
Review effort: Lite
|
@coderabbitai review |
|
/review |
Action not completed
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #4319 +/- ##
========================================
Coverage 79.24% 79.24%
========================================
Files 44 44
Lines 15872 15872
========================================
Hits 12577 12577
Misses 3295 3295
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:
|
The re-arm job's head-pusher check had no committed coverage. Three cases run the workflow's own step against a stubbed gh serving a constructed pull request and activity log: the bot's push re-arms pinned to the head, a person's push of a bot-authored head leaves auto-merge off, and a head with no recorded push fails. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The person-push case had one activity entry for the head, so taking the oldest matching push instead of the newest also passed. The case now has the bot push the head, a person push past it, and then force-push back to it, so only the newest-first choice leaves auto-merge off. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
A recorded local strict-review pass covers head |

Summary
The merge-bot's
rearm-auto-mergejob inferred who pushed the pull request's head from the head commit's author, plus force-push timeline events. A maintainer's fast-forward push of a cherry-picked, bot-authored commit therefore read as the bot's own push. The job then re-armed auto-merge past the maintainer-push disable. WORKFLOW.md D8.1 says that disable stays in place "since the head is then not the bot's own push".The job now reads the head branch's repository activity (
GET /repos/{owner}/{repo}/activity?ref=refs/heads/<head>). It requires the push whoseafteris the head to have been made by the pull request's author. That covers a fast-forward push, a force push, and the branch's creation alike. A head with no recorded push fails the job visibly rather than passing as a person's. The existing read retry is now shared by both reads.A live read of this repository's activity confirmed that bot actors report
dependabot[bot]andptr727-codegen[bot]asactor.login, the same form as the event'spull_request.user.login. The newtests/test_merge_bot_rearm.pyruns the workflow's own step against a stubbedghin three cases. A bot push of the head re-arms, pinned to the head. A person's push of a bot-authored head leaves auto-merge off. A head with no recorded push fails. That answers this pull request's Copilot thread asking for committed coverage.This answers thread
PRRT_kwDOQ5caqM651p5Qon the promotion pull request #4315.Closes on promotion: none
🤖 Generated with Claude Code