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-pr-progress-chevron-fallback.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Activity Monitor: the PR in progress chevron is the row's fallback — it defers (settled, icon only) whenever CI or Review runs, so CI + Review is the only pair ever active together — and its words are the PR's lifecycle (`Unassigned · next: scanner`, `Waiting for @author · fix owed`), never the CI / review verdict — and an active CI / Review chevron has exactly one fill: the stalled-blocker track no longer renders a darker amber, and running checks stay active whatever the poll's age (hivecommons/hive#16643).
11 changes: 10 additions & 1 deletion src/docs/dashboard-sections/activity-monitor.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ At 090 the row explains why: `· workflow files`, `· tests removed`, `· manual

A verified merge from the canonical merge ledger is terminal whether Hive, a maintainer or another bot performed it. The last known root or linked PR model reaches **Merged** during the existing short terminal/pin window, even without an earlier queue observation. The comment names the actual recorded merger; an unknown actor stays unknown. This does not invent an earlier queue/admission state or close a merely related issue. A stale open refresh cannot undo a verified merge, and repeated delivery or later actor enrichment does not replay the merge or restart its window. Terminal visibility does not re-enable closed-PR actions.

A failing external PR without a recorded Hive stage actor remains **CI failing · author-owned** when its PR author is known, **CI failing · owner recorded** for an observed claimant, or **CI failing · owner unknown** otherwise. Its work activity is unknown; missing internal worker evidence is not evidence that nobody is working. Inline and nested rows use the PR author or claimant, not the related issue's filer or holder. Explicit unclaimed Hive/bot routing and real CI failures remain unchanged.
A failing external PR without a recorded Hive stage actor remains **Fix owed · author-owned** when its PR author is known, **Fix owed · owner recorded** for an observed claimant, or **Fix owed · owner unknown** otherwise (the red verdict itself is the CI chevron's word, never this lane's). Its work activity is unknown; missing internal worker evidence is not evidence that nobody is working. Inline and nested rows use the PR author or claimant, not the related issue's filer or holder. Explicit unclaimed Hive/bot routing and real CI failures remain unchanged.

- With no covering PR, an issue has a full strip lit at Open, Actionable or Claimed.
- With exactly one covering PR, issue and PR share one continuous strip; early issue steps are passed and the PR supplies the current stage, chip, tooltip and age.
Expand Down Expand Up @@ -431,6 +431,15 @@ The *state pill* says where the item is and what it is waiting on (`hold`, `need

Plain words throughout — working / waiting on X / set back by Y / merged — nothing else blinks.

#### Chevron activation — the canonical rules

An *active* chevron is filled amber and carries words; an inactive one is its icon alone (CI / Review: the ring, green when the last run on this head passed, red when it failed, neutral when not yet run), with the counts in its tooltip. On every strip:

1. **1 ≤ active ≤ 2.** At least one chevron is active — the column where the item is or where it is stuck.
2. **CI and Review resolve first.** A track is active only while it genuinely runs on the current head (a check-run in progress or queued, a ring not yet full; a reviewer running or queued). If either runs, the PR is waiting on it: the stage chevron (PR in progress, Merge queue …) renders settled-current — filled but still, icon only, its words in the tooltip — and nothing else is active.
3. **CI + Review is the only pair.** Two chevrons are active together only when both tracks run at once; every other combination is exactly one active chevron. The stage chevron is the ≥ 1 fallback: active only when no track is in motion.
4. **The PR in progress chevron speaks the PR's lifecycle** — draft, pushed, rebasing, *Unassigned · next: scanner*, *Waiting for @author · fix owed* — never a CI or review verdict. *CI failing*, *CI 4/11 · 1 failing* and *changes requested* are the CI and Review chevrons' words; the PR in progress tooltip keeps the red reason as detail.

#### The row's lead action, inline

A row whose next move is yours does not hide its answer behind three dots. Beside the chips on the right of the header (and on a nested PR sub-row's own header), the row renders its **lead action** as a real `<button class="ham-lead-act">` — `[Accept triage]` on *Triage needed* (000-new hold or 015), `[Merge now]` (or the server's lead answer) on *Ready for human merge*, `[Let hive decide]` on *Needs human decision* and a duplicate's *Needs a pick*, `[Adopt…]` on a returned contributor PR whose adoption is due, `[Close now]` on an advisory issue. `stageTrackerLeadAction(item, ctx)` picks it from the same `stageTrackerRowActions(...)` list the ⋯ menu shows: the entry flagged `lead`, else the first *Decide…* option, else Adopt / Adopt now / *Let hive decide — all N PRs*; one button only, everything else stays in ⋯. A covered issue whose covering PR is drawn as its own tracker row — or, when the PR closes several listed issues, under another listed issue (`drawn_under`) — renders no button at all but a passive *decision pending on #N* chip (its tooltip names the lead and the row it lives on; clicking it scrolls to that row), so the decision has one button, on the row that draws the PR. The covered issue's caption reads *Covered by PR #N — waiting for a decision on the PR* rather than repeating the PR's question. It carries the menu entry's id, its hint as the hover and its enable/disable reason: a viewer without write access sees it greyed with *Sign in with write access to this repo*, a non-merger sees a merge action greyed with the role reason, never hidden. Clicking runs `runRowAction(action, row)` — the menu's own path, so the busy chevron, the acting caption, the toast and the history badge are the same. A row the server marks as the maintainer's move (`actor: maintainer` or `new.next_mover: maintainer`) that yields no lead is a bug: a development host logs a console warning, and `TestStageTrackerMaintainerRowsHaveLeadAction` runs the real fixtures through the picker.
Expand Down
13 changes: 8 additions & 5 deletions src/pkg/dashboard/stage_tracker_activity.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func stageTrackerCIActivity(pr github.PullRequest, now time.Time) *StageTrackerA
}
if !a.RequiredKnown || a.RequiredSource == "" || len(a.RequiredChecks) == 0 || len(a.Required) == 0 {
stageTrackerCountHeadChecks(out, a)
stageTrackerHeadChecksMotion(out, a, now)
stageTrackerHeadChecksMotion(out, a)
return out
}
type requiredObservation struct {
Expand Down Expand Up @@ -105,7 +105,7 @@ func stageTrackerCIActivity(pr github.PullRequest, now time.Time) *StageTrackerA
}
if !found {
stageTrackerCountHeadChecks(out, a)
stageTrackerHeadChecksMotion(out, a, now)
stageTrackerHeadChecksMotion(out, a)
return out
}
}
Expand Down Expand Up @@ -250,7 +250,10 @@ func stageTrackerCIActivity(pr github.PullRequest, now time.Time) *StageTrackerA
out.Caption = "CI skipped · check " + check + " skipped"
out.Detail = "Required check " + check + " finished as skipped or neutral on the PR's current commit, which branch protection does not count as a pass."
}
out.Active = out.State == "running" && a.ObservedAt != nil && !a.ObservedAt.After(now) && now.Sub(*a.ObservedAt) <= trackerActivityFreshWindow
// Running is active, full stop: the chevron has one fill. The poll's
// age rides ObservedAt for the tooltip, never a dimmer state
// (hivecommons/hive#16643).
out.Active = out.State == "running" || out.State == "queued"
return out
}

