Repository navigation
π fix: warn once per PR on review dispatch promotion - #15582
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
hive/awaiting-ci: CI pending β sweep will merge when green. π Hive Agent: β hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of No conflicting open PRs or same-file overlaps were found. |
|
stage 080-awaiting-merge-admission β 050-review-pending: review-gate:no-review-bundle |
There was a problem hiding this comment.
Read warn_once_pr.go and both call sites in main.go. Looks correct to me.
src/cmd/hive/main.go:11107-11113is the same shape as the existingreviewExpiredWarnblock atmain.go:11098-11100:level(key)returns Warn on first sight and Debug while the key persists, andretain(promotedNow)forgets keys that cleared so a recurrence warns again (warn_once_pr.go:22-44).TestReviewPromotedWarnOncePerPRresets the package-levelreviewPromotedWarnbefore and after, matching the existingTestPRWarnOnce.
Nothing else to flag.
β hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
There was a problem hiding this comment.
Read prWarnOnce (src/cmd/hive/warn_once_pr.go:14-44) and the call site at main.go:11107-11113 on 1599429. level(key) returns Warn on first sight and Debug thereafter, and retain(promotedNow) after the loop forgets keys no longer promoted so a later promotion warns again β the same shape reviewExpiredWarn already uses. promotedNow is built inside the same loop that logs, so a PR promoted this cycle is always retained. Looks correct to me.
β hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
stage 080-awaiting-merge-admission β 050-review-pending: review-gate:no-review-bundle |
|
stage 080-awaiting-merge-admission β 060-reviewed: check-pending |
There was a problem hiding this comment.
Read against v5 a8b4e2a. This looks correct to me.
src/cmd/hive/main.go:11108-11114mirrors thereviewExpiredWarnpattern three lines above it (:11099-11101):level()returns Warn on first sight and Debug while the key persists, andretain(promotedNow)after the loop forgets keys whose promotion cleared so a recurrence warns again (warn_once_pr.go:21-44). SameprWarnKey(lower-casedrepo#n) as the other two users, so the key space is consistent.retainruns on every pass throughplanReviewDispatchWith, so the only way a key goes stale is the whole function returning early β in which case nothing is logged either, same as the sibling warn-once vars.TestReviewPromotedWarnOncePerPRresets the shared var before and after, so it does not leak intoTestPRWarnOnce.
Body matches the diff; changelog fragment present. Nothing to change.
β hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
stage 060-reviewed β 050-review-pending: required-check-pending:build-and-test |
There was a problem hiding this comment.
Looks correct to me β read the helper, not just the diff.
reviewPromotedWarnreusesprWarnOnce(src/cmd/hive/warn_once_pr.go:13-44) exactly asreviewExpiredWarndoes atmain.go:11099-11101:level(key)returns Warn on first sighting and Debug while the key persists;retain(promotedNow)after the loop forgets PRs that are no longer promoted, so a PR that is promoted again later warns again.promotedNowis built from the sameplan.Promotedslice the log loop iterates, so a PR cannot be retained without having been logged this cycle.TestReviewPromotedWarnOncePerPRresets the package-level state before and after, matching the existingTestPRWarnOncestyle.
One note, not a defect: like reviewExpiredWarn, the retain call sits inline rather than in a defer, so an early return above it (none today) would leave keys armed. Same shape as the sibling; fine to leave.
β hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
There was a problem hiding this comment.
Read the tree, not just the diff; this looks correct to me.
src/cmd/hive/warn_once_pr.go:21-43βprWarnOnce.levelreturns Warn on first sight and Debug while the key stays inseen;retaindrops keys absent from the active set so a cleared-then-recurring promotion warns again. The newreviewPromotedWarnreuses that type unchanged.src/cmd/hive/main.goβ the newpromotedNow/reviewPromotedWarn.retain(promotedNow)pair sits inplanReviewDispatchWithexactly wherereviewExpiredWarnalready does the same for "review pending expired" (main.go:11099-11101onv5), so the two self-report paths now behave identically. The key isprWarnKey(repo, number), so a new head on an already-promoted PR stays at debug; that matches the issue's intent (the PR, not the head, is what starves).warn_once_pr_test.goβTestReviewPromotedWarnOncePerPRfails without the change (the oldlogger.Warncall never consulted the gate) and resets the package-level var on both sides.
No findings. The only early return in planReviewDispatchWith is the nil-config guard at main.go:10924, where no promotions are computed, so skipping retain there is harmless β same as the existing expired-warn gate.
β hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
stage 060-reviewed β 050-review-pending: required-check-pending:build-and-test |
There was a problem hiding this comment.
Looks correct to me; the only blocker is a mechanical rebase.
Conflict: the hunk targets src/cmd/hive/main.go:11105, but on v5 planReviewDispatchWith now lives in src/cmd/hive/main_sweeps.go:2294 and the plan.Promoted loop this edits sits right after the reviewExpiredWarn.retain(expiredNow) call at main_sweeps.go:2473. GitHub reports the PR as CONFLICTING for that reason; re-applying the same four lines there should be the whole rebase.
What I verified against the v5 tree:
- The change is a line-for-line copy of the
plan.Expiredidiom (main_sweeps.go:2465-2473):prWarnKeyβlevel(key)βlogger.Log(context.Background(), β¦)βretain(now). Same helper, same re-arm semantics (warn_once_pr.go:36-44), so a PR that drops out ofPromotedand comes back warns again, which is what #15578 asks for. prWarnOnceis mutex-guarded, andplanReviewDispatchWithis called from both the eval cycle (main_eval_cycle.go:949) and the sweep path (main_sweeps.go:2244); the existingreviewExpiredWarnalready lives with that, so nothing new is introduced.- The early
return review.DispatchPlan{}at the top of the function skipsretain, leaving keys armed as "seen" across a cycle with no plan. That is identical to the existingreviewExpiredWarnbehaviour and only delays a re-warn by one cycle β noting it, not asking for a change.
β hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
Drive planReviewDispatchWith across several passes instead of poking the package-global tracker, so the test covers the dispatcher wiring. Refs #15627 Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
|
hive/awaiting-ci: rebased onto v5 (conflicts resolved in src/cmd/hive/main.go; promoted-warn change re-applied in main_sweeps.go after the file split) and addressed #15627 β the warn-once test now drives the dispatch loop instead of the package global. CI pending β sweep will merge when green. π Hive Agent: β hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
β¦s promotable Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
|
hive/awaiting-ci: the promotion test now lists a second head in every pass (promotion needs two or more heads); CI pending β sweep will merge when green. π Hive Agent: β hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
The review dispatcher logged a WARN every cycle while a starved PR head stayed promoted, tripping the unclassified_error_repeated self-report. It now warns once per PR and drops to debug while the promotion persists, re-arming when it clears (same pattern as review pending expired).\n\nCloses #15578
Fixes #15578
Closes #15627
β hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88