Skip to content

πŸ› automerge: an outdated change request waits on its reviewer, not the author - #18810

Merged
hivecommons-hive[bot] merged 3 commits into
hivecommons:v6from
Danathar:fix/contributor-lane-rereview-outdated-cr
Nov 17, 2026
Merged

hivecommons-hive[bot] merged 3 commits into
hivecommons:v6from
Danathar:fix/contributor-lane-rereview-outdated-cr

Conversation

@Danathar

Copy link
Copy Markdown
Contributor

Summary

When a maintainer's "changes requested" review is on an older commit and the author has already pushed the fix, the hive kept treating the PR as the author's turn:

  • it stayed at stage/072-returned-to-contributor (071 for a person's PR);
  • the clanker author was nudged;
  • once the adoption grace ran out, the Activity monitor asked "@author has been offline … take the PR over now?"

The wait was really on the reviewer. GitHub keeps a change request blocking until the reviewer re-reviews or a maintainer dismisses it.

With this change the PR goes to stage/085-needs-decision. The 085 note and the monitor name the reviewer and say the author has pushed since. The author is not nudged and no adoption clock runs. A change request on the current head behaves exactly as before.

Refs #13041 (the head-scoped rule this extends).

What happened

Seen on projectbluefin/chairlift#799 (all times Eastern, 11-17):

  • 6:30 AM: a maintainer left CHANGES_REQUESTED on 298e8a5849.
  • 10:47 AM: the author pushed 948192f343 with the requested changes. All checks went green.
  • 11:11 AM: the monitor showed contributor-lane:changes-requested, wait kind returned-to-contributor-offline, who: the author. It asked "@castrojo has been offline for 2h … take the PR over now?"
  • 1:31 PM: the maintainer approved, which cleared it by hand.

So for about 2h 45m the PR looked like the author's turn.

Cause

The contributor lane checks for a human change request twice, and the two checks disagree:

The trusted-author lane uses the same helper, so it has the same bug.

What changed

Lanes (automerge_sweep_trusted.go, automerge_contributor_lane.go)

  • hasOutstandingChangesRequested now takes the head and sorts the standing change requests.
  • A request still counts against the author, as before, when it is:
    • on the head;
    • without a commit;
    • on a commit the head only merged the base into. For that case it uses the walk approvals already use (reviewReachesHead), so a base merge doesn't count as the author pushing past it;
    • unreadable because GitHub could not be read. On a failed read it keeps the author's turn.
  • When every standing request is on an older commit with real content pushed since, both lanes return re-review-requested:<reviewers> instead.

Stage (derive_pr_classify.go)

  • The new reason routes like the other "a person decides" reasons, by what the new head shows:
    • red CI, a review-swarm changes_requested or a conflict on the new head still goes to the author (070/071/072);
    • a head with no verdict yet stays at 050;
    • otherwise it goes to 085.
  • It never lands at 071/072 for the old review, so the nudge and the adoption clock (which only run at 072) don't start.

085 note (automerge_stage_human.go)

Monitor (stage_tracker_decision_pr.go, stage_tracker_waiting.go, stage_tracker_caption.go)

  • The question reads: "@Reviewer requested changes on an older commit; @author pushed <sha> since. Re-review it, or dismiss the review?"
  • Wait kind is re-review-requested, and who is the reviewer.
  • Approve is disabled, with the reason: approving on the dashboard does not clear the GitHub review.
  • The caption says who must re-review.

Native merge queue (automerge_native_queue.go)

  • A PR with this reason is withdrawn from the queue, as with any other change request.

Docs and changelog

  • A new row in docs/labels-and-control-signals/stage-labels.md.
  • A changelog fragment.

Not done:

  • The optional ping comment to the reviewer. The 085 entry note already names and @-mentions them once per head.
  • The hive does not dismiss stale reviews, and the ruleset's dismiss_stale_reviews_on_push setting is left alone.

Tests

New:

  • automerge_rereview_requested_test.go, through trySweepContributorLanePR. Cases:
    • a review on an older commit returns re-review-requested:<login> and no merge;
    • a review on the head stays changes-requested;
    • a review on the head outranks an outdated one;
    • several outdated reviewers are listed in sorted order;
    • a later approval, or a dismissal, clears the block and the PR merges;
    • a review with no commit stays with the author;
    • a review carried over a merge of the base stays with the author.
  • The same file also covers the reason helper, the 085 wording ("@author has pushed since", never "offline") and the native-queue withdraw.
  • derive_pr_rereview_test.go: the reason classifies as 085 (human) on both lanes, a needs-rebase label still goes to 072, and a request on the head stays at 072.
  • stage_tracker_rereview_test.go: the chairlift#799 row, with adoption due and the takeover grace elapsed. It now asks the reviewer, never says "offline", offers no adopt option, disables Approve, and the wait kind and who name the reviewer.
  • prstage/rereview_test.go: the reason's format/parse round trip.

Updated: the existing hasOutstandingChangesRequested call sites in automerge_sweep_test.go and automerge_sweep_trusted_author_test.go for the new signature. Their reviews carry no commit, so their expectations are unchanged.

Only gofmt -l was run locally (AGENTS.md bans local go test/go build/go vet); this PR's CI is the test run. static/index.html was regenerated from static-src/, and the diff is only the new wait-kind label.

πŸ€– Generated with Claude Code

https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1

…e author

The contributor lane and the trusted-author lane checked for a standing
CHANGES_REQUESTED review with hasOutstandingChangesRequested, which
ignored which commit the review was on. A PR whose author had already
pushed the fix stayed at 071/072, its clanker author was nudged, and
once the adoption grace ran out the Activity monitor asked "@author has
been offline ... take the PR over now?" (projectbluefin/chairlift#799,
about 2h 45m after the author pushed). The wait was on the reviewer:
GitHub keeps a change request blocking until it is re-reviewed or
dismissed.

