From 616ef74f9c46b51a1b5d145a090f9ec28cf615fc Mon Sep 17 00:00:00 2001 From: Danathar Date: Tue, 10 Nov 2026 07:37:08 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(dashboard):=20standing=20met?= =?UTF-8?q?a=20issues=20are=20never=20waiting=20on=20you?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The four Renovate Dependency Dashboards on projectbluefin (common#245, gutenprint-printer-app#45, hplip-printer-app#42, ps-printer-app#50) wear needs-human from a triage bot, so the stage tracker's waiting_on_human block listed them as approve-needed. The monitor never draws a standing meta issue and the stage engine gives it no stage (#16833), but stageTrackerWaitKind did not look at the bucket, so the badge, the topbar pill and the MCP's waiting_on_you counted rows nobody can see or act on. stageTrackerWaitKind now returns no wait for an issue in the dependency_dashboard or hive_advisory bucket, the same structural classification (bot author plus dashboard title, or the advisory title/label) the enumeration and the SPA already use. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1 Signed-off-by: Danathar --- .../fixed-waiting-on-you-standing-meta.md | 1 + .../dashboard-sections/activity-monitor.md | 2 +- .../stage_tracker_standing_meta_test.go | 39 +++++++++++++++++++ src/pkg/dashboard/stage_tracker_waiting.go | 25 +++++++++--- .../dashboard/stage_tracker_waiting_test.go | 30 ++++++++++++++ 5 files changed, 91 insertions(+), 6 deletions(-) create mode 100644 changelog.d/fixed-waiting-on-you-standing-meta.md diff --git a/changelog.d/fixed-waiting-on-you-standing-meta.md b/changelog.d/fixed-waiting-on-you-standing-meta.md new file mode 100644 index 0000000000..b14bc64c17 --- /dev/null +++ b/changelog.d/fixed-waiting-on-you-standing-meta.md @@ -0,0 +1 @@ +- Bot Dependency Dashboards and the Hive Advisory Report no longer count as "Waiting on you" (approve-needed) when a triage bot labels them `needs-human`: the badge, topbar pill and the MCP's `waiting_on_you` now match the activity monitor, which never draws those issues. diff --git a/src/docs/dashboard-sections/activity-monitor.md b/src/docs/dashboard-sections/activity-monitor.md index 2ef9530763..92d697ca85 100644 --- a/src/docs/dashboard-sections/activity-monitor.md +++ b/src/docs/dashboard-sections/activity-monitor.md @@ -115,7 +115,7 @@ The hive often parks work on a person: a decision asked at **045** / **085**, a - **Topbar.** A **Waiting on you · N** pill sits beside **Health**, hidden at zero. Click it to land on the activity monitor with the **Waiting on you** filter applied; `?filter=waiting-on-you` on the dashboard URL does the same (for links from chat or a notification). - **Toast.** When the count rises between two polls, one in-app toast says **N items need your decision — #15312, #15433 …** with a **Show** action that applies the filter. At most one toast per ten minutes; none in kiosk mode. -`kind` is one of `needs-decision` (045 / 085 or the `needs-decision` modifier), `ready-for-human-merge` (090), `approve-needed` (`needs-human` / `unauthorized`), `returned-to-contributor-offline` (071 / 072 once the author's grace has elapsed — `who` is then the contributor, the operator being their fallback), `other-human-wait` (015 triage). `who` is `operator` for everything the signed-in operator / maintainers must do themselves. Rows on **hold**, advisories, decided rows and PRs nested under a listed issue are not counted: hold is the operator's own choice, an advisory asks for nothing, and a decided row is the hive's to act on next. Each item also carries `waiting_on_you` / `wait_kind`, which is what the **Waiting on you** toolbar chip filters on. +`kind` is one of `needs-decision` (045 / 085 or the `needs-decision` modifier), `ready-for-human-merge` (090), `approve-needed` (`needs-human` / `unauthorized`), `returned-to-contributor-offline` (071 / 072 once the author's grace has elapsed — `who` is then the contributor, the operator being their fallback), `other-human-wait` (015 triage). `who` is `operator` for everything the signed-in operator / maintainers must do themselves. Rows on **hold**, advisories, standing meta issues (a bot Dependency Dashboard or the Hive Advisory Report, the rows the monitor never draws), decided rows and PRs nested under a listed issue are not counted: hold is the operator's own choice, an advisory asks for nothing, a Dependency Dashboard is a control panel even when a triage bot labelled it `needs-human`, and a decided row is the hive's to act on next. Each item also carries `waiting_on_you` / `wait_kind`, which is what the **Waiting on you** toolbar chip filters on. ### Filters, sorting and pagination diff --git a/src/pkg/dashboard/stage_tracker_standing_meta_test.go b/src/pkg/dashboard/stage_tracker_standing_meta_test.go index 2083093acf..38a7c9164a 100644 --- a/src/pkg/dashboard/stage_tracker_standing_meta_test.go +++ b/src/pkg/dashboard/stage_tracker_standing_meta_test.go @@ -1,6 +1,7 @@ package dashboard import ( + "slices" "testing" "time" @@ -44,6 +45,44 @@ func TestStageTrackerPayloadKeepsStandingMetaIssues(t *testing.T) { } } +// End to end: projectbluefin/ps-printer-app#50, mergeraptor[bot]'s +// Dependency Dashboard wearing needs-human, reaches the payload in the +// dependency_dashboard bucket with the needs-human pill, and the +// waiting_on_human block (the badge, the topbar pill, the MCP's +// waiting_on_you) leaves it out. A needs-human issue that is ordinary +// work still counts. +func TestStageTrackerStandingMetaIssueIsNotWaitingOnYou(t *testing.T) { + now := time.Date(2026, 11, 10, 12, 30, 0, 0, time.UTC) + s := newTestServer() + status := minimalPayload() + status.Repos = []FrontendRepo{{ + Name: "ps-printer-app", Full: "projectbluefin/ps-printer-app", + NonActionableIssues: []any{ + github.RepoWorkIssue{Repo: "projectbluefin/ps-printer-app", Number: 50, Title: "Dependency Dashboard", Author: "mergeraptor[bot]", Labels: []string{"triage/accepted", "kind/cleanup", "needs-human"}, Bucket: repoWorkBucketDependencyDashboard, Reason: "Dependency dashboard control panel"}, + github.RepoWorkIssue{Repo: "projectbluefin/ps-printer-app", Number: 51, Title: "Printer list is empty", Author: "pat", Labels: []string{"kind/bug", "needs-human"}, Bucket: repoWorkBucketFiltered, Reason: "Parked for human review"}, + }, + }} + s.UpdateStatus(status) + tr := s.buildStageTracker(s.status, nil, now) + + deps := trackerItem(t, tr, "issue", 50) + if deps.Bucket != repoWorkBucketDependencyDashboard { + t.Fatalf("#50 bucket = %q, want %q", deps.Bucket, repoWorkBucketDependencyDashboard) + } + if !slices.Contains(deps.Modifiers, modNeedsHuman) { + t.Fatalf("#50 modifiers = %v, want the needs-human pill (the input this test guards against)", deps.Modifiers) + } + if deps.WaitingOnYou || deps.WaitKind != "" { + t.Errorf("#50 waiting_on_you/wait_kind = %v/%q, want false/\"\"", deps.WaitingOnYou, deps.WaitKind) + } + if work := trackerItem(t, tr, "issue", 51); !work.WaitingOnYou || work.WaitKind != waitKindApproveNeeded { + t.Errorf("#51 waiting_on_you/wait_kind = %v/%q, want true/%q", work.WaitingOnYou, work.WaitKind, waitKindApproveNeeded) + } + if tr.WaitingOnHuman.Count != 1 || len(tr.WaitingOnHuman.Items) != 1 || tr.WaitingOnHuman.Items[0].Number != 51 { + t.Errorf("waiting_on_human = %+v, want only #51", tr.WaitingOnHuman) + } +} + // SPA: a standing meta issue is never a row, in any view; it does not count // toward the pill, needs attention or the label chips; and the count line // names it, so the breakdown still adds up to the open totals. diff --git a/src/pkg/dashboard/stage_tracker_waiting.go b/src/pkg/dashboard/stage_tracker_waiting.go index 94c08da7a0..e5c956874b 100644 --- a/src/pkg/dashboard/stage_tracker_waiting.go +++ b/src/pkg/dashboard/stage_tracker_waiting.go @@ -71,12 +71,13 @@ type StageTrackerWaitingItem struct { var stageTrackerReturnedStages = []int{stagelabels.NeedsAuthor.Number(), stagelabels.ReturnedToContributor.Number()} // stageTrackerWaitKind classifies the human wait on it, "" when the item -// waits on nobody the operator is answerable for. Hold, advisories and -// already-decided rows never count: hold is the operator's own choice, -// an advisory asks for nothing, and a decided row is the hive's to act -// on next. +// waits on nobody the operator is answerable for. Hold, advisories, +// standing meta issues and already-decided rows never count: hold is the +// operator's own choice, an advisory asks for nothing, a bot Dependency +// Dashboard is a control panel whatever labels it wears, and a decided +// row is the hive's to act on next. func stageTrackerWaitKind(it StageTrackerItem) (kind, who string) { - if stageTrackerOnHold(it) || it.Advisory != nil || it.Decided != nil { + if stageTrackerOnHold(it) || it.Advisory != nil || it.Decided != nil || stageTrackerWaitStandingMeta(it) { return "", "" } switch { @@ -104,6 +105,20 @@ func stageTrackerWaitKind(it StageTrackerItem) (kind, who string) { return "", "" } +// stageTrackerWaitStandingMeta reports whether it is a standing meta +// issue: a bot Dependency Dashboard or the Hive Advisory Report, which the +// enumeration files under the dependency_dashboard / hive_advisory buckets +// (github.standingMetaIssueKindFor: bot author plus dashboard title, or +// the advisory title / label). The SPA never draws one +// (stageTrackerIsStandingMeta) and the stage engine derives no stage for +// it (hivecommons/hive#16833), but a needs-human label a triage bot or a +// maintainer sweep put on it still made it "approve-needed" here, so the +// badge, the topbar pill and the MCP's waiting_on_you counted rows the +// monitor does not show (projectbluefin/common#245). +func stageTrackerWaitStandingMeta(it StageTrackerItem) bool { + return it.Kind == "issue" && (it.Bucket == repoWorkBucketDependencyDashboard || it.Bucket == repoWorkBucketHiveAdvisory) +} + // stageTrackerContributorGraceElapsed reports whether a row returned to // its contributor has outlived their grace, so the operator is now the // one the hive waits on (adopt / reroute / nudge by hand). diff --git a/src/pkg/dashboard/stage_tracker_waiting_test.go b/src/pkg/dashboard/stage_tracker_waiting_test.go index c9a751269d..f07e0bbab7 100644 --- a/src/pkg/dashboard/stage_tracker_waiting_test.go +++ b/src/pkg/dashboard/stage_tracker_waiting_test.go @@ -104,3 +104,33 @@ func TestStageTrackerWaitingOnHuman_ReturnedOfflineSignals(t *testing.T) { } } } + +// A standing meta issue waits on nobody, whatever it wears: the four +// Renovate Dependency Dashboards on projectbluefin (common#245, +// gutenprint-printer-app#45, hplip-printer-app#42, ps-printer-app#50) +// carry needs-human from a triage bot and were listed as approve-needed. +// A sidelined issue in any other bucket still counts. +func TestStageTrackerWaitingOnHuman_SkipsStandingMetaIssues(t *testing.T) { + items := []StageTrackerItem{ + {Repo: "projectbluefin/common", Number: 245, Kind: "issue", Author: "renovate[bot]", Bucket: repoWorkBucketDependencyDashboard, Modifiers: []string{modNeedsHuman}}, + {Repo: "projectbluefin/hplip-printer-app", Number: 42, Kind: "issue", Author: "mergeraptor[bot]", Bucket: repoWorkBucketDependencyDashboard, Stage: stagelabels.IssueNeedsDecision.Number(), Modifiers: []string{modNeedsHuman}}, + {Repo: "o/r", Number: 53, Kind: "issue", Bucket: repoWorkBucketHiveAdvisory, Modifiers: []string{modNeedsDecision}}, + // control: a needs-human issue in the filtered bucket is a real ask. + {Repo: "o/r", Number: 54, Kind: "issue", Bucket: repoWorkBucketFiltered, Modifiers: []string{modNeedsHuman}}, + // the bucket only marks issues; a PR is classified as before. + {Repo: "o/r", Number: 60, Kind: "pr", Bucket: repoWorkBucketDependencyDashboard, Stage: 60, Modifiers: []string{modNeedsHuman}}, + } + got := stageTrackerWaitingOnHuman(items) + if got.Count != 2 || len(got.Items) != 2 { + t.Fatalf("count = %d (%+v), want 2 (#54 and PR #60)", got.Count, got.Items) + } + for _, it := range items { + standing := it.Kind == "issue" && it.Number != 54 + if it.WaitingOnYou == standing { + t.Errorf("%s#%d (bucket %s): waiting_on_you = %v, want %v", it.Repo, it.Number, it.Bucket, it.WaitingOnYou, !standing) + } + if !standing && it.WaitKind != waitKindApproveNeeded { + t.Errorf("%s#%d: wait_kind = %q, want %q", it.Repo, it.Number, it.WaitKind, waitKindApproveNeeded) + } + } +}