From 7d4ee65f5942179be0bd3ade4c96ad327d5a63e2 Mon Sep 17 00:00:00 2001 From: Andrew Anderson Date: Wed, 4 Nov 2026 08:14:55 -0500 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=90=9B=20Activity=20Monitor:=20person?= =?UTF-8?q?-owed=20PR=20steps=20light=20PR=20in=20progress,=20not=20Merge?= =?UTF-8?q?=20queue?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A PR parked at 085 because a person has to act on the PR itself (rerun CI, approve workflow runs, resolve a GitHub permission, answer review findings or red checks still open on its head) is not queued, merging or merge-ready. Its chevron now lights PR in progress — "Waiting for @who · rerun shared ci on GitHub", person icon kept — and the Merge queue column stays empty. Only rows actually queued / merging / merged, or a merge-ready PR (review approved, CI green) parked on a merge decision, sit in Merge queue. A bare 085 with no track evidence keeps the gate (#14821). - stageTrackerItemColumn (Go) / stageTrackerAnchor (JS): new stageTrackerPersonActsOnPR predicate, mirrored on both sides. - Unauthorized word/caption: "Waiting for @author · on GitHub" (a hive / bot / clanker author yields "a maintainer"). - Nested PR rows carry unauthorized_step so the word matches. - Tests: Go table (#16524 shape and its twins) + rows fixture. Fixes #16592 Signed-off-by: Andrew Anderson --- changelog.d/fixed-awaiting-rerun-lane.md | 1 + src/pkg/dashboard/stage_tracker.go | 9 ++- src/pkg/dashboard/stage_tracker_caption.go | 6 +- .../stage_tracker_item_column_test.go | 59 +++++++++++++++++++ src/pkg/dashboard/stage_tracker_links.go | 1 + .../stage_tracker_sentinel_lane_test.go | 3 + .../dashboard/stage_tracker_ui_rows_test.go | 36 +++++++++++ .../stage_tracker_unauthorized_test.go | 8 ++- src/pkg/dashboard/stage_tracker_vocabulary.go | 48 +++++++++++++++ .../static-src/js/tracker-row-anchor.js | 4 ++ .../static-src/js/tracker-row-layout.js | 2 +- .../static-src/js/tracker-row-render.js | 2 +- .../static-src/js/tracker-words-core.js | 38 +++++++++++- src/pkg/dashboard/static/index.html | 46 +++++++++++++-- 14 files changed, 247 insertions(+), 16 deletions(-) create mode 100644 changelog.d/fixed-awaiting-rerun-lane.md diff --git a/changelog.d/fixed-awaiting-rerun-lane.md b/changelog.d/fixed-awaiting-rerun-lane.md new file mode 100644 index 0000000000..c5c62ca884 --- /dev/null +++ b/changelog.d/fixed-awaiting-rerun-lane.md @@ -0,0 +1 @@ +- Activity Monitor: a PR parked on a person who must act on the PR itself (rerun CI, approve workflow runs, resolve a GitHub permission, answer open review findings) now lights the PR in progress chevron — "Waiting for @who · rerun shared ci on GitHub" — and leaves the Merge queue column empty; only rows actually queued / merging, or a merge-ready PR parked on a merge decision, sit in Merge queue. diff --git a/src/pkg/dashboard/stage_tracker.go b/src/pkg/dashboard/stage_tracker.go index bad434321b..e80b8b9a44 100644 --- a/src/pkg/dashboard/stage_tracker.go +++ b/src/pkg/dashboard/stage_tracker.go @@ -487,9 +487,9 @@ type StageTrackerItem struct { // UnauthorizedStep is set when the item wears hive:unauthorized: the // step the hive's GitHub App is not permitted to take, in words // ("approve workflow runs"), from the `unauthorized:` stage - // reason; the gate cell reads "Awaiting human: ". Unauthorized - // is the pill's tooltip naming the permission and the human action - // (hivecommons/hive#14589). + // reason; the PR in progress chevron reads "Waiting for @who · + // on GitHub" (hive#16524). Unauthorized is the pill's tooltip naming + // the permission and the human action (hivecommons/hive#14589). UnauthorizedStep string `json:"unauthorized_step,omitempty"` Unauthorized string `json:"unauthorized,omitempty"` // DecisionNeeded is set on a row parked on a person (085 / 045 / 015, @@ -709,6 +709,9 @@ type StageTrackerLinkedPR struct { Stage int `json:"stage,omitempty"` StageSince *time.Time `json:"stage_since,omitempty"` Caption string `json:"caption,omitempty"` + // UnauthorizedStep mirrors the PR's own field so the nested chevron + // reads "Waiting for @who · on GitHub" too (hive#16524). + UnauthorizedStep string `json:"unauthorized_step,omitempty"` // NoteChangedAt mirrors the PR row's: when the caption last changed // meaning. NoteChangedAt *time.Time `json:"note_changed_at,omitempty"` diff --git a/src/pkg/dashboard/stage_tracker_caption.go b/src/pkg/dashboard/stage_tracker_caption.go index acb7557205..9ab5b632b6 100644 --- a/src/pkg/dashboard/stage_tracker_caption.go +++ b/src/pkg/dashboard/stage_tracker_caption.go @@ -840,8 +840,10 @@ func stageTrackerCaption(stage stagelabels.Stage, reason, author string, kind st } if step, _ := stageTrackerUnauthorized(reason); step != "" { // hivecommons/hive#14589: not a decision but a step only a - // person may take; the gate cell says the same. - return joinClause("Awaiting human: "+step, clause), "maintainer" + // person may take; the PR in progress chevron says the same + // (hive#16524: it is the person's move on the PR, not a + // merge-queue matter). + return joinClause("Waiting for a maintainer · "+step+" on GitHub", clause), "maintainer" } if c := stageTrackerMergeTrainCaption(reason); c != "" { return c, "maintainer" diff --git a/src/pkg/dashboard/stage_tracker_item_column_test.go b/src/pkg/dashboard/stage_tracker_item_column_test.go index 5713be02bc..999ae23049 100644 --- a/src/pkg/dashboard/stage_tracker_item_column_test.go +++ b/src/pkg/dashboard/stage_tracker_item_column_test.go @@ -139,3 +139,62 @@ func TestStageTrackerFixingAfterMergeFailedColumn(t *testing.T) { t.Fatalf("linked_prs payload lacks left_train:\n%s", raw) } } + +// TestStageTrackerPersonActsOnPRColumn replays hive's own #16524: a PR +// parked at 085 under hive:unauthorized (a maintainer must rerun shared +// CI on GitHub) with CI unknown and review findings open. The ask is a +// person's move ON THE PR, so its chevron is PR in progress and the +// Merge queue column is empty — the gate is only for rows queued / +// merging / merged, or a merge-ready PR parked on a merge decision. +func TestStageTrackerPersonActsOnPRColumn(t *testing.T) { + head := "7879a51f276a0f9aa5adc995d9d09a74487bbcf4" + ci := func(state string) *StageTrackerActivity { return &StageTrackerActivity{Head: head, State: state} } + review := func(state string) *StageTrackerActivity { return &StageTrackerActivity{Head: head, State: state} } + live := func() StageTrackerItem { + return StageTrackerItem{Repo: "hivecommons/hive", Number: 16524, Kind: "pr", Stage: stagelabels.NeedsDecision.Number(), Head: head, + Reason: "unauthorized:rerun-shared-ci", UnauthorizedStep: "rerun shared ci", + CIActivity: ci("unknown"), ReviewActivity: review("changes_requested")} + } + cases := []struct { + name string + mut func(*StageTrackerItem) + want int + }{ + {"#16524 as served", func(*StageTrackerItem) {}, trackerColumnPR}, + {"unauthorized step, no track evidence", func(it *StageTrackerItem) { it.CIActivity, it.ReviewActivity = nil, nil }, trackerColumnPR}, + {"unauthorized step on a merge-ready head", func(it *StageTrackerItem) { it.CIActivity, it.ReviewActivity = ci("passing"), review("approved") }, trackerColumnMergeGate}, + {"decision with review findings open", func(it *StageTrackerItem) { it.Reason, it.UnauthorizedStep = "", "" }, trackerColumnPR}, + {"decision with CI red, review approved", func(it *StageTrackerItem) { + it.Reason, it.UnauthorizedStep, it.CIActivity, it.ReviewActivity = "", "", ci("failing"), review("approved") + }, trackerColumnPR}, + {"bare 085 decision keeps the gate (#14821)", func(it *StageTrackerItem) { + it.Reason, it.UnauthorizedStep, it.CIActivity, it.ReviewActivity = "", "", nil, nil + }, trackerColumnMergeGate}, + {"merge-ready decision keeps the gate", func(it *StageTrackerItem) { + it.Reason, it.UnauthorizedStep, it.CIActivity, it.ReviewActivity = "", "", ci("passing"), review("approved") + }, trackerColumnMergeGate}, + {"stale track evidence on another head is not evidence", func(it *StageTrackerItem) { + it.Reason, it.UnauthorizedStep = "", "" + it.CIActivity.Head, it.ReviewActivity.Head = "old", "old" + }, trackerColumnMergeGate}, + {"a seated train member is a Merge queue matter", func(it *StageTrackerItem) { + it.MergeTrain = &StageTrackerMergeTrain{ID: "v5#1", State: MergeGateStateQueuedBehind, Front: 1, Position: 2, Size: 2} + }, trackerColumnMergeGate}, + {"a live merge attempt is a Merge queue matter", func(it *StageTrackerItem) { it.MergeGate = &StageTrackerMergeGate{State: MergeGateStateMerging} }, trackerColumnMergeGate}, + {"an issue at 085 is unchanged", func(it *StageTrackerItem) { it.Kind = "issue" }, stageTrackerColumn(stagelabels.NeedsDecision)}, + {"070 fixing is untouched", func(it *StageTrackerItem) { it.Stage = stagelabels.Fixing.Number() }, trackerColumnReview}, + } + for _, tc := range cases { + it := live() + tc.mut(&it) + if got := stageTrackerItemColumn(&it); got != tc.want { + t.Errorf("%s: column %d, want %d", tc.name, got, tc.want) + } + } + // The caption names the step as the person's move on GitHub, never as + // a merge-queue wait. + caption, actor := stageTrackerCaption(stagelabels.NeedsDecision, "unauthorized:rerun-shared-ci", "clubanderson", "pr", false, stagelabels.Record{}, false, 0, head) + if !strings.Contains(caption, "Waiting for a maintainer · rerun shared ci on GitHub") || strings.Contains(caption, "Awaiting human") || actor != "maintainer" { + t.Fatalf("caption %q actor %q", caption, actor) + } +} diff --git a/src/pkg/dashboard/stage_tracker_links.go b/src/pkg/dashboard/stage_tracker_links.go index 68761b3bd5..08ddf3d1c1 100644 --- a/src/pkg/dashboard/stage_tracker_links.go +++ b/src/pkg/dashboard/stage_tracker_links.go @@ -338,6 +338,7 @@ func stageTrackerResolveLinkedPRs(items []StageTrackerItem, open func(repo strin lp.AdmittedBy, lp.DCOUnsigned, lp.DCOTotal = pr.AdmittedBy, pr.DCOUnsigned, pr.DCOTotal lp.BaseRef = pr.BaseRef lp.DecisionNeeded = pr.DecisionNeeded + lp.UnauthorizedStep = pr.UnauthorizedStep lp.SoakRemainingSeconds, lp.MergeGate = pr.SoakRemainingSeconds, pr.MergeGate lp.MergeTrain, lp.LeftTrain, lp.Overlap = pr.MergeTrain, pr.LeftTrain, pr.Overlap lp.Preparation = pr.Preparation diff --git a/src/pkg/dashboard/stage_tracker_sentinel_lane_test.go b/src/pkg/dashboard/stage_tracker_sentinel_lane_test.go index 6f50d99382..ceaed9594d 100644 --- a/src/pkg/dashboard/stage_tracker_sentinel_lane_test.go +++ b/src/pkg/dashboard/stage_tracker_sentinel_lane_test.go @@ -54,7 +54,10 @@ func stageTrackerManualMergeJS(t *testing.T, html string) string { jsFunc(t, html, "stageTrackerReadyForHumanWord"), jsConstLine(t, html, "STAGE_TRACKER_HUMAN_GATED"), jsConstLine(t, html, "STAGE_TRACKER_UNAUTHORIZED_WORD"), + jsConstLine(t, html, "STAGE_TRACKER_UNAUTHORIZED_WHERE"), + jsFunc(t, html, "stageTrackerUnauthorizedWho"), jsFunc(t, html, "stageTrackerUnauthorizedWord"), + jsFunc(t, html, "stageTrackerPersonActsOnPR"), jsConstLine(t, html, "STAGE_TRACKER_ADOPTED_BY_HIVE"), jsFunc(t, html, "stageTrackerAdoptedWord"), }, "\n") diff --git a/src/pkg/dashboard/stage_tracker_ui_rows_test.go b/src/pkg/dashboard/stage_tracker_ui_rows_test.go index 4b5a77ea37..efee6c4dc9 100644 --- a/src/pkg/dashboard/stage_tracker_ui_rows_test.go +++ b/src/pkg/dashboard/stage_tracker_ui_rows_test.go @@ -727,6 +727,42 @@ assert.ok(/[^<]*<\/span>/.test(row) && !/ assert.ok(!/ham-track-verdict">]*>[\s\S]*?<\/svg>(?:CI|Review) /.test(changes), 'settled verdicts carry no words beside the glyph: ' + changes); assert.ok(/
  • Object.assign({ repo: 'hivecommons/hive', number: 16524, kind: 'pr', stage: 85, head, author: 'clubanderson', author_kind: 'human', modifiers: ['unauthorized'], + reason: 'unauthorized:rerun-shared-ci', unauthorized_step: 'rerun shared ci', unauthorized: "The hive's GitHub App lacks the permission to rerun shared ci, so only a person can take that step.", + caption: 'Waiting for a maintainer · rerun shared ci on GitHub — the hive\'s GitHub App is not permitted to rerun shared ci; a maintainer must', decision_needed: ask, + human_attention: { number: 16524, kind: 'pr', head, reason: ask.question, asked_by: 'GitHub permissions' }, + ci_activity: { head, state: 'unknown', caption: 'CI unknown · no check results observed for this head yet', checks_passed: 34, checks_total: 42, checks_failed: 1, source: 'github-graphql-cache+required-branch', observed_at: seen }, + review_activity: { head, state: 'changes_requested', caption: 'Review findings · awaiting author', perspectives_done: 5, perspectives_total: 5, source: 'verified-review-bundle', observed_at: seen, since: seen } }, extra || {}); + const rerun = stageTrackerRowHtml(shape(), stages, ctx); + assert.strictEqual(stageTrackerAnchor(85, stages, 'pr', shape()), 30, 'the ask is the person\'s move on the PR: PR in progress'); + assert.deepStrictEqual(segStates(rerun), [D, D, D, 'active detoured', T, T, 'todo cap'], 'PR in progress lit, Merge queue empty: ' + strip(rerun)); + assert.ok(rerun.includes('Waiting for @clubanderson · rerun shared ci on GitHub'), 'the chevron names the person and the step: ' + strip(rerun)); + assert.ok(!/
  • ]*>[\s\S]*?Awaiting human/.test(strip(rerun)), 'no "Awaiting human" chevron: ' + strip(rerun)); + const litSeg = /
  • ]*>([\s\S]*?)<\/li>/.exec(strip(rerun)); + assert.ok(litSeg && litSeg[1].includes('ham-actor-ico'), 'the person icon stays on the lit chevron: ' + strip(rerun)); + const mergeSeg = Array.from(strip(rerun).matchAll(/
  • ]*>([\s\S]*?)<\/li>/g)).filter(m => !m[1].includes('ham-activity-track') && !m[1].includes('ham-head'))[4]; + assert.ok(mergeSeg && mergeSeg[1] === 'todo' && !/ham-chevron-copy/.test(mergeSeg[2]), 'the merge-queue chevron carries no words: ' + mergeSeg[0]); + assert.strictEqual(litChevrons(strip(rerun)), 1, 'one lit chevron: ' + strip(rerun)); + // Merge-ready (approved + CI green) or queued twins are merge matters: the gate keeps them. + const ready = shape({ ci_activity: { head, state: 'passing', caption: 'CI green', checks_passed: 42, checks_total: 42, source: 'checks', observed_at: seen }, review_activity: { head, state: 'approved', caption: 'Review approved', perspectives_done: 5, perspectives_total: 5, source: 'verified-review-bundle', observed_at: seen } }); + assert.strictEqual(stageTrackerAnchor(85, stages, 'pr', ready), 80, 'merge-ready 085 keeps the gate'); + assert.strictEqual(stageTrackerAnchor(85, stages, 'pr', shape({ merge_train: { id: 'v5#1', state: 'queued-behind', front: 1, position: 2, size: 2 } })), 80, 'a train member keeps the gate'); + // A bare 085 decision (no track evidence, no step) still decides at the gate (#14821). + assert.strictEqual(stageTrackerAnchor(85, stages, 'pr', { kind: 'pr', stage: 85, caption: 'decision requested' }), 80); + // A nested PR under its issue follows the same column. + const nested = stageTrackerRowHtml({ repo: 'hivecommons/hive', number: 16500, kind: 'issue', stage: 40, linked_prs: [shape()] }, stages, ctx); + assert.ok(nested.includes('Waiting for @clubanderson · rerun shared ci on GitHub'), 'nested PR carries the word: ' + nested); +} // Merged: the lit cap is the only chevron with hover text. row = stageTrackerRowHtml({ repo: 'acme/console', number: 106, kind: 'pr', stage: 110 }, stages, ctx); assert.ok(/
  • /.test(row) && titled(strip(row)).length === 1, row); diff --git a/src/pkg/dashboard/stage_tracker_unauthorized_test.go b/src/pkg/dashboard/stage_tracker_unauthorized_test.go index b44913ccfc..2fd5d63a1f 100644 --- a/src/pkg/dashboard/stage_tracker_unauthorized_test.go +++ b/src/pkg/dashboard/stage_tracker_unauthorized_test.go @@ -66,7 +66,7 @@ func TestStageTrackerUnauthorizedPayload(t *testing.T) { if it.Stage != 85 || !hasMod(it, modUnauthorized) || it.UnauthorizedStep != "approve workflow runs" || !strings.Contains(it.Unauthorized, "`actions: write`") { t.Fatalf("row = stage %d mods %v step %q tip %q", it.Stage, it.Modifiers, it.UnauthorizedStep, it.Unauthorized) } - if !strings.Contains(it.Caption, "not permitted to approve workflow runs") || it.Actor != "maintainer" { + if !strings.HasPrefix(it.Caption, "Waiting for a maintainer · approve workflow runs on GitHub") || !strings.Contains(it.Caption, "not permitted to approve workflow runs") || it.Actor != "maintainer" { t.Fatalf("caption %q actor %q", it.Caption, it.Actor) } raw, err := json.Marshal(it) @@ -82,7 +82,7 @@ func TestStageTrackerUnauthorizedPayload(t *testing.T) { } // The frontend: the pill is muted and explains itself on hover, it counts -// under Needs attention, and the 085 chevron reads "Awaiting human: ". +// under Needs attention, and the 085 chevron reads "Waiting for @who · on GitHub". func TestStageTrackerUnauthorizedJS(t *testing.T) { html := indexHTML(t) for _, want := range []string{ @@ -129,7 +129,9 @@ assert.ok(stageTrackerNeedsAttention(item)); assert.ok(stageTrackerChipsHtml({ stage: 85, modifiers: ['needs-decision', 'unauthorized'] }).includes('>unauthorized +1<')); assert.ok(stageTrackerChipsHtml({ stage: 10, modifiers: ['unauthorized', 'hold'] }).includes('>hold +1<')); // The 085 chevron names the human step owed; without a step the generic word stays. -assert.strictEqual(stageTrackerUnauthorizedWord(item), 'Awaiting human: approve workflow runs'); +assert.strictEqual(stageTrackerUnauthorizedWord(item), 'Waiting for a maintainer · approve workflow runs on GitHub'); +assert.strictEqual(stageTrackerUnauthorizedWord(Object.assign({ author: 'clubanderson', author_kind: 'human' }, item)), 'Waiting for @clubanderson · approve workflow runs on GitHub'); +assert.strictEqual(stageTrackerUnauthorizedWord(Object.assign({ author: 'hive-bot', author_kind: 'hive' }, item)), 'Waiting for a maintainer · approve workflow runs on GitHub'); assert.strictEqual(stageTrackerUnauthorizedWord({ stage: 85, modifiers: ['unauthorized'] }), ''); assert.strictEqual(STAGE_TRACKER_HUMAN_GATED, 85); ` diff --git a/src/pkg/dashboard/stage_tracker_vocabulary.go b/src/pkg/dashboard/stage_tracker_vocabulary.go index 4524795e2c..4d33e60cff 100644 --- a/src/pkg/dashboard/stage_tracker_vocabulary.go +++ b/src/pkg/dashboard/stage_tracker_vocabulary.go @@ -88,9 +88,57 @@ func stageTrackerItemColumn(it *StageTrackerItem) int { return trackerColumnMergeGate } } + if stageTrackerPersonActsOnPR(it) { + return trackerColumnPR + } return stageTrackerColumn(st) } +// stageTrackerPersonActsOnPR: a PR parked at 085 because a person has to +// act ON THE PR — rerun CI, approve workflow runs, resolve a permission +// (reason `unauthorized:`), or answer review findings / red checks +// still open on its head — is not queued, merging or merge-ready, so its +// chevron lights PR in progress, never Merge queue. The Merge queue +// column is only for rows actually queued / merging / merged, or a +// merge-ready PR (review approved, CI green) parked on a merge decision. +// A bare 085 with no track evidence keeps the gate: the person decides +// there (hive#14821). Hive's own #16524 read "Awaiting human: rerun +// shared ci" under Merge queue with CI unknown and review findings open. +func stageTrackerPersonActsOnPR(it *StageTrackerItem) bool { + if it == nil || it.Kind != "pr" || stageByNumber(it.Stage) != stagelabels.NeedsDecision { + return false + } + if mg := it.MergeGate; mg != nil && mg.State != "" { + return false + } + if mt := it.MergeTrain; mt != nil && mt.State != "" { + return false + } + if step, _ := stageTrackerUnauthorized(it.Reason); step != "" { + return !stageTrackerMergeReadyEvidence(it) + } + return stageTrackerNotMergeReadyEvidence(it) +} + +func stageTrackerActivityOnHead(it *StageTrackerItem, a *StageTrackerActivity) bool { + return a != nil && (a.Head == "" || it.Head == "" || strings.EqualFold(a.Head, it.Head)) +} + +// stageTrackerMergeReadyEvidence: review approved and CI green on the +// row's current head — the only state in which a human-gated PR may sit +// in the Merge queue column. +func stageTrackerMergeReadyEvidence(it *StageTrackerItem) bool { + return stageTrackerActivityOnHead(it, it.ReviewActivity) && it.ReviewActivity.State == "approved" && + stageTrackerActivityOnHead(it, it.CIActivity) && it.CIActivity.State == "passing" +} + +// stageTrackerNotMergeReadyEvidence: a track on the current head says the +// PR is short of merge-ready (review not approved, CI not green). +func stageTrackerNotMergeReadyEvidence(it *StageTrackerItem) bool { + return (stageTrackerActivityOnHead(it, it.ReviewActivity) && it.ReviewActivity.State != "approved") || + (stageTrackerActivityOnHead(it, it.CIActivity) && it.CIActivity.State != "passing") +} + // stageTrackerStagePhrase is the stage as a lowercase clause for the // middle of a sentence ("its PR is reviewed · waiting for merge // admission"), from the same words the chevron shows. diff --git a/src/pkg/dashboard/static-src/js/tracker-row-anchor.js b/src/pkg/dashboard/static-src/js/tracker-row-anchor.js index 807d3c153e..f91cfd897b 100644 --- a/src/pkg/dashboard/static-src/js/tracker-row-anchor.js +++ b/src/pkg/dashboard/static-src/js/tracker-row-anchor.js @@ -44,6 +44,10 @@ // sits at 050/070, and hive's own #15400 ("1st") lit CI / Review // next to its 2nd-place sibling in Merge queue (hivecommons/hive#15395). if (item && item.merge_train && item.merge_train.state && cur > STAGE_TRACKER_PR_COLUMN) return STAGE_TRACKER_MERGE_COLUMN; + // A person owes a step on the PR itself (085 under hive:unauthorized, + // not merge-ready): PR in progress, with the merge-queue chevron + // empty (hivecommons/hive#16524). + if (kind === 'pr' && typeof stageTrackerPersonActsOnPR === 'function' && stageTrackerPersonActsOnPR(item)) return STAGE_TRACKER_PR_COLUMN; if (cur === STAGE_TRACKER_ISSUE_NEEDS_DECISION || cur === STAGE_TRACKER_TRIAGE_NEEDED || cur === STAGE_TRACKER_POSSIBLY_EXISTS) return STAGE_TRACKER_ISSUE_DECISION_COLUMN; if (cur === STAGE_TRACKER_NEEDS_DECISION && kind === 'issue') return STAGE_TRACKER_ISSUE_DECISION_COLUMN; if (STAGE_TRACKER_PATH.indexOf(cur) >= 0) return cur; diff --git a/src/pkg/dashboard/static-src/js/tracker-row-layout.js b/src/pkg/dashboard/static-src/js/tracker-row-layout.js index 3d887e7022..74dc0a970b 100644 --- a/src/pkg/dashboard/static-src/js/tracker-row-layout.js +++ b/src/pkg/dashboard/static-src/js/tracker-row-layout.js @@ -73,7 +73,7 @@ ci_activity: lp.ci_activity || null, review_activity: lp.review_activity || null, code_activity: lp.code_activity || null, display_column: lp.display_column || 0, state: lp.state || '', terminal_merge: !!lp.terminal_merge, merged_by: lp.merged_by || '', stage: lp.stage || 0, stage_since: lp.stage_since || '', stage_slug: lp.stage_slug || '', modifiers: lp.modifiers || [], deferred_modifiers: lp.deferred_modifiers || [], caption: lp.caption || '', reason: lp.reason || '', preparation: lp.preparation || null, human_attention: lp.human_attention || null, - human_approver: lp.human_approver || '', manual_merge: !!lp.manual_merge, human_merge_reason: lp.human_merge_reason || '', human_merge_reason_text: lp.human_merge_reason_text || '', sentinel_alert: !!lp.sentinel_alert, sentinel_reason: lp.sentinel_reason || '', sentinel_details: lp.sentinel_details || [], sentinel_notice: !!lp.sentinel_notice, head: lp.head || '', base_ref: lp.base_ref || '', decision_needed: lp.decision_needed || null, + human_approver: lp.human_approver || '', manual_merge: !!lp.manual_merge, human_merge_reason: lp.human_merge_reason || '', human_merge_reason_text: lp.human_merge_reason_text || '', sentinel_alert: !!lp.sentinel_alert, sentinel_reason: lp.sentinel_reason || '', sentinel_details: lp.sentinel_details || [], sentinel_notice: !!lp.sentinel_notice, head: lp.head || '', base_ref: lp.base_ref || '', decision_needed: lp.decision_needed || null, unauthorized_step: lp.unauthorized_step || '', adoption: lp.adoption || null, takeover: lp.takeover || null, superseded: !!lp.superseded, supersedes: lp.supersedes || null, parent: Number(issue.number) || 0, siblings: open.map(x => Number(x.number) || 0), last_operator_action: lp.last_operator_action || null, operator_action_count: lp.operator_action_count || 0, hold: lp.hold || null, stage_actor: lp.stage_actor || null, claimant: lp.claimant || null, presence: lp.presence || null, rework: lp.rework || null, push: lp.push || null, merge_gate: lp.merge_gate || null, merge_train: lp.merge_train || null, left_train: lp.left_train || null, overlap: lp.overlap || null, decided: lp.decided || null, adopted_by: Number(lp.adopted_by) || 0, adopted_by_state: lp.adopted_by_state || '', adopted_from: lp.adopted_from || null, lineage: lp.lineage || null, state: lp.state || '', superseded_by: Number(lp.superseded_by) || 0 }; diff --git a/src/pkg/dashboard/static-src/js/tracker-row-render.js b/src/pkg/dashboard/static-src/js/tracker-row-render.js index 5fd920f7a2..6c3b367f0c 100644 --- a/src/pkg/dashboard/static-src/js/tracker-row-render.js +++ b/src/pkg/dashboard/static-src/js/tracker-row-render.js @@ -107,7 +107,7 @@ shown = Object.assign({}, item, { via_pr: true, stage: stageTrackerLeadStage(lp), stage_since: lp.stage_since || item.stage_since, modifiers: lp.modifiers || item.modifiers, deferred_modifiers: lp.deferred_modifiers || item.deferred_modifiers || [], caption: lp.caption || item.caption, reason: lp.reason || item.reason, preparation: lp.preparation || null, ci_activity: lp.ci_activity || null, review_activity: lp.review_activity || null, code_activity: lp.code_activity || null, display_column: lp.display_column || 0, terminal_merge: !!lp.terminal_merge, merged_by: lp.merged_by || '', - human_approver: lp.human_approver || '', manual_merge: !!lp.manual_merge, human_merge_reason: lp.human_merge_reason || '', human_merge_reason_text: lp.human_merge_reason_text || '', sentinel_alert: !!lp.sentinel_alert, sentinel_reason: lp.sentinel_reason || '', sentinel_details: lp.sentinel_details || [], sentinel_notice: !!lp.sentinel_notice, head: lp.head || '', decision_needed: lp.decision_needed || null, hold: lp.hold || null, adoption: lp.adoption || null, stage_actor: lp.stage_actor || item.stage_actor || null, claimant: lp.claimant || null, presence: lp.presence || null, rework: lp.rework || null, push: lp.push || null, merge_gate: lp.merge_gate || null, merge_train: lp.merge_train || null, left_train: lp.left_train || null, overlap: lp.overlap || null, decided: lp.decided || item.decided || null }); + human_approver: lp.human_approver || '', manual_merge: !!lp.manual_merge, human_merge_reason: lp.human_merge_reason || '', human_merge_reason_text: lp.human_merge_reason_text || '', sentinel_alert: !!lp.sentinel_alert, sentinel_reason: lp.sentinel_reason || '', sentinel_details: lp.sentinel_details || [], sentinel_notice: !!lp.sentinel_notice, head: lp.head || '', decision_needed: lp.decision_needed || null, unauthorized_step: lp.unauthorized_step || '', hold: lp.hold || null, adoption: lp.adoption || null, stage_actor: lp.stage_actor || item.stage_actor || null, claimant: lp.claimant || null, presence: lp.presence || null, rework: lp.rework || null, push: lp.push || null, merge_gate: lp.merge_gate || null, merge_train: lp.merge_train || null, left_train: lp.left_train || null, overlap: lp.overlap || null, decided: lp.decided || item.decided || null }); } else if (linked.length) { // Several covering PRs: the issue strip ends at Claimed, all passed // and nothing lit; one sub-row per PR carries the live chevron. diff --git a/src/pkg/dashboard/static-src/js/tracker-words-core.js b/src/pkg/dashboard/static-src/js/tracker-words-core.js index aa6e6a4372..f4eb979adf 100644 --- a/src/pkg/dashboard/static-src/js/tracker-words-core.js +++ b/src/pkg/dashboard/static-src/js/tracker-words-core.js @@ -40,10 +40,44 @@ if (state === 'resolving-conflicts') return 'Adopting · fixer resolving conflicts'; return 'Adopted → #' + by; } - const STAGE_TRACKER_UNAUTHORIZED_WORD = 'Awaiting human'; + // "Waiting for @clubanderson · rerun shared ci on GitHub": the person + // owed the step is named when the author is one (a hive / bot / clanker + // author cannot grant the permission; a maintainer is asked instead). + const STAGE_TRACKER_UNAUTHORIZED_WORD = 'Waiting for'; + const STAGE_TRACKER_UNAUTHORIZED_WHERE = 'on GitHub'; + function stageTrackerUnauthorizedWho(item) { + // An issue row drawn on its one covering PR names that PR's author. + const linked = item && item.via_pr && Array.isArray(item.linked_prs) ? item.linked_prs.filter(lp => lp && String(lp.unauthorized_step || '').trim()) : []; + const src = linked.length === 1 ? linked[0] : item; + const author = String((src && src.author) || '').trim().replace(/^@/, ''); + const kind = String((src && src.author_kind) || ''); + if (author && kind !== 'hive' && kind !== 'bot' && kind !== 'clanker') return '@' + author; + return 'a maintainer'; + } function stageTrackerUnauthorizedWord(item) { const step = String((item && item.unauthorized_step) || '').trim(); - return step ? STAGE_TRACKER_UNAUTHORIZED_WORD + ': ' + step : ''; + return step ? STAGE_TRACKER_UNAUTHORIZED_WORD + ' ' + stageTrackerUnauthorizedWho(item) + ' · ' + step + ' ' + STAGE_TRACKER_UNAUTHORIZED_WHERE : ''; + } + // A PR parked at 085 because a person has to act ON THE PR (rerun CI, + // approve workflow runs, resolve a permission, answer review findings + // or red checks still open on its head) is not queued, merging or + // merge-ready: it lights PR in progress, never Merge queue. Merge + // queue is only for rows actually queued / merging / merged, or a + // merge-ready PR (review approved, CI green on this head) parked on a + // merge decision. A bare 085 with no track evidence keeps the gate: + // the person decides there (hive#14821). Hive's own #16524 read + // "Awaiting human: rerun shared ci" under Merge queue with CI unknown + // and review findings open. Mirrors stageTrackerPersonActsOnPR in Go. + function stageTrackerPersonActsOnPR(item) { + if (!item || (item.via_pr ? 'pr' : item.kind) !== 'pr' || Number(item.stage) !== STAGE_TRACKER_HUMAN_GATED) return false; + if (item.merge_gate && item.merge_gate.state) return false; + if (item.merge_train && item.merge_train.state) return false; + const onHead = a => !!a && (!a.head || !item.head || String(a.head) === String(item.head)); + const review = onHead(item.review_activity) ? item.review_activity : null; + const ci = onHead(item.ci_activity) ? item.ci_activity : null; + const mergeReady = !!(review && review.state === 'approved' && ci && ci.state === 'passing'); + if (String(item.unauthorized_step || '').trim()) return !mergeReady; + return !!((review && review.state !== 'approved') || (ci && ci.state !== 'passing')); } // A parked issue with a structured blocker (item.blocker, #15099) reads // "Blocked · App lacks workflows permission", never "Needs human diff --git a/src/pkg/dashboard/static/index.html b/src/pkg/dashboard/static/index.html index 1e9f8c1bf2..c478b3f7cd 100644 --- a/src/pkg/dashboard/static/index.html +++ b/src/pkg/dashboard/static/index.html @@ -15755,10 +15755,44 @@

    Where to get help

    if (state === 'resolving-conflicts') return 'Adopting · fixer resolving conflicts'; return 'Adopted → #' + by; } - const STAGE_TRACKER_UNAUTHORIZED_WORD = 'Awaiting human'; + // "Waiting for @clubanderson · rerun shared ci on GitHub": the person + // owed the step is named when the author is one (a hive / bot / clanker + // author cannot grant the permission; a maintainer is asked instead). + const STAGE_TRACKER_UNAUTHORIZED_WORD = 'Waiting for'; + const STAGE_TRACKER_UNAUTHORIZED_WHERE = 'on GitHub'; + function stageTrackerUnauthorizedWho(item) { + // An issue row drawn on its one covering PR names that PR's author. + const linked = item && item.via_pr && Array.isArray(item.linked_prs) ? item.linked_prs.filter(lp => lp && String(lp.unauthorized_step || '').trim()) : []; + const src = linked.length === 1 ? linked[0] : item; + const author = String((src && src.author) || '').trim().replace(/^@/, ''); + const kind = String((src && src.author_kind) || ''); + if (author && kind !== 'hive' && kind !== 'bot' && kind !== 'clanker') return '@' + author; + return 'a maintainer'; + } function stageTrackerUnauthorizedWord(item) { const step = String((item && item.unauthorized_step) || '').trim(); - return step ? STAGE_TRACKER_UNAUTHORIZED_WORD + ': ' + step : ''; + return step ? STAGE_TRACKER_UNAUTHORIZED_WORD + ' ' + stageTrackerUnauthorizedWho(item) + ' · ' + step + ' ' + STAGE_TRACKER_UNAUTHORIZED_WHERE : ''; + } + // A PR parked at 085 because a person has to act ON THE PR (rerun CI, + // approve workflow runs, resolve a permission, answer review findings + // or red checks still open on its head) is not queued, merging or + // merge-ready: it lights PR in progress, never Merge queue. Merge + // queue is only for rows actually queued / merging / merged, or a + // merge-ready PR (review approved, CI green on this head) parked on a + // merge decision. A bare 085 with no track evidence keeps the gate: + // the person decides there (hive#14821). Hive's own #16524 read + // "Awaiting human: rerun shared ci" under Merge queue with CI unknown + // and review findings open. Mirrors stageTrackerPersonActsOnPR in Go. + function stageTrackerPersonActsOnPR(item) { + if (!item || (item.via_pr ? 'pr' : item.kind) !== 'pr' || Number(item.stage) !== STAGE_TRACKER_HUMAN_GATED) return false; + if (item.merge_gate && item.merge_gate.state) return false; + if (item.merge_train && item.merge_train.state) return false; + const onHead = a => !!a && (!a.head || !item.head || String(a.head) === String(item.head)); + const review = onHead(item.review_activity) ? item.review_activity : null; + const ci = onHead(item.ci_activity) ? item.ci_activity : null; + const mergeReady = !!(review && review.state === 'approved' && ci && ci.state === 'passing'); + if (String(item.unauthorized_step || '').trim()) return !mergeReady; + return !!((review && review.state !== 'approved') || (ci && ci.state !== 'passing')); } // A parked issue with a structured blocker (item.blocker, #15099) reads // "Blocked · App lacks workflows permission", never "Needs human @@ -17741,6 +17775,10 @@

    Where to get help

    // sits at 050/070, and hive's own #15400 ("1st") lit CI / Review // next to its 2nd-place sibling in Merge queue (hivecommons/hive#15395). if (item && item.merge_train && item.merge_train.state && cur > STAGE_TRACKER_PR_COLUMN) return STAGE_TRACKER_MERGE_COLUMN; + // A person owes a step on the PR itself (085 under hive:unauthorized, + // not merge-ready): PR in progress, with the merge-queue chevron + // empty (hivecommons/hive#16524). + if (kind === 'pr' && typeof stageTrackerPersonActsOnPR === 'function' && stageTrackerPersonActsOnPR(item)) return STAGE_TRACKER_PR_COLUMN; if (cur === STAGE_TRACKER_ISSUE_NEEDS_DECISION || cur === STAGE_TRACKER_TRIAGE_NEEDED || cur === STAGE_TRACKER_POSSIBLY_EXISTS) return STAGE_TRACKER_ISSUE_DECISION_COLUMN; if (cur === STAGE_TRACKER_NEEDS_DECISION && kind === 'issue') return STAGE_TRACKER_ISSUE_DECISION_COLUMN; if (STAGE_TRACKER_PATH.indexOf(cur) >= 0) return cur; @@ -19148,7 +19186,7 @@

    Where to get help

    ci_activity: lp.ci_activity || null, review_activity: lp.review_activity || null, code_activity: lp.code_activity || null, display_column: lp.display_column || 0, state: lp.state || '', terminal_merge: !!lp.terminal_merge, merged_by: lp.merged_by || '', stage: lp.stage || 0, stage_since: lp.stage_since || '', stage_slug: lp.stage_slug || '', modifiers: lp.modifiers || [], deferred_modifiers: lp.deferred_modifiers || [], caption: lp.caption || '', reason: lp.reason || '', preparation: lp.preparation || null, human_attention: lp.human_attention || null, - human_approver: lp.human_approver || '', manual_merge: !!lp.manual_merge, human_merge_reason: lp.human_merge_reason || '', human_merge_reason_text: lp.human_merge_reason_text || '', sentinel_alert: !!lp.sentinel_alert, sentinel_reason: lp.sentinel_reason || '', sentinel_details: lp.sentinel_details || [], sentinel_notice: !!lp.sentinel_notice, head: lp.head || '', base_ref: lp.base_ref || '', decision_needed: lp.decision_needed || null, + human_approver: lp.human_approver || '', manual_merge: !!lp.manual_merge, human_merge_reason: lp.human_merge_reason || '', human_merge_reason_text: lp.human_merge_reason_text || '', sentinel_alert: !!lp.sentinel_alert, sentinel_reason: lp.sentinel_reason || '', sentinel_details: lp.sentinel_details || [], sentinel_notice: !!lp.sentinel_notice, head: lp.head || '', base_ref: lp.base_ref || '', decision_needed: lp.decision_needed || null, unauthorized_step: lp.unauthorized_step || '', adoption: lp.adoption || null, takeover: lp.takeover || null, superseded: !!lp.superseded, supersedes: lp.supersedes || null, parent: Number(issue.number) || 0, siblings: open.map(x => Number(x.number) || 0), last_operator_action: lp.last_operator_action || null, operator_action_count: lp.operator_action_count || 0, hold: lp.hold || null, stage_actor: lp.stage_actor || null, claimant: lp.claimant || null, presence: lp.presence || null, rework: lp.rework || null, push: lp.push || null, merge_gate: lp.merge_gate || null, merge_train: lp.merge_train || null, left_train: lp.left_train || null, overlap: lp.overlap || null, decided: lp.decided || null, adopted_by: Number(lp.adopted_by) || 0, adopted_by_state: lp.adopted_by_state || '', adopted_from: lp.adopted_from || null, lineage: lp.lineage || null, state: lp.state || '', superseded_by: Number(lp.superseded_by) || 0 }; @@ -19574,7 +19612,7 @@

    Where to get help

    shown = Object.assign({}, item, { via_pr: true, stage: stageTrackerLeadStage(lp), stage_since: lp.stage_since || item.stage_since, modifiers: lp.modifiers || item.modifiers, deferred_modifiers: lp.deferred_modifiers || item.deferred_modifiers || [], caption: lp.caption || item.caption, reason: lp.reason || item.reason, preparation: lp.preparation || null, ci_activity: lp.ci_activity || null, review_activity: lp.review_activity || null, code_activity: lp.code_activity || null, display_column: lp.display_column || 0, terminal_merge: !!lp.terminal_merge, merged_by: lp.merged_by || '', - human_approver: lp.human_approver || '', manual_merge: !!lp.manual_merge, human_merge_reason: lp.human_merge_reason || '', human_merge_reason_text: lp.human_merge_reason_text || '', sentinel_alert: !!lp.sentinel_alert, sentinel_reason: lp.sentinel_reason || '', sentinel_details: lp.sentinel_details || [], sentinel_notice: !!lp.sentinel_notice, head: lp.head || '', decision_needed: lp.decision_needed || null, hold: lp.hold || null, adoption: lp.adoption || null, stage_actor: lp.stage_actor || item.stage_actor || null, claimant: lp.claimant || null, presence: lp.presence || null, rework: lp.rework || null, push: lp.push || null, merge_gate: lp.merge_gate || null, merge_train: lp.merge_train || null, left_train: lp.left_train || null, overlap: lp.overlap || null, decided: lp.decided || item.decided || null }); + human_approver: lp.human_approver || '', manual_merge: !!lp.manual_merge, human_merge_reason: lp.human_merge_reason || '', human_merge_reason_text: lp.human_merge_reason_text || '', sentinel_alert: !!lp.sentinel_alert, sentinel_reason: lp.sentinel_reason || '', sentinel_details: lp.sentinel_details || [], sentinel_notice: !!lp.sentinel_notice, head: lp.head || '', decision_needed: lp.decision_needed || null, unauthorized_step: lp.unauthorized_step || '', hold: lp.hold || null, adoption: lp.adoption || null, stage_actor: lp.stage_actor || item.stage_actor || null, claimant: lp.claimant || null, presence: lp.presence || null, rework: lp.rework || null, push: lp.push || null, merge_gate: lp.merge_gate || null, merge_train: lp.merge_train || null, left_train: lp.left_train || null, overlap: lp.overlap || null, decided: lp.decided || item.decided || null }); } else if (linked.length) { // Several covering PRs: the issue strip ends at Claimed, all passed // and nothing lit; one sub-row per PR carries the live chevron. From 72203c1bd50b8351524bc8506fc6de077c8195f5 Mon Sep 17 00:00:00 2001 From: Andrew Anderson Date: Wed, 4 Nov 2026 08:24:00 -0500 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=90=9B=20trackerrow:=20sync=20shared?= =?UTF-8?q?=20tracker-row-anchor.js=20with=20the=20spoke=20copy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Andrew Anderson --- src/pkg/webassets/trackerrow/tracker-row-anchor.js | 4 ++++ src/pkg/webassets/trackerrow/trackerrow.go | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/pkg/webassets/trackerrow/tracker-row-anchor.js b/src/pkg/webassets/trackerrow/tracker-row-anchor.js index 807d3c153e..f91cfd897b 100644 --- a/src/pkg/webassets/trackerrow/tracker-row-anchor.js +++ b/src/pkg/webassets/trackerrow/tracker-row-anchor.js @@ -44,6 +44,10 @@ // sits at 050/070, and hive's own #15400 ("1st") lit CI / Review // next to its 2nd-place sibling in Merge queue (hivecommons/hive#15395). if (item && item.merge_train && item.merge_train.state && cur > STAGE_TRACKER_PR_COLUMN) return STAGE_TRACKER_MERGE_COLUMN; + // A person owes a step on the PR itself (085 under hive:unauthorized, + // not merge-ready): PR in progress, with the merge-queue chevron + // empty (hivecommons/hive#16524). + if (kind === 'pr' && typeof stageTrackerPersonActsOnPR === 'function' && stageTrackerPersonActsOnPR(item)) return STAGE_TRACKER_PR_COLUMN; if (cur === STAGE_TRACKER_ISSUE_NEEDS_DECISION || cur === STAGE_TRACKER_TRIAGE_NEEDED || cur === STAGE_TRACKER_POSSIBLY_EXISTS) return STAGE_TRACKER_ISSUE_DECISION_COLUMN; if (cur === STAGE_TRACKER_NEEDS_DECISION && kind === 'issue') return STAGE_TRACKER_ISSUE_DECISION_COLUMN; if (STAGE_TRACKER_PATH.indexOf(cur) >= 0) return cur; diff --git a/src/pkg/webassets/trackerrow/trackerrow.go b/src/pkg/webassets/trackerrow/trackerrow.go index 9a0a5af04d..ecaf1aff3a 100644 --- a/src/pkg/webassets/trackerrow/trackerrow.go +++ b/src/pkg/webassets/trackerrow/trackerrow.go @@ -12,8 +12,8 @@ // The files are plain function declarations with no side effects. A host page // supplies what they call: the STAGE_TRACKER_* stage constants // (tracker-words-core.js and agent-now.js on the spoke) and esc(). The anchor -// calls stageTrackerUnderRepair and stageTrackerMergeRefusalFromRaw only when -// they are defined. +// calls stageTrackerUnderRepair, stageTrackerMergeRefusalFromRaw and +// stageTrackerPersonActsOnPR only when they are defined. package trackerrow import "embed"