hasOutstandingChangesRequested now sorts the standing change requests
by whether they bind to the head. One on the head, with no commit, or
carried to the head by a merge of the base (the walk an approval uses)
keeps today's changes-requested reason. When every standing request is
on an older commit with content pushed since, the lanes return
re-review-requested:<reviewers>, which routes as a decision cause:
red CI, a swarm changes_requested or a conflict on the new head is
still the author's, otherwise 085. The 085 note names each review, its
commit and the author's push (reusing the hivecommons#633 re-review clause), and
the monitor asks the reviewer to re-review or dismiss, with wait kind
re-review-requested and who the reviewer. No nudge and no adoption
clock at 085. The native queue withdraws such a PR.

Refs hivecommons#13041

Signed-off-by: Danathar <6772335+Danathar@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Nov 17, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign clubanderson for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubestellar-prow kubestellar-prow Bot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Nov 17, 2026
@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Open PR overlap check

Base branch: v6

Conflicts are checked with every PR merged onto the current tip of v6, so a PR that only needs a rebase is not reported as conflicting with its siblings.

PR Title Relation Files
#18667 πŸ› automerge: refuse an unsigned squash only where the repo requires DCO same files src/docs/labels-and-control-signals/stage-labels.md

Danathar and others added 2 commits November 17, 2026 15:49
Signed-off-by: Danathar <6772335+Danathar@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1
@hivecommons-hive
hivecommons-hive Bot merged commit 70ea515 into hivecommons:v6 Nov 17, 2026
74 of 75 checks passed
@hivecommons-hive

hivecommons-hive Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Hive status β€” updated in place; edits do not notify. Full history is in the Activity Monitor.

Evidence bundle `#18810d24fc21` sha256:7473934d63c6808d0337fab831abc766ddd7110aefdf9b5dd2799a644a1dcc83 β€” download from the dashboard or `hivectl review evidence #18810`.

merged by Hive trusted-author auto-merge: author Danathar holds role owner and GitHub permission maintain on repo; CI green at d24fc21.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dco-signoff: yes Indicates the PR's author has signed the DCO. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant