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-two-lit-chevrons.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Activity Monitor: a row never lights more than two chevrons, and a filled chevron now always means "this is where the item is / what is in motion". CI and Review are filled (amber) only while a check-run or a review perspective is actually running on the current head; passed / approved, findings, pending and decided verdicts are words in their colour on the muted field. Unreported checks and rows waiting on a person render as pending words, never amber. When both tracks run, the stage chevron is settled-current. A queued review swarm reads "Review 0/5 · swarm requested" instead of 5/5 (#16540).
9 changes: 9 additions & 0 deletions src/pkg/dashboard/stage_tracker_activity.go
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,15 @@ func stageTrackerCountPerspectives(out *StageTrackerActivity, pr github.PullRequ
out.PerspectivesDone++
}
}
// A swarm that is requested or queued has not started this round: no
// perspective of it is done, whatever an earlier round left behind.
// "Review 5/5 · swarm requested" contradicts itself (hivecommons/hive#16540).
if out.State == "unassigned" {
out.PerspectivesDone = 0
if out.PerspectivesTotal == 0 {
out.PerspectivesTotal = len(expected)
}
}
}

func trackerHeadMatches(repo string, number int, head, observedRepo string, observedNumber int, observedHead string) bool {
Expand Down
33 changes: 22 additions & 11 deletions src/pkg/dashboard/stage_tracker_activity.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const STAGE_TRACKER_NEEDS_DECISION = 85, STAGE_TRACKER_ISSUE_NEEDS_DECISION = 45
const STAGE_TRACKER_ISSUE_DECISION_COLUMN = 10, STAGE_TRACKER_TRIAGE_NEEDED = 15, STAGE_TRACKER_POSSIBLY_EXISTS = 17;
const STAGE_TRACKER_PRE_MERGE_SOAK = 95;
`;
const track = new Function('esc', 'stageTrackerIcon', fn(strip, 'stageTrackerTrackLead') + fn(strip, 'stageTrackerHiveOwnsRepair') + fn(strip, 'stageTrackerTrackWord') + fn(strip, 'stageTrackerActivityTrackHtml') + ';return stageTrackerActivityTrackHtml;')(esc, (n, cls) => `<svg class="${cls}" data-icon="${n}"></svg>`);
const track = new Function('esc', 'stageTrackerIcon', fn(strip, 'stageTrackerTrackLead') + fn(strip, 'stageTrackerWaitingOnPerson') + fn(strip, 'stageTrackerTrackRunning') + fn(strip, 'stageTrackerHiveOwnsRepair') + fn(strip, 'stageTrackerTrackWord') + fn(strip, 'stageTrackerActivityTrackHtml') + ';return stageTrackerActivityTrackHtml;')(esc, (n, cls) => `<svg class="${cls}" data-icon="${n}"></svg>`);
const getAnchor = new Function(globals + anchor + ';return stageTrackerAnchor;')();
const header = new Function('esc', 'stageTrackerIcon', globals + fn(strip, 'stageTrackerHeaderHtml') + ';return stageTrackerHeaderHtml;')(esc, () => '');
const now = Date.parse('2026-11-02T21:00:00Z');
Expand Down Expand Up @@ -116,7 +116,7 @@ function stageTrackerActorKind() { return ''; }
function stageTrackerActorTip() { return ''; }
function stageTrackerMotion() { return STAGE_TRACKER_MOTION_STATIC; }
function stageTrackerIcon(n) { return '<svg data-icon="' + n + '"></svg>'; }
` + fn(strip, 'stageTrackerStripItems') + ';return stageTrackerStripItems;')(esc, segments, track, ...Object.values(helpers));
` + fn(strip, 'stageTrackerWaitingOnPerson') + fn(strip, 'stageTrackerTrackRunning') + fn(strip, 'stageTrackerStripItems') + ';return stageTrackerStripItems;')(esc, segments, track, ...Object.values(helpers));
const renderStrip = makeStripRenderer();

function physicalTracks(item) {
Expand Down Expand Up @@ -474,7 +474,7 @@ test('Hive #16434 shape: missing current-head CI and review stay unknown but vis
review_activity: { head: 'head', state: 'unknown', caption: 'Review unknown · current-head evidence unavailable', source: 'unavailable' },
}));
for (const cell of [cells.ci, cells.review]) {
assert.match(cell, /ham-activity-track active ham-current/, 'absent evidence in the current phase is still in progress: lit, with words');
assert.match(cell, /ham-activity-track pending ham-current/, 'absent evidence in the current phase is pending: words, no amber (#16540)');
assert.match(cell, /data-activity-state="unknown"/);
assert.match(cell, /data-display-state="unknown"/);
assert.doesNotMatch(cell, /data-motion=|ham-activity-track done/);
Expand All @@ -492,7 +492,7 @@ test('Hive #16268 shape: held native Fixing waits for a fixer in the CI/Review p
review_activity: activity('approved', 'Review approved'),
});
const cells = physicalTracks(item);
assert.match(cells.ci, /active ham-current/);
assert.match(cells.ci, /pending ham-current/, 'held: unreported checks are not motion (#16540)');
assert.match(cells.ci, /CI \?\/\? · no checks reported yet</);
assert.match(cells.review, /done ham-current/);
assert.match(cells.review, /Review approved</);
Expand All @@ -508,12 +508,12 @@ test('current phase, running activity, failure and successful completion are ind
['failing', 'CI failing · "build" red', false, 'failing'],
['running', 'CI running · 1/2 checks done', true, 'active'],
['passing', 'CI green · all 2 required checks passed', false, 'done'],
['skipped', 'CI skipped · check "build" skipped', false, 'active'],
['skipped', 'CI skipped · check "build" skipped', false, 'pending'],
]) {
const cells = physicalTracks(livePR({ ci_activity: activity(state, caption, running) }));
assert.ok(cells.ci.includes('ham-activity-track ' + cls + ' ham-current'), state + ' → ' + cls);
assert.equal(cells.ci.includes('data-motion="active"'), running);
assert.match(cells.review, /active ham-current[^]*data-activity-state="unknown"/);
assert.match(cells.review, /pending ham-current[^]*data-activity-state="unknown"/);
}
const admitted = physicalTracks(livePR({ stage: 80, ci_activity: activity('passing', 'CI green · all 2 required checks passed'), review_activity: activity('approved', 'Review approved') }));
assert.doesNotMatch(admitted.ci + admitted.review, /ham-current|aria-current/);
Expand All @@ -536,7 +536,7 @@ test('old-head or stale observations cannot fabricate running/completion, but do
}
if (mode === 'old-head') {
assert.match(cells.review, /data-activity-state="unknown"/);
assert.match(cells.ci, /active ham-current[^]*CI \?\/\? · no checks reported yet</, 'old-head evidence counts for nothing on this head');
assert.match(cells.ci, /pending ham-current[^]*CI \?\/\? · no checks reported yet</, 'old-head evidence counts for nothing on this head');
assert.doesNotMatch(cells.review, /ham-activity-track done/);
} else {
assert.match(cells.ci, /active ham-current[^]*CI \?\/\? · running</, mode + ': the last observed state still reads in words');
Expand Down Expand Up @@ -570,7 +570,12 @@ test('current-phase styling is steady and undimmed, including compact/reduced-mo
for (const block of css.match(/\.ham-(?:seg\.)?ham-activity-track[^{]*\{[^}]*\}/g)) {
assert.doesNotMatch(block, /clip-path|border(?!-radius)|box-shadow: inset/, block);
}
assert.match(css, /\.ham-seg\.ham-activity-track\.failing \{ background: var\(--status-error\); color: var\(--surface-0\);/, 'a finding wears the error colour at full strength');
// Only a running track is filled (#16540): done / failing / pending /
// decided are words in their colour on the muted field.
assert.match(css, /\.ham-seg\.ham-activity-track\.failing \{ background: var\(--panel-strong\); color: var\(--status-error\);/, 'a finding is red words and glyph, not a red fill');
assert.match(css, /\.ham-seg\.ham-activity-track\.done \{ background: var\(--panel-strong\); color: var\(--green\);/, 'a pass is green words, not a fill');
for (const state of ['pending', 'done.decided']) assert.match(css, new RegExp('\\.ham-seg\\.ham-activity-track\\.' + state.replace('.', '\\.') + ' \\{ background: var\\(--panel-strong\\); color: var\\(--muted\\);'), state + ' is muted words on the muted field');
assert.doesNotMatch(css, /\.ham-seg\.ham-activity-track\.(?:done|failing|pending)[^{]*\{[^}]*background: var\(--(?:amber|status-error|green|red)\)/, 'no fill colour on a non-running track');
assert.doesNotMatch(css, /\.ham-track-state \{[^}]*white-space: nowrap/, 'count words wrap to the strip-wide two-line budget like every other chevron, never ellipsised mid-count');
const current = css.match(/\.ham-activity-track\.ham-current \{([^}]*)\}/)[1];
assert.doesNotMatch(current, /animation|data-motion/);
Expand Down Expand Up @@ -630,6 +635,7 @@ const STAGE_TRACKER_MOTION_ACTIVE = 'active', STAGE_TRACKER_MOTION_STATIC = 'sta
function stageTrackerSentinelInLane() { return false; }
function stageTrackerActorKind() { return ''; }
function stageTrackerActorTip() { return ''; }
` + fn(strip, 'stageTrackerWaitingOnPerson') + fn(strip, 'stageTrackerTrackRunning') + `
function stageTrackerMotion() { return 'active'; }
function stageTrackerIcon(n, cls) { return '<svg class="' + cls + '"></svg>'; }
` + anchor + fn(row, 'stageTrackerSegments') + fn(strip, 'stageTrackerActivityTrackHtml') + fn(strip, 'stageTrackerStripItems');
Expand All @@ -641,7 +647,12 @@ 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');
assert.equal((html.match(/data-motion="active"/g) || []).length, 3);
// Three qualify, two may light (#16540): CI and review running win; the
// stage chevron is settled-current — words kept, no pulse.
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, /data-track="review"[^]*Review working · reviewer/);
item.code_activity.observed_at = new Date(now - 300000).toISOString();
Expand Down Expand Up @@ -760,13 +771,13 @@ test('#16484: the three screenshot rows — both tracks lit with counts, swarm r
ci_activity: fresh('running', { checks_passed: 9, checks_total: 14, active: true }), review_activity: fresh('unknown', { perspectives_done: 0, perspectives_total: 5 }) }));
assert.equal(cls(cells.ci), 'active'); assert.equal(text(cells.ci), 'CI 9/14 · running');
assert.match(cells.ci, /data-motion="active"/);
assert.equal(cls(cells.review), 'active'); assert.equal(text(cells.review), 'Review 0/5 · re-review pending (new head)');
assert.equal(cls(cells.review), 'pending', 'a pending re-review is words without motion (#16540)'); assert.equal(text(cells.review), 'Review 0/5 · re-review pending (new head)');
assert.doesNotMatch(cells.review, /data-motion/);
assert.match(cells.review, /hive is waiting on CI for new head d3c0824/, 'the tooltip still says which track leads');
// #16491: review swarm requested, no bundle yet; CI shows its count.
cells = physicalTracks(livePR({ head, stage: 50, display_column: 50,
ci_activity: fresh('running', { checks_passed: 2, checks_total: 14 }), review_activity: fresh('unassigned', { perspectives_done: 0, perspectives_total: 5, blocker: 'no reviewer free' }) }));
assert.equal(cls(cells.review), 'active'); assert.equal(text(cells.review), 'Review 0/5 · swarm requested');
assert.equal(cls(cells.review), 'pending'); assert.equal(text(cells.review), 'Review 0/5 · swarm requested');
assert.equal(cls(cells.ci), 'active'); assert.equal(text(cells.ci), 'CI 2/14 · running');
// #16268: CI failed native-queue-policy, review approved, held.
cells = physicalTracks(livePR({ head, stage: 70, display_column: 50, modifiers: ['hold'], hold: { by: 'hanthor', pill: 'Held by @hanthor' },
Expand Down
12 changes: 12 additions & 0 deletions src/pkg/dashboard/stage_tracker_activity_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,18 @@ func TestStageTrackerActivityReviewPerspectiveCounts(t *testing.T) {
if got := count(bundle, agg, dispatch); got.PerspectivesTotal != len(expected)+1 || got.PerspectivesDone != 3 {
t.Fatalf("extra dispatched perspective counts = %d/%d, want 3/%d", got.PerspectivesDone, got.PerspectivesTotal, len(expected)+1)
}
// hive#16539: five verdicts exist for the head but the swarm is queued
// again (a wait, no reviewer free): this round has not started, so the
// word is "Review 0/5 · swarm requested", never "5/5 · swarm requested".
full := &review.Aggregate{Repo: pr.Repo, Number: pr.Number, HeadSHA: pr.HeadSHA, Verdict: "approve",
Perspectives: map[review.Perspective]review.Verdict{}}
for _, p := range expected {
full.Perspectives[p] = "approve"
}
waiting := review.DispatchState{GeneratedAt: now, Waits: []review.ReviewWaitRecord{{Repo: pr.Repo, Number: pr.Number, HeadSHA: pr.HeadSHA, Reason: "no-free-reviewer", FirstAt: now.Add(-8 * time.Minute), LastAt: now}}}
if got := count(bundle, full, waiting); got.State != "unassigned" || got.PerspectivesDone != 0 || got.PerspectivesTotal != len(expected) {
t.Fatalf("queued swarm counts = %d/%d (%s), want 0/%d unassigned", got.PerspectivesDone, got.PerspectivesTotal, got.State, len(expected))
}
// Evidence for another head counts nothing for this one.
agg.HeadSHA, bundle.HeadSHA = "old-head", "old-head"
dispatch.Pending = nil
Expand Down
2 changes: 2 additions & 0 deletions src/pkg/dashboard/stage_tracker_advisory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,8 @@ func TestStageTrackerAdvisoryChipAndAction(t *testing.T) {
jsFunc(t, html, "stageTrackerActorTip"),
jsFunc(t, html, "stageTrackerHeadline"),
jsFunc(t, html, "stageTrackerSegments"),
jsFunc(t, html, "stageTrackerWaitingOnPerson"),
jsFunc(t, html, "stageTrackerTrackRunning"),
jsFunc(t, html, "stageTrackerActivityTrackHtml"),
jsFunc(t, html, "stageTrackerStripItems"),
jsFunc(t, html, "stageTrackerItemOnHold"),
Expand Down
2 changes: 1 addition & 1 deletion src/pkg/dashboard/stage_tracker_human_attention.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ test('strip uses the person glyph only for a current requirement; claimant and s
STAGE_TRACKER_PRE_MERGE_SOAK: 95, STAGE_TRACKER_READY_FOR_HUMAN_MERGE: 90,
});

vm.runInContext(fn('tracker-row-strip', 'stageTrackerStripItems'), c);
vm.runInContext(fn('tracker-row-strip', 'stageTrackerWaitingOnPerson') + fn('tracker-row-strip', 'stageTrackerTrackRunning') + fn('tracker-row-strip', 'stageTrackerStripItems'), c);
item.stage = 40;
assert.match(c.stageTrackerStripItems(item, [], null, 1, {}), /data-kind="human"/);
item.human_attention = null;
Expand Down
4 changes: 4 additions & 0 deletions src/pkg/dashboard/stage_tracker_motion_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,8 @@ func TestStageTrackerMotionRowStamp(t *testing.T) {
jsConstLine(t, html, "STAGE_TRACKER_MOTION_HUMAN_MODS"),
jsFunc(t, html, "stageTrackerMotion"),
jsFunc(t, html, "stageTrackerShortAgo"),
jsFunc(t, html, "stageTrackerWaitingOnPerson"),
jsFunc(t, html, "stageTrackerTrackRunning"),
jsFunc(t, html, "stageTrackerActivityTrackHtml"),
jsFunc(t, html, "stageTrackerStripItems"),
jsFunc(t, html, "stageTrackerCurrentStageHtml"),
Expand Down Expand Up @@ -565,6 +567,8 @@ func TestStageTrackerMotionPreviewSample(t *testing.T) {
jsFunc(t, html, "stageTrackerHeaderHtml"),
jsFunc(t, html, "stageTrackerHoldLabels"),
jsFunc(t, html, "stageTrackerSoakLeft"),
jsFunc(t, html, "stageTrackerWaitingOnPerson"),
jsFunc(t, html, "stageTrackerTrackRunning"),
jsFunc(t, html, "stageTrackerActivityTrackHtml"),
jsFunc(t, html, "stageTrackerStripItems"),
jsFunc(t, html, "stageTrackerCurrentStageHtml"),
Expand Down
2 changes: 2 additions & 0 deletions src/pkg/dashboard/stage_tracker_new_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,8 @@ func TestStageTrackerNewRowRendering(t *testing.T) {
jsFunc(t, html, "stageTrackerHumanReason"),
jsFunc(t, html, "stageTrackerHeadline"),
jsFunc(t, html, "stageTrackerSegments"),
jsFunc(t, html, "stageTrackerWaitingOnPerson"),
jsFunc(t, html, "stageTrackerTrackRunning"),
jsFunc(t, html, "stageTrackerActivityTrackHtml"),
jsFunc(t, html, "stageTrackerStripItems"),
jsFunc(t, html, "stageTrackerTooltip"),
Expand Down
Loading
Loading