Repository navigation
π fix: expose deferred PR fixer queue positions - #16553
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 |
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of
|
There was a problem hiding this comment.
Correctness review (head b824717aef61)
Partial GitHub enumeration evicts queued fixer entries as if their PRs closed β src/cmd/hive/fixer_queue.go:33-50 (reconcileDeferredFixQueue) and :55-64 (reconcilePlannedFixQueue) only guard actionable == nil. But EnumerateActionable returns err == nil with a repo's PRs simply absent whenever that repo's forgestate/issues/PR fetch fails and no last-good snapshot exists (src/pkg/github/client.go:1696-1727; the PR-only branch keeps issues and drops PRs; only the all-repos-failed case errors, :1792). In overlay-mode an all-repos failure also yields a non-nil empty, stale-marked result (src/cmd/hive/main_eval_cycle.go:431-438). In each case ReconcileFixerQueue (src/pkg/governor/fixer_queue.go:62-75) drops every entry for the affected repo(s); the planner (src/cmd/hive/main_sweeps.go:2393) also sees no candidates, so the second reconcile does the same. Next cycle the kick is deferred again and re-added with a fresh firstDeferredAt, so the PR loses its position and jumps to the back of the queue β the "position drops as earlier kicks are delivered" criterion in #16537 is violated during transient GitHub errors. The author's own comment (fixer_queue.go:35) states the right rule; the nil check just doesn't implement it for partial failures.
Suggested fix: scope eviction to repos actually enumerated this pass β keep any entry whose repo is absent from actionable.TotalByRepo or present in actionable.StaleRepos (client.go:1671 populates TotalByRepo only via appendRepo), and apply the same repo filter in reconcilePlannedFixQueue. Add a test with a two-repo result where one repo is missing/stale.
β hive: agent=adjudicator backend=copilot model=claude-fable-5.1 copilot=1.0.88
There was a problem hiding this comment.
Read the diff against v5 merge-base 10b34594 plus the callers it hooks into; this looks correct to me.
What I checked, in case it saves a maintainer the trace:
- Keying is consistent end to end.
RecordFixKickDeferredlowercasesPRRef(src/pkg/governor/fixer_queue.go:24),PRRefisrepo#number(src/pkg/review/dispatch.go:1608),github.ReviewQueueKeylowercases the same shape (src/pkg/github/review_queue.go:323-325), and the dashboard looks entries up with that key (src/pkg/dashboard/api_review_queue.go:141). No case/format mismatch that would silently drop entries. reconcilePlannedFixQueuedoes not wipe a still-waiting deferral. The concern would be thatdispatchFixappends toState.Fixesat plan time (dispatch.go:1609), so a deferred-but-undelivered fix would be excluded asPendingnext cycle and vanish fromFixKicks. It doesn't: the end-of-passConfirmDeliveredremoves undelivered fixes fromstate.Fixes(dispatch.go:1720-1729), so the PR is re-planned, stays inFixKicks, and the queue entry survives until delivery or close.reviewQueueItemembedsReviewQueueEntry+FixerQueueStatus; neither has a customMarshalJSON, so the two optional fields are promoted additively and existing consumers are unaffected (matches #16537's acceptance criteria).deps.Governoris*governor.GovernorandFixerQueueis nil-receiver safe.
One note, not a defect: #16537 says it is blocked by #16536 (fallback routing), but this change hooks the deferral point that already exists at merge-base (eval_cycle_seams.go:612), so it stands on its own. The in-memory queue loses firstDeferredAt across a restart β the code comment at fixer_queue.go:80 already says so.
β hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
Hive status β updated in place; edits do not notify. Full history is in the Activity Monitor. Review findings from Looks correct to me. I read the three write paths and the two read paths against the v5 tree, not just the diff:
One low-severity fidelity note, not a blocker: Body says "Fixes #16537" and the diff does deliver what the changelog fragment claims. The previous lane reason was a coverage failure; all three new source files ship with tests in their own packages, so the per-package floors should hold once CI reruns (checks are currently cancelled/skipped on this head). Hive filed review findings that do not block this PR as backlog items:
Cap: 10 backlog item(s) per PR per day. hive/awaiting-ci: rebased onto v5 and resolved conflicts (src/pkg/dashboard/webstatic/testdata/tracker-header-geometry.js β kept v5's identical display:contents fix; the PR's duplicate commit became empty/dropped); CI pending β sweep will merge when green. mobile-shots remains deferred to #16551. π Hive Agent: β hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 Evidence bundle `#16553c6fa651` sha256:756b7b8bff2308cbb286097fe1f9df3e314956cabcbc5c805166d6d0a482e38c β download from the dashboard or `hivectl review evidence #16553`. |
|
Scanner triage at 8ac9094: the only red check, π Hive Agent: β hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
There was a problem hiding this comment.
intent-alignment β delta re-review at 27756aa (previous head 8ac9094)
Prior findings:
- Fixed β key mismatch (
fixer_queue.go:45/main_eval_cycle.go:577):fixerQueueKey(src/cmd/hive/fixer_queue.go:38-57) now normalises every writer/reader togithub.ReviewQueueKey(org/repo, N);Deferred/Delivered(:24,30) andreconcilePlannedFixQueue(:87) use it, matchingreconcileDeferredFixQueue(:69-73) and the/api/review/queuelookup.TestFixerQueueBareRepoKicksSurviveReconcileAndMatchDashboardKey(fixer_queue_test.go:136-184) drives a bareRepo: "Repo"kick through three reconcile cycles and asserts the position survives and clears on delivery β exactly the gap the previous review named. #16537's acceptance criteria are now met as wired.
Advisory (non-blocking): commit 88403327 changes src/pkg/dashboard/webstatic/testdata/tracker-header-geometry.js:274-280 (display:contents wrapper flattening for the chevron-centring probe). .ham-active-ico-wrap lives in tracker-row-strip.js, which this PR doesn't touch, so this is a pre-existing mobile-shots fixture fix unrelated to #16537, bundled to unblock the check that failed at 8ac9094. Acceptable under the PR body's "fix the failing checks" mandate, but worth noting in the squash message so the fixture change is traceable.
β hive: agent=ci-maintainer backend=copilot model=claude-fable-5.1 copilot=1.0.88
Remember the first deferral of each review fix kick in the governor and remove it on delivery or when enumeration no longer sees the PR open. Expose optional queue status through the governor and review queue APIs, and show the number ahead beside the PR's dashboard stage metadata. Hive-Run: #16537 Hive-Plan: issue-16526/deferred-fixer-queue Hive-Spec: issue-16537#acceptance-criteria Signed-off-by: thatguywob <thatguywob@users.noreply.github.com>
β¦tries whose PR no longer plans a fix kick Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
β¦, reconcile and lookup
Dispatch plans carry pr.Repo as configured (often the bare repo name), so
RecordFixKickDeferred stored "repo#N" while reconcileDeferredFixQueue kept
only ReviewQueueKey("org/repo", N). Each cycle evicted the entry, losing the
first-deferral timestamp, and /api/review/queue's full-key lookup never
matched, so fixer_queue_position was never emitted.
Route Deferred, Delivered and reconcilePlannedFixQueue through one
fixerQueueKey helper that qualifies bare repos with the project org, and
pass cfg.Project.Org from the eval cycle. Adds a regression test that drives
a bare-repo kick through several busy reconcile cycles and checks it stays
queued under the dashboard's key until delivery.
Refs #16537
Hive-Fix-Attempt: 1/6
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
27756aa to
c6fa651
Compare
There was a problem hiding this comment.
Looks correct to me. Read the diff at c6fa651 plus the callers it depends on:
- Key agreement β the bug #16537 describes (bare
repo#Nvsorg/repo#N) is closed:fixerQueueKey(src/cmd/hive/fixer_queue.go:38-53) qualifies the repo and routes throughgithub.ReviewQueueKey, which lowercases (src/pkg/github/review_queue.go:323-325); the governor lowercases on write (fixer_queue.go:23,45) and the dashboard looks up with the sameReviewQueueKey(entry.Repo, entry.Number)(api_review_queue.go:141). All three writers/readers agree. - Planned-reconcile does not self-evict β
reconcilePlannedFixQueuekeeps only PRs the current plan still kicks. That is safe because a deferred kick is never confirmed into dispatch state:persistReviewDispatchState*only confirmdeliveredReviewKicks(main_sweeps.go:3044-3059), andonDeferredfires beforeonReviewDeliveredcan (eval_cycle_seams.go:612-618). So the planner re-emits the fix kick next cycle and the entry survives, whichTestFixerQueueBareRepoKicksSurviveReconcileAndMatchDashboardKeyexercises. - The empty plan returned when
!cfg.Review.RequireApproval || !cfg.Review.FanOutonly reachesReconcileFixerQueuewith an empty keep set in configs where no fix kick can exist, so it clears nothing real. - Locking is consistent with the rest of
Governor(mu sync.RWMutex,governor.go:251);FixerQueue()returns a fresh map, so the dashboard never aliases governor state.
Per #16537 the decision was "expose it additively as optional fields β¦ on the existing governor endpoint"; the PR does that (fixer_queue on /api/governor/pr-models) and additionally flattens the two fields onto /api/review/queue items, which is what the hint needs. Both omitempty, so existing consumers are unaffected as the issue requires. Blocker #16536 is closed.
One docs gap, not a blocker: src/docs/api-reference/agents-and-controls.md:26 enumerates the per-entry fields of /api/review/queue (pending_since, redispatch_count, stage{β¦}), and the same table describes /api/governor/pr-models. Neither row mentions fixer_queue_position / fixer_queue_ahead / fixer_queue. Worth a line in each so operators reading the reference know the hint's source.
Checks: everything green except tide (pending, expected); the two CANCELLED rows are superseded runs from the earlier head.
β hive: agent=reviewer 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 |
Supersedes #16546 (adopted in place, re-homed because a hive commit on the contributor branch cannot carry a squash-safe sign-off; original commits by @thatguywob preserved).
Fixes #16537
This branch is #16546's head
b824717aef61as pushed by @thatguywob (forkthatguywob/hive), unchanged. Last lane reason on the original:required-check-failing:coverage.Hive fix agent: rebase this branch on
v5, fix the failing checks / review asks, and push to THIS branch. Keep the original author's commits and theirSigned-off-by; add your own sign-off on your commits. Do not open another PR.Sign-off attribution: the original PR would squash the App's signed fixes as the contributor. This App-authored superseder keeps every original commit and sign-off unchanged and attributes the squash to the App instead. DCO and all merge gates still apply here.