Expand Down Expand Up @@ -320,7 +323,7 @@ func stageTrackerCountHeadChecks(out *StageTrackerActivity, a *github.PRCIActivi
// running track while any check run on the head is still executing or
// queued: the ring is not full, so the chevron must be active with its
// count rather than a silent part-green glyph (hivecommons/hive#16631).
func stageTrackerHeadChecksMotion(out *StageTrackerActivity, a *github.PRCIActivity, now time.Time) {
func stageTrackerHeadChecksMotion(out *StageTrackerActivity, a *github.PRCIActivity) {
moving := 0
for _, check := range a.Checks {
if check.Head != "" && !strings.EqualFold(check.Head, a.Head) {
Expand All @@ -344,7 +347,7 @@ func stageTrackerHeadChecksMotion(out *StageTrackerActivity, a *github.PRCIActiv
if out.ChecksFailed > 0 {
out.Caption += fmt.Sprintf(" · %d failing", out.ChecksFailed)
}
out.Active = a.ObservedAt != nil && !a.ObservedAt.After(now) && now.Sub(*a.ObservedAt) <= trackerActivityFreshWindow
out.Active = true
}

// stageTrackerExpectedPerspectives is the swarm's perspective set for this
Expand Down
6 changes: 4 additions & 2 deletions src/pkg/dashboard/stage_tracker_activity.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -687,12 +687,14 @@ function stageTrackerIcon(n, cls) { return '<svg class="' + cls + '"></svg>'; }
const html = render(item, [{ number: 30, short: 'PR in progress' }, { number: 50, short: 'CI / Review' }, { number: 70, short: 'Fixing', branch_from: 50 }], null, now, {});
assert.equal((html.match(/<li /g) || []).length, 8, 'one PR strip, seven visible columns plus history');
// Three qualify, two may light (#16540): CI and review running win; the
// stage chevron is settled-current — words kept, no pulse.
// stage chevron is settled-current — icon only, its words in the
// tooltip, no pulse (hivecommons/hive#16643).
assert.equal((html.match(/data-motion="active"/g) || []).length, 2);
assert.match(html, /class="ham-seg active ham-settled-current detoured"/);
assert.doesNotMatch(html, /ham-settled-current[^>]*data-motion/);
assert.match(html, /Waiting on CI and review, both running — /);
assert.match(html, /ham-detour[^>]*>Remediating · fixer/);
assert.match(html, /aria-label="[^"]*Remediating · fixer/);
assert.doesNotMatch(html, /ham-detour[^>]*>Remediating · fixer/, 'a deferred stage chevron carries no words');
assert.match(html, /data-track="review"[^]*Review working · reviewer/);
item.code_activity.observed_at = new Date(now - 300000).toISOString();
const stale = render(item, stages, null, now, {});
Expand Down
8 changes: 5 additions & 3 deletions src/pkg/dashboard/stage_tracker_activity_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func TestStageTrackerActivityRequiredCI(t *testing.T) {
{Name: "tide", State: "queued"}, {Name: "optional", State: "completed", Conclusion: "failure"}},
}}
got := stageTrackerCIActivity(pr, now)
if got.State != tc.want || got.Active != (tc.want == "running") {
if got.State != tc.want || got.Active != (tc.want == "running" || tc.want == "queued") {
t.Fatalf("activity = %+v, want %s", got, tc.want)
}
pr.CIActivity.Head = "old-head"
Expand All @@ -51,10 +51,12 @@ func TestStageTrackerActivityRequiredCI(t *testing.T) {
t.Fatalf("missing run became a verdict: %+v", got)
}
pr.CIActivity.Checks = []github.PRActivityCheck{{Name: "missing", State: "in_progress"}}
// A running check is active whatever the poll's age: one fill, the
// observation time in the tooltip (hivecommons/hive#16643).
for _, at := range []time.Time{now.Add(-trackerActivityFreshWindow - time.Second), now.Add(time.Second)} {
pr.CIActivity.ObservedAt = &at
if got := stageTrackerCIActivity(pr, now); got.Active {
t.Fatalf("stale or future CI manufactured current activity: %+v", got)
if got := stageTrackerCIActivity(pr, now); !got.Active || got.State != "running" {
t.Fatalf("a stale poll dimmed running CI: %+v", got)
}
}
}
Expand Down
6 changes: 4 additions & 2 deletions src/pkg/dashboard/stage_tracker_collection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,10 @@ func TestStageTrackerGraphQLCollectionPreservesRequiredProducer(t *testing.T) {
}
stale := time.Now().Add(-trackerActivityFreshWindow - time.Second)
projected.CIActivity.ObservedAt = &stale
if activity := stageTrackerCIActivity(projected, time.Now()); activity.Active {
t.Fatal("a stale serialized collection snapshot manufactured active CI")
// A stale snapshot keeps its observation time for the tooltip;
// Active follows the state alone (hivecommons/hive#16643).
if activity := stageTrackerCIActivity(projected, time.Now()); activity.Active != (activity.State == "running" || activity.State == "queued") || activity.ObservedAt == nil || !activity.ObservedAt.Equal(stale) {
t.Fatalf("a stale serialized collection snapshot changed the activity's fill or lost its age: %+v", activity)
}
if got.State == "failing" {
expectedID := int64(101)
Expand Down
4 changes: 2 additions & 2 deletions src/pkg/dashboard/stage_tracker_motion_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -495,8 +495,8 @@ assert.deepStrictEqual(ols(stageTrackerRowHtml(next[2], stages, ctx)), [''], 'an
assert.deepStrictEqual(ols(stageTrackerRowHtml(next[1], stages, ctx)), ['', ' data-ham-prev-col="4" data-ham-col="6"', ''], 'only the nested PR that moved is stamped (sub-rows sort furthest first)');
assert.deepStrictEqual(ols(stageTrackerRowHtml(next[0], stages, { nowMs: now })), [''], 'no moves in ctx → no stamp');
`
cmd := exec.Command(node, "-e", script)
if out, err := cmd.CombinedOutput(); err != nil {
// Over stdin: the lifted harness is past Linux's -e argument limit.
if out, err := runNodeStdin(node, script); err != nil {
t.Fatalf("node row stamp fixture failed: %v\n%s", err, out)
}
}
Expand Down
16 changes: 14 additions & 2 deletions src/pkg/dashboard/stage_tracker_remediation.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,15 @@ func stageTrackerRedSince(it *StageTrackerItem) (time.Time, string, bool) {
// head has no review / CI verdict recorded yet.
const stageTrackerFixRequestedWord = "Fix requested"

// PR in progress chevron words for a red PR nobody has picked up. They
// name the PR's lifecycle state — who owes the next head — never the CI
// or review verdict, which is the CI / Review chevron's information and
// stays in the detail (hivecommons/hive#16643).
const (
prProgressUnassignedWord = "Unassigned"
prProgressFixOwedWord = "fix owed"
)

// stageTrackerRemediationEvidence is the one place pickup evidence is read.
// Each source is independent; the most recent evidence wins so a kick that
// follows a push (the agent iterating) reads as remediating again.
Expand Down Expand Up @@ -320,7 +329,10 @@ func stageTrackerApplyRemediation(it *StageTrackerItem, dispatch review.Dispatch
out.Detail += ")."
it.DisplayColumn = trackerNumberPRInProgress
case out.State == "waiting_owner":
out.Caption = strings.Replace(out.Caption, " · not observed coding", " · "+strings.ToLower(redWord), 1)
// The PR in progress chevron speaks the PR's own lifecycle; the red
// word (CI failing / changes requested) is the CI or Review
// chevron's and rides only in the detail (hivecommons/hive#16643).
out.Caption = strings.Replace(out.Caption, " · not observed coding", " · "+prProgressFixOwedWord, 1)
out.Detail = redWord + redAt + "; no push, claim or fix kick seen since. A new head from @" + it.Author + ", a clanker claim or a hive adoption would move it."
it.DisplayColumn = trackerNumberPRInProgress
default:
Expand All @@ -329,7 +341,7 @@ func stageTrackerApplyRemediation(it *StageTrackerItem, dispatch review.Dispatch
if redSince.IsZero() {
out.Since = nil
}
out.Caption = redWord + " · unassigned"
out.Caption = prProgressUnassignedWord
if r := it.Rework; r != nil && r.Evidence == reworkEvidenceQueued && r.Actor != "" {
out.Caption += fmt.Sprintf(" · fixer queued, %d ahead", r.Ahead)
next = "@" + r.Actor + "'s clanker"
Expand Down
Loading
Loading