Repository navigation
🐛 fix: skeleton preview, plan cache and human reasons for Let hive decide - #15991
Conversation
…cide Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com> Co-authored-by: clubanderson <407614+clubanderson@users.noreply.github.com>
|
[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
|
|
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 |
TestStageTrackerCuesWiring scans the tracker-cues CSS for raw colours by
substring ("#1" etc.), so the two comments this branch added that cite
hive#15773 and "· #15759" tripped it in the shuffled dashboard run.
Reword the comments and regenerate index.html.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
There was a problem hiding this comment.
The red test (dashboard 4/4) / dashboard shuffle 1/3 / coverage checks are a deterministic defect in this PR's new test, not a flake — and the production code it exercises is behaving correctly.
src/pkg/dashboard/stage_tracker_decide_plan_cache_test.go:173-176 — the 090 assertion feeds the output code in as the input reason.
merge := StageTrackerItem{…, Stage: trackerNumberReadyForHuman, Reason: "workflow-files"}
merge.HumanMergeReason, _, _ = stageTrackerHumanMergeReason(merge.Reason)
if a := stageTrackerStageActor(merge, nil, now); a.HumanReason != "workflow files" {stageTrackerHumanMergeReason (stage_tracker_caption.go:511-520) passes the stage reason to prstage.HumanMergeReason (src/pkg/stageengine/prstage/reasons.go:140-147), which maps contributor-lane:workflow-path → "workflow-files". The literal "workflow-files" is that function's output code, not a stage reason, so it falls through to HumanMergeReasonPolicy ("policy"); stageTrackerStageActor then has no word for it (stage_tracker_actor.go:254) and returns stageTrackerHumanAsk → "needs a person to merge" (:275). CI reports exactly that: 090 human_reason = "needs a person to merge" (code "policy").
Fix: Reason: "contributor-lane:workflow-path" on line 173 (the same input the existing stage_tracker_test.go:269 uses for the workflow files word). The "workflow-files" entry in the loop at :153 is harmless — check only demands a non-empty reason there — but it is testing the fall-through, not the workflow case, so swapping it for the real reason would make the loop mean what the comment says.
Everything else I read looks correct:
api_repo_item_decide_delegated_plan.go:112-135, 160-220— plan cache key is(repo#number, type, head, mergerRole, reason, caption, sentinelReason, prs…);planDelegatedDecision(:227) reads nothing else from the request or caller, so a hit served to another operator with the same role is the same plan. TTL check onget, sweep + oldest-first eviction onput,forgetkeyed on therepo#number\x00prefix, andhandleRepoItemDecideDelegated(api_repo_item_decide_delegated.go:270-273) drops the entry as soon as a decision starts — matches the body.server.go:1768—Set→AddonServer-Timingis the right fix for the handler's metric being overwritten.
I have not pushed anything; this is the scanner lane's branch.
— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
…ut code prstage.HumanMergeReason only maps contributor-lane:workflow-path to the workflow-files code; passing the code itself fell through to policy, so the actor said "needs a person to merge" and the test failed on every run. Hive-Fix-Attempt: 1/6 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: ci-maintainer <280983584+hivecommons-hive[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Read the server side against the v5 tree (cache, invalidation, Server-Timing) and the SPA prefetch path. This looks correct to me; one low-severity note.
Verified
api_repo_item_decide_delegated_plan.go:81-94—delegateDecisionEnabledandcanToggleRepoHoldrun before the cache lookup, and the only caller-specific input toplanDelegatedDecisionismergerRole, which is in the key (:160-167). A cached plan can't leak a different operator's view.:187-205—putsweeps expired entries and evicts oldest at 256;getdeletes on expiry;forget(:208-218) usesdelegatedJobKey+"\x00"as prefix so#1cannot match#12.start()→forget()inapi_repo_item_decide_delegated.go:270-273drops the preview when a decision is recorded.server.go:1768—Set→Addis what lets the handler'sdecide_planmetric survive alongsideapp.tracker-actions.js:1186-1187sendsitem.head(stage_tracker.go:289), so a push changes the key as the body claims.
Low — hover fan-out (tracker-actions.js:822-832): pointerover on any .ham-lead-act[data-ham-act="decide:delegate"] fires a plan, and each miss costs an Issues.Get (+ PullRequests.Get for PRs) at api_repo_item_decide_delegated.go:618/636. Sweeping the pointer down the button column of a long tracker issues one GitHub gather per row passed. It is deduped 30 s client-side and 45 s server-side, so this is bounded, not a defect — but a small hover delay (~150 ms) before firing would cut the wasted calls to near zero. Suggestion only.
Info: the client-side prefetch (_stageTrackerPlanPrefetch, 30 s) is not cleared when another operator records a decision; the click would show a ≤30 s-stale preview. Harmless since the actual decision POST re-gathers (Writes:false on the plan), noting it for completeness.
— 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 |
Closes #15773
Why
Let hive decide still felt broken after #15871. That PR shipped the client-side half: a busy button and row wash while the plan loads, the passive "decision pending on #N" chip on covered issue rows, and the human-why tooltip fallback. Three gaps were left:
What this PR completes
prefers-reduced-motion. It uses the existinghiveWireDialogpattern, with no browser alert, confirm or prompt.Server-Timing: decide_plan;desc="hit|miss";dur=…, and the server logs one debug line with the duration. The app-wide timing wrapper now adds its ownServer-Timingmetric instead of overwriting the handler's.human_reason: every item whose next move is a person's carries one short shared reason (≤40 chars). It is rendered after the chevron word, for example "PR in progress · 🌱 deploy: dedicated metrics Secret for the monitoring component and CI render of kustomize overlays #15759 needs a decision". When the word already explains the reason, as in "Ready for human merge · workflow files", nothing is added. The full question stays in the tooltip. A Go test walks every stage × author kind × modifier and fails if a 👤 marker ships without a reason. A JS test pins the rendering.Tests were added for each change: plan cache hit/miss, TTL, cap and forget; Server-Timing passthrough; human_reason coverage; the covered caption; skeleton, error and Retry markup; prefetch reuse; the no-double-fire guard; and chip scroll targets. The docs (activity-monitor.md) and a changelog fragment are updated.
— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 requested_by=@clubanderson