Skip to content

Identify the Re-Arm's Head Pusher From the Branch Activity - #4319

Merged
ptr727 merged 3 commits into
developfrom
burndown/promotion-fixes-r2-mergebot
Nov 20, 2026
Merged

ptr727 merged 3 commits into
developfrom
burndown/promotion-fixes-r2-mergebot

Conversation

@ptr727

@ptr727 ptr727 commented Nov 20, 2026 •

Copy link
Copy Markdown
Owner

Summary

The merge-bot's rearm-auto-merge job 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 whose after is 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] and ptr727-codegen[bot] as actor.login, the same form as the event's pull_request.user.login. The new tests/test_merge_bot_rearm.py runs the workflow's own step against a stubbed gh in 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_kwDOQ5caqM651p5Q on the promotion pull request #4315.

Closes on promotion: none

🤖 Generated with Claude Code

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]>
Copilot AI lite review requested due to automatic review settings November 20, 2026 05:07
@ptr727 ptr727 added the comments Permits the comment lines the pull request adds or edits, which the prose gate otherwise refuses label Nov 20, 2026
@coderabbitai

coderabbitai Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@ptr727

ptr727 commented Nov 20, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head 98a81cc507827cd2407c3e4ab768dd683b532c8d, the content this pull request carries at that commit against develop, and it recorded 0 findings.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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

Comment thread .github/workflows/merge-bot-task.yml Resolved
@ptr727

ptr727 commented Nov 20, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@ptr727

ptr727 commented Nov 20, 2026

Copy link
Copy Markdown
Owner Author

/review

@coderabbitai

coderabbitai Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@codecov

codecov Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.24%. Comparing base (6ff3460) to head (e4c5002).
⚠️ Report is 1 commits behind head on develop.

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           
Flag Coverage Δ
python-3.13 79.24% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

ptr727 and others added 2 commits November 19, 2026 21:21
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]>
@ptr727

ptr727 commented Nov 20, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head e4c5002a89f7fb42a69e439349bfa0ed909a5e0f, the content this pull request carries at that commit against develop, and it recorded 0 findings.

@ptr727
ptr727 merged commit 3df20a8 into develop Nov 20, 2026
13 checks passed
@ptr727
ptr727 deleted the burndown/promotion-fixes-r2-mergebot branch November 20, 2026 05:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comments Permits the comment lines the pull request adds or edits, which the prose gate otherwise refuses

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants