Repository navigation
π issue stages: remove needs-triage once, then yield it to the repo's own triage tooling - #18388
Conversation
β¦ own triage tooling On a repository whose own triage tooling owns `needs-triage` (Prow's require-matching-label action re-adds it to every issue without a triage/* label), the issue stage sweep took the label off a claimed or covered issue on every pass and the tool put it back seconds later: 312 removals on 16 projectbluefin/utah issues in one night, each also starting a GitHub Actions run there. The hive now removes the awaiting label at most once per issue: - stagelabels.Record gains TriageClearedAt / TriageClearYielded (persisted, so the yield survives a restart) with Store NoteTriageCleared / MarkTriageClearYielded. - The engine's Reconcile books the removal whenever its write removed the label; it is the one write path both the sweep and every FactSink submission take. - settleTriageClear (pkg/github) is the one yield decision: label back after a booked removal -> mark the record yielded, log one INFO line (repo, issue, label), never remove it there again. The sweep's pre-plan and the FactSink enrichment both call it and carry the result as IssueFacts.TriageClearYielded, which makes issueTriageClear return nil. Issues whose label never comes back (hive-filed self-reports) lose a stale needs-triage once claimed as before (hivecommons#14586). SettlesTriage, the reporter-trust gate and Plan ownership are unchanged. Fixes hivecommons#18387 Hive-Run: hivecommons#18387 Hive-Plan: hivecommons#18387 Suggested implementation (steps 1-7) Hive-Spec: hivecommons#18387#acceptance-criteria Signed-off-by: Karibhou <157208370+Karibhou@users.noreply.github.com>
There was a problem hiding this comment.
Correctness review at head 196c7b5 (advisory; no blockers). The removal booking (reconciler.go noteTriageCleared, from out.Removed) and the single yield decision (issue_stage_labels.go triageClearAllowed/settleTriageClear) satisfy #18387's "remove once, then yield" contract for the sweep path. The deriver guard (derive_issue.go issueTriageClear) covers the sink path.
- Low, in-scope: yield can be marked on a stale snapshot or at a non-settling stage.
settleTriageClearruns in the sweep pre-plan for every non-None stage (issue_stage_labels.go, theelsebranch beforestage.SettlesTriage()), usingin.Labelsfrom enumeration, outside the per-key reconcile lock. If a FactSink write removes the label between enumeration and the pre-plan, the sweep sees "label present +TriageClearedAtset" and permanently yields with a misleading "came back" log, though no other writer re-added it. The same applies at 010/015 after a claim release. The effect is limited to a permanent yield on that issue, but the yield is sticky. Suggest callingsettleTriageClearonly whenstage.SettlesTriage().
var clearTriage bool
if stage.SettlesTriage() {
clearTriage, triageYielded = settleTriageClear(store, key, in.Repo, in.Number, in.Labels, logger)
}
if clearTriage {
- Low, test adequacy: the sink path has no test.
enrichTriageClearYield(stage_facts_sink.go) and the Reconcile booking for a sink-originated write are not exercised.issue_stage_labels_triage_clear_test.goonly drivesSyncIssueStageLabels. Please add a case: sink fact removes the label, label is re-added, the next sink fact leaves it. - Open question:
ForgetStageonstage == Nonedeletes the record whenUnblockedAtis zero (store.goforgetStageLocked), which drops the yield. An issue that leaves and re-enters staging would get one more removal. Probably acceptable, but it is not stated in the docs.
β hive: agent=adjudicator backend=claude model=claude-sonnet-5-5 claude=2.1.325
|
Hive status β updated in place; edits do not notify. Full history is in the Activity Monitor. stage 095-pre-merge-soak β 074-adopted-by-hive: fork-not-editable hive/awaiting-ci: the only red shard is π Hive Agent: β hive: agent=scanner backend=claude model=claude-sonnet-5-5 claude=2.1.325 |
|
Ready for a human merge: verdict approved @6024738, 63/63 checks green, DCO yes, soak 10m0s elapsed. Blocked only by The hive never approves on your behalf: Updated 2026-11-16 21:49 UTC. |
|
@Karibhou this PR is back in your court ( Failing checks:
Reply here or push a new head to this branch (same sign-off); CI and the review swarm re-run automatically and the PR returns to the normal path. Queued in your relay fix queue (0 waiting): fixes are handed out before new work as soon as you have capacity. |
|
Check report: π Hive Agent: β hive: agent=scanner backend=claude model=claude-sonnet-5-5 claude=2.1.325 |
|
@Karibhou the hive has adopted this PR ( |
|
hive/scanner: test-agent fails on crux/agent.TestRestart_CancelsPendingAsyncKick (3/3 runs), a package this PR does not touch; the head is also 5 commits behind v5. Triage verdict is NOT_REACHABLE_FORK, so I did not push to the fork. Suggest merging v5 in and re-running; if the test still fails it is likely a baseline flake worth its own issue. π Hive Agent: β hive: agent=scanner backend=claude model=claude-sonnet-5-5 claude=2.1.325 |
|
CI report: the only failing shard is π Hive Agent: β hive: agent=scanner backend=claude model=claude-sonnet-5-5 claude=2.1.325 |
|
CI: crux/agent.TestRestart_CancelsPendingAsyncKick fails 3/3 in test (agent 3/5); branch is 7 behind v5. Fork head, so not pushing; please merge v5 and check whether that test is affected by the change. π Hive Agent: β hive: agent=scanner backend=claude model=claude-sonnet-5-5 claude=2.1.325 |
|
hive/scanner: π Hive Agent: β hive: agent=scanner backend=claude model=claude-sonnet-5-5 claude=2.1.325 |
Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
|
/ok-to-test |
|
@hivecommons-hive[bot]: Cannot trigger testing until a trusted user reviews the PR and leaves an DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
needs-human: Prow has not run this fork PR's presubmits. Its author is not one of Prow's trusted users, so the trigger plugin waits for A maintainer can comment |
|
[APPROVALNOTIFIER] This PR is APPROVED Approval requirements bypassed by manually added approval. This pull-request has been approved by: The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
The hive adopted this PR ( Blocker: check Moving to |
β¦e-flap Signed-off-by: Karibhou <157208370+Karibhou@users.noreply.github.com>
β¦tles triage Review follow-up on hivecommons#18388. The sweep called settleTriageClear for every staged issue, so a claim released back to 015 (where needs-triage is legitimately on again) booked the sticky yield. Only a stage that settles triage now judges it; elsewhere the record's existing yield is passed through unchanged. Tests: the 015 case, and the FactSink path end to end (a claim fact takes the label off and books it; after a re-add, the next sink fact yields and leaves it on). The reference doc states that the yield lives on the stage record, so an issue that leaves staging and re-enters it may have the label removed once more. Signed-off-by: Karibhou <157208370+Karibhou@users.noreply.github.com>
|
New changes are detected. LGTM label has been removed. |
|
hive-base-moved: merged current Review follow-up, new head
|
|
@Karibhou this PR has a new head without confirmed hive push evidence, so the hive has handed this PR back to you ( |
There was a problem hiding this comment.
Intent-alignment (delta 89a9036 β 6024738): approve. Of the large compare diff, the only #18387 files are issue_stage_labels.go and its test; the rest is v5 merged in.
The delta gates the sweep's yield on stage.SettlesTriage() (src/pkg/github/issue_stage_labels.go:629-635). A label legitimately back at 010/015 after a claim release no longer books the sticky yield. This stays within #18387's wanted behaviour: at most one removal, a sticky yield, and one INFO line. The new test covers the case.
Advisory, not blocking, <!-- hive-decision-risk: low -->: the FactSink path doesn't have the same stage gate. enrichTriageClearYield (src/pkg/github/stage_facts_sink.go:104-110) calls settleTriageClear before the deriver picks a stage. A ClaimReleased fact is the case I'd check: if it reaches this enrich hook with the label back and TriageClearedAt set, the yield is booked at a stage that doesn't settle triage. That is the case the sweep fix now avoids. I did not trace whether the release fact reaches this hook, so treat it as an open question. If it does, skip the settleTriageClear call there when the fact is not a settling one, or have the deriver book the yield only when it derives a settling stage.
β hive: agent=adjudicator-2 backend=claude model=claude-sonnet-5-5 claude=2.1.325
Review follow-ups (below
|
Open PR overlap checkβ
Resolved: no conflicting open PRs or same-file overlaps remain against |
|
Owner decision: approve and merge. Head 6024738 is green (all checks pass; only Tide pending), the change is scoped to the needs-triage remove-once/yield contract from #18387 with tests for the yield, the restart, and the unsettled-stage case. Trial merge onto current v5 is clean and does not interact with #18518 (workflow-model stage labels) or #18542 (gate labels). Adding lgtm. |
Summary
On a repository whose own triage tooling owns
needs-triage(Prow'srequire-matching-labelre-adds it to every issue without atriage/*label), the issue stage sweep removed the label from every claimed/covered issue on every pass and the tool put it back ~10s later β 312 removals on 16projectbluefin/utahissues overnight, each also triggering an Actions run there.The hive now removes the awaiting label at most once per issue; if it comes back, the hive yields it on that issue for good.
Changes
stagelabels.Record:TriageClearedAt(triage_cleared_at) andTriageClearYielded(triage_clear_yielded), persisted with the store so the yield survives a restart. NewStore.NoteTriageCleared/Store.MarkTriageClearYielded(the latter returns whether it set the mark, so the log line is written once).stageengineReconcile(noteTriageCleared): every hive write that can remove the label β the sweep'sReconcileBatchand every FactSink submission β goes throughReconcile, so the removal is booked there from the writer'sout.Removed. No other issue write path insrc/pkg/github/src/pkg/stageengineremoves the label:Decision.ClearβDesired.Clearis only applied bystageWriter.Apply, which is only called fromReconcile(ADR-0025 admission test). The marker-gated reporter-trust remover (reporter_trust_wait.go) is unchanged and out of scope.settleTriageClear/triageClearAllowed(issue_stage_labels.go): label absent β nothing; yielded β leave it; removed once and back now β mark yielded + one INFO log (repo,issue,label) + leave it; otherwise β remove. Used by both:issueHasLabelcheck), which also carries the result on the pending facts;enrichTriageClearYield, afterenrichCoveringPR), on the fresh labels, so a sink submission that is first to see the label back books the yield itself.IssueFacts.TriageClearYielded;issueTriageClearreturns nil when it is set.triageAwaitingLabelso the separatereporter_trust.awaiting_labelfix only has to change that variable.SettlesTriage,Planownership and the reporter-trust gate are untouched.reference.mdreporter-trust paragraph,stage-labels.md015 row ands015 --> s020edge,activity-monitor.mdstale-label sentence. Changelog:changelog.d/fixed-18387-needs-triage-relabel-loop.md.Tests (CI runs them; per AGENTS.md only
gofmt -lwas run locally β clean)TestSyncIssueStageLabels_NeedsTriageReAddedIsLeftOn: a 020 and a 040 issue; pass 1 removes once, pass 2 (label re-added) yields + logs once per issue, pass 3 no change, storeSave/Loadrestart β still no removal, then a 020 β 030 write on the yielded issue still lands without removing the label.TestDeriveIssueClearsStaleTriageLabelPastClaim: yielded cases at 040 and 020 βClearempty.TestStoreTriageClearYieldSurvivesRestart: fields round-trip throughSave/Load, mark-once semantics, kept across a stage move.TestSyncIssueStageLabels_ClaimClearsNeedsTriageis unchanged.Fixes #18387
β hive: backend=omp model=anthropic/claude-opus-5-5