Repository navigation
🐛 fix(stage): clear needs-triage once an issue is actionable or claimed - #14648
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 |
|
@clubanderson is auto-promoted for contributor-lane merging on this PR: the last 5 merged PRs by this author in this hive's repositories have no revert or sentinel-alert evidence. CI, reviewer verdict, diff fences, soak, holds and branch protection still apply. |
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of
|
|
@clubanderson this PR is held at Failing checks:
Next: the hive does not push to your branch. Push a new head (or reply here); CI and the review swarm re-run automatically and the PR returns to the normal path. |
|
@clubanderson this PR is held at Why:
Next: the hive does not push to your branch. Push a new head (or reply here); CI and the review swarm re-run automatically and the PR returns to the normal path. |
A hive-filed self-report wears needs-triage from filing (fleetreport); 015 is a tracking state, not a gate, so the scanner claims it, and the stage reconciler never touched the non-owned label — leaving claimed and closed issues reading "Triage needed" on the activity monitor (#14586). - stagelabels: Desired.Clear names labels Plan removes alongside the stage; Stage.SettlesTriage() is true from 020 on (and PR-mirrored stages), false at 010/015/017/045 which may fall back to 015. - stageengine: IssueFacts.TriageAwaitingLabel; Decision.Clear set when the derived stage settles triage, so a direct 015→020 claim removes needs-triage in the same label write. - github: sweep reconciles open issues already at 020+ still wearing it. - dashboard: stage text comes from the stage label only; a stale needs-triage on 020+ is dropped from modifiers and reported as stale_labels with a muted tooltip line. Fixes #14644 Signed-off-by: Andy Anderson <andy@clubanderson.com>
…t into node fixtures Desired now carries a []string (Clear), so the struct is no longer comparable with !=; and the Go-driven node fixtures that evaluate stageTrackerTooltip must extract the new helper it calls. Signed-off-by: Andy Anderson <andy@clubanderson.com>
6ecb06b to
b9f68ea
Compare
There was a problem hiding this comment.
Looks correct to me — read at b9f68ea against the v5 tree, not just the diff.
stagelabels.goSettlesTriage():s != None && !s.Before(Claimed) && s != IssueNeedsDecision. Against the definitions table (stagelabels.go:262-278) that is true for 020/030/040 and every PR-mirrored stage, false for 010/015/017/045/None — exactly the set the PR body andlabels-and-control-signals.mddescribe.Plan(stagelabels.go:814-838):clearSetis consulted only after thewantedcheck, so a label the stage still wants can never be cleared; it removes the label as spelled incurrent, so mis-cased labels come off too. Never adds. Matches the doc comment onDesired.Clear.- Sweep path,
issue_stage_labels.go:483-485→:490: settingwant.ClearmakesPlannon-empty for an already-correct 020 issue, so it enterspendingand reachesReconcileBatchinstead of hitting thecontinueat:491. The actual write is then the engine'sDecision.ClearfromissueFactsFrom(in, prStage)→resolveIssueLabelFacts(issue_stage_facts.go:38), which now setsTriageAwaitingLabel— so pre-plan and engine agree on the same label. - Out-of-cycle path:
issueDeriver.Derive(issue_stage_facts.go:131-139) rebuilds the input fromf.Labelsand re-runsresolveIssueLabelFacts, so a FactSink claim (015→020) also getsClearpopulated — the "atomically with the stage write" claim in the body holds for both entry points. - Dashboard
stage_tracker.go:1180-1186:StaleLabelsis set only whenstage != TriageNeededand the chip was present; at 015 itself the chip is simply dropped as before. No change for 010/017/045 rows.
Body matches diff; no scope beyond #14644. Nothing blocking from me — the BLOCKED merge state is the branch's review requirement, not a red check (the three CANCELLED "Sign-off survives the squash" runs are superseded runs; the current one is green).
— hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
There was a problem hiding this comment.
Looks correct to me at b9f68ea; the two write paths agree and Clear survives all the way to the label call. No changes requested.
What I checked in the tree, not just the diff:
- Both paths produce the same removal. The sweep pre-plan sets
want.Clearatsrc/pkg/github/issue_stage_labels.go:485-487, and the engine path setsDecision.ClearviaissueTriageClear(src/pkg/stageengine/derive_issue.go:74-80) fromIssueFacts.TriageAwaitingLabel, whichresolveIssueLabelFactsfills from the sametriageAwaitingLabelconstant (issue_stage_facts.go:102-105). The reconciler then callsWriter.Apply(ctx, f.Ref, f.Labels, d.Desired())(stageengine/reconciler.go:159) →stageWriter.Apply(github/stage_writer.go:26) →Plan(hint, want)/Plan(fresh, want)(stagelabels/enforce.go:65,75) — nothing in that chain rebuildsDesiredwithoutClear. TheEnforcehelper atenforce.go:107builds its ownDesired{Stage, Role}but that is a different entry point and is not on this path. - The pre-plan addition is needed, not redundant.
issue_stage_labels.go:501-508skips the item entirely whenPlanyields no add/remove; withoutwant.Clearan issue already at 020 wearing the label would never reach the engine write. The14587case inissue_stage_labels_triage_clear_test.go:46-48covers exactly that. Desiredis no longer comparable (slice field,stagelabels.go:780). I greppedpkg/andcmd/for==/!=onDesiredand map keys of that type: the only use wasderiver_test.go:34, which this PR switches toreflect.DeepEqual.go buildofstagelabels,stageengine,github,dashboardpasses on this head.SettlesTriageboundaries (stagelabels.go:421-423:s != None && !s.Before(Claimed) && s != IssueNeedsDecision) line up with the transition table's fall-back-to-015 stages the comment names, andTestSettlesTriagepins all nine.- Dashboard:
stage_tracker.go:1180-1185moves the chip toStaleLabelsonly whenstage != TriageNeeded, so 015 keeps nothing stale (asserted atstage_tracker_triage_modifier_test.go:69-71).stageTrackerTriageNeededinindex.htmlis unchanged and readsmodifiers, so "Accept triage" disappears on claimed rows purely because the payload no longer carries the modifier — the node test atstage_tracker_stale_triage.test.js:37pins it.
PR body and diff match; the only thing holding this is the rebase against v5 (overlaps #14573 on dashboard-sections.md / index.html).
— 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 |
|
merged by Hive trusted-author auto-merge: author @clubanderson holds role owner and GitHub permission admin on repo; CI green at b9f68ea. |
Fixes #14644
What
needs-triageis now removed in the same label write that moves an issue tostage/020-claimedor later; open issues already at 020+ still wearing it are reconciled on the next sweep; the activity monitor derives a row's stage text from the stage label only and reports a leftoverneeds-triageasstale_labels(muted tooltip line) instead of "Triage needed".Why
#14586: a hive-filed self-report (fleetreport stamps
needs-triageat filing) was claimed by the scanner, closed, and still woreneeds-triage— the tracker read Claimed · triage needed. 015 is documented as a tracking state, not a gate (stagelabels.go, transition table 015→020), so the scanner rightly claimed it; butstagelabels.Plannever touched the non-owned label andstage_tracker.godeliberately kept the chip on non-015 stages. This PR makes the code match the documented design: claiming settles triage.How
stagelabels:Desired.Clear— labelsPlanremoves alongside the stage (case-insensitive, never adds, no-op when absent).Stage.SettlesTriage()is true at 020/030/040 and PR-mirrored stages; false at 010/015/017/045 (which the table lets fall back to 015, so the label must survive there).stageengine:IssueFacts.TriageAwaitingLabel;Decision.Clearpopulated when the derived stage settles triage, so a direct 015→020 claim (sweep or out-of-cycle FactSink) clears it atomically with the stage write viaEnforce.github: sweep pre-plan setswant.Clearso an already-correct 020 issue still wearing the label gets one reconciling write.dashboard: modifier dropped andStaleLabelsset whenstage.SettlesTriage();stageTrackerStaleLabelsTexttooltip helper; no "Accept triage" offered on a claimed row.Plan/SettlesTriagetable, derive 015→020 / 030 / 040 / 045 / absent-label, sweep end-to-end (removedcontainsneeds-triage+ 015, unrelated labels untouched, already-claimed sheds only the stale label, untriaged keeps it), dashboard Go + node fixture.labels-and-control-signals.md(015 row, reporter-trust row, diagram),dashboard-sections.md; changelog fragment.Not in this PR
writers exhausted (max 1)contention → convergence mutation boundary: per-repo single writer slot (max 1) would deny ~110 writes/4h once enforced — label writes queue behind reviews and merges #14645.label_skipped blockers=["needs-triage"]shadow: recommend not enforcing forneeds-triage(would withhold hive-filed self-reports forever); noted in needs-triage survives a claim: claimed (and closed) self-reports still read "Triage needed" on the activity monitor #14644.