Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/fixed-waiting-on-you-standing-meta.md
Original file line number Diff line number Diff line change
@@ -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.
2 changes: 1 addition & 1 deletion src/docs/dashboard-sections/activity-monitor.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
39 changes: 39 additions & 0 deletions src/pkg/dashboard/stage_tracker_standing_meta_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package dashboard

import (
"slices"
"testing"
"time"

Expand Down Expand Up @@ -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.
Expand Down
25 changes: 20 additions & 5 deletions src/pkg/dashboard/stage_tracker_waiting.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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).
Expand Down
30 changes: 30 additions & 0 deletions src/pkg/dashboard/stage_tracker_waiting_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
}
Loading