From a45f4a46a068727e8520b9cbd25ef47714ddd0f4 Mon Sep 17 00:00:00 2001 From: Andrew Anderson Date: Wed, 4 Nov 2026 13:16:16 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(dashboard):=20a=20part-fille?= =?UTF-8?q?d=20CI=20ring=20is=20a=20running=20CI=20chevron?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Check-run motion on the head (in_progress, or queued when nothing runs) now leads every settled word in the required-check path, and the no-required-set path reads motion too, so the CI chevron is active with its count beside a running Review instead of an inactive part-green ring. Red neighbours ride in the running caption ("· 1 failing"); icon-only green is reserved for passed == total. The JS running predicate treats a partial ring with no settled word as running, except on rows parked on a person's decision. Fixes #16631 Signed-off-by: Andrew Anderson --- changelog.d/fixed-ci-partial-ring-running.md | 1 + src/pkg/dashboard/stage_tracker_activity.go | 59 ++++++++++++-- .../dashboard/stage_tracker_activity.test.js | 4 +- .../dashboard/stage_tracker_activity_test.go | 79 +++++++++++++++++-- .../stage_tracker_remediation_chevron.test.js | 24 ++++++ .../static-src/js/tracker-row-strip.js | 20 ++++- src/pkg/dashboard/static/index.html | 20 ++++- 7 files changed, 185 insertions(+), 22 deletions(-) create mode 100644 changelog.d/fixed-ci-partial-ring-running.md diff --git a/changelog.d/fixed-ci-partial-ring-running.md b/changelog.d/fixed-ci-partial-ring-running.md new file mode 100644 index 0000000000..e7c4df5855 --- /dev/null +++ b/changelog.d/fixed-ci-partial-ring-running.md @@ -0,0 +1 @@ +- Activity Monitor: a CI ring that is not yet full now renders the CI chevron active ("CI 13/19 · running") beside a running Review instead of a silent part-green glyph; check-run motion on the head leads red, unreported or ambiguous neighbours, and icon-only green is reserved for a complete ring (hivecommons/hive#16631). diff --git a/src/pkg/dashboard/stage_tracker_activity.go b/src/pkg/dashboard/stage_tracker_activity.go index e85ee45610..5a9ed9a2f1 100644 --- a/src/pkg/dashboard/stage_tracker_activity.go +++ b/src/pkg/dashboard/stage_tracker_activity.go @@ -69,6 +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) return out } type requiredObservation struct { @@ -104,6 +105,7 @@ func stageTrackerCIActivity(pr github.PullRequest, now time.Time) *StageTrackerA } if !found { stageTrackerCountHeadChecks(out, a) + stageTrackerHeadChecksMotion(out, a, now) return out } } @@ -111,7 +113,7 @@ func stageTrackerCIActivity(pr github.PullRequest, now time.Time) *StageTrackerA // Per required-check name: the leading state across its observations, // for the passed / failed counts. perName := map[string]string{} - running := false + running, queued, queuedName := false, false, "" // Per required-check name: which have a final result, for the running count. settled := map[string]bool{} for _, name := range a.Required { @@ -134,6 +136,8 @@ func stageTrackerCIActivity(pr github.PullRequest, now time.Time) *StageTrackerA } case check.State == "queued" || check.State == "waiting" || check.State == "pending" || check.State == "requested": state = "queued" + queued = true + queuedName = name case check.State == "in_progress": state = "running" running = true @@ -170,6 +174,17 @@ func stageTrackerCIActivity(pr github.PullRequest, now time.Time) *StageTrackerA if statusesMissing { out.State, out.Blocker = "unknown", "commit statuses not observed" } + // Motion on the head leads every settled word: while any required + // check still runs or waits for a runner the track is running, however + // red, unreported or ambiguous its neighbours are — a ring that is not + // yet full is a running ring, so the chevron stays active with its + // count (hivecommons/hive#16631). The red names ride in ChecksFailing. + switch { + case running: + out.State, out.Blocker = "running", "" + case queued && out.State != "queued": + out.State, out.Blocker = "queued", queuedName + } done := 0 for _, name := range a.Required { if settled[name] { @@ -197,7 +212,11 @@ func stageTrackerCIActivity(pr github.PullRequest, now time.Time) *StageTrackerA out.Detail = "Required check " + check + " finished without success (failed, timed out, was cancelled, or needs action) on the PR's current commit. A fix or a re-run has to turn it green before CI can pass." case "running": out.Caption = fmt.Sprintf("CI running · %d/%d checks done", done, total) - out.Detail = fmt.Sprintf("%d of the %s have a final result; the rest are still executing on the PR's current commit.", done, plural(total, "required check")) + out.Detail = fmt.Sprintf("%d of the %s have a final result; the rest are still executing or waiting for a runner on the PR's current commit.", done, plural(total, "required check")) + if out.ChecksFailed > 0 { + out.Caption += fmt.Sprintf(" · %d failing", out.ChecksFailed) + out.Detail += fmt.Sprintf(" %s already red: %s.", plural(out.ChecksFailed, "required check"), strings.Join(out.ChecksFailing, ", ")) + } case "queued": out.Caption = "CI queued · " + check + " waiting for a runner" out.Detail = "Required check " + check + " has been requested for the PR's current commit but has not started executing yet." @@ -231,10 +250,7 @@ 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 = running && a.ObservedAt != nil && !a.ObservedAt.After(now) && now.Sub(*a.ObservedAt) <= trackerActivityFreshWindow - if running && out.State != "running" { - out.Caption += " · other checks still running" - } + out.Active = out.State == "running" && a.ObservedAt != nil && !a.ObservedAt.After(now) && now.Sub(*a.ObservedAt) <= trackerActivityFreshWindow return out } @@ -300,6 +316,37 @@ func stageTrackerCountHeadChecks(out *StageTrackerActivity, a *github.PRCIActivi } } +// stageTrackerHeadChecksMotion turns the required-set-unknown count into a +// 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) { + moving := 0 + for _, check := range a.Checks { + if check.Head != "" && !strings.EqualFold(check.Head, a.Head) { + continue + } + switch check.State { + case "in_progress", "queued", "waiting", "pending", "requested": + moving++ + } + } + if moving == 0 { + return + } + done := out.ChecksTotal - moving + if done < 0 { + done = 0 + } + out.State, out.Blocker = "running", "" + out.Caption = fmt.Sprintf("CI running · %d/%d checks done", done, out.ChecksTotal) + out.Detail = fmt.Sprintf("%d of the %s observed on the PR's current commit have a final result; the rest are still executing or waiting for a runner. Which of them branch protection requires is not yet known.", done, plural(out.ChecksTotal, "check")) + 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 +} + // stageTrackerExpectedPerspectives is the swarm's perspective set for this // hive: the configured list (built-ins when empty), falling back to the // built-ins when the configuration cannot be resolved. diff --git a/src/pkg/dashboard/stage_tracker_activity.test.js b/src/pkg/dashboard/stage_tracker_activity.test.js index 41ca00b281..71dd40da16 100644 --- a/src/pkg/dashboard/stage_tracker_activity.test.js +++ b/src/pkg/dashboard/stage_tracker_activity.test.js @@ -766,7 +766,7 @@ test('the backend detail sentence rides in the track tooltip, not on the chevron }); test('#16484: count grammar — CI passed/total and Review done/total across every state', () => { - const word = new Function(trackConsts + '\n' + fn(strip, 'stageTrackerWorkflowApprovalPending') + fn(strip, 'stageTrackerQueueAheadWord') + fn(strip, 'stageTrackerHiveOwnsRepair') + fn(strip, 'stageTrackerTrackWord') + ';return stageTrackerTrackWord;')(); + const word = new Function(trackConsts + '\n' + fn(strip, 'stageTrackerWorkflowApprovalPending') + fn(strip, 'stageTrackerQueueAheadWord') + fn(strip, 'stageTrackerHiveOwnsRepair') + fn(strip, 'stageTrackerWaitingOnPerson') + fn(strip, 'stageTrackerTrackRunning') + fn(strip, 'stageTrackerTrackWord') + ';return stageTrackerTrackWord;')(); const ci = (state, extra = {}) => word({ head: 'h', ci_activity: { head: 'h', state, ...extra } }, 'ci', true); assert.equal(ci('passing', { checks_passed: 14, checks_total: 14 }), 'CI 14/14 passed'); assert.equal(ci('failing', { checks_passed: 11, checks_total: 14, checks_failed: 1, checks_failing: ['lint'] }), 'CI 11/14 · 1 failing (lint)'); @@ -779,7 +779,7 @@ test('#16484: count grammar — CI passed/total and Review done/total across eve assert.equal(ci('missing', { checks_passed: 13, checks_total: 14, blocker: 'test' }), 'CI 13/14 · test not reported'); assert.equal(ci('skipped', { checks_passed: 13, checks_total: 14, blocker: 'build' }), 'CI 13/14 · build skipped'); assert.equal(ci('unknown'), 'CI ?/? · no checks reported yet'); - assert.equal(ci('unknown', { checks_passed: 51, checks_total: 68 }), 'CI 51/68 · no verdict yet', 'unprotected base: head-wide counts without a required verdict'); + assert.equal(ci('unknown', { checks_passed: 51, checks_total: 68 }), 'CI 51/68 · running', 'unprotected base: an unfinished head-wide ring is still running (#16631)'); assert.equal(word({ head: 'h' }, 'ci', true), 'CI ?/? · no checks reported yet', 'no evidence at all in the current phase'); assert.equal(word({ head: 'h' }, 'ci', false), '', 'no evidence outside the current phase: not started, glyph alone'); assert.equal(word({ head: 'h', ci_activity: { head: 'old', state: 'passing', checks_passed: 14, checks_total: 14 } }, 'ci', true), 'CI ?/? · no checks reported yet', 'old-head evidence counts for nothing'); diff --git a/src/pkg/dashboard/stage_tracker_activity_test.go b/src/pkg/dashboard/stage_tracker_activity_test.go index 6c58028cc8..991dc436ac 100644 --- a/src/pkg/dashboard/stage_tracker_activity_test.go +++ b/src/pkg/dashboard/stage_tracker_activity_test.go @@ -1,6 +1,7 @@ package dashboard import ( + "fmt" "os/exec" "strings" "testing" @@ -23,7 +24,9 @@ func TestStageTrackerActivityRequiredCI(t *testing.T) { {"failure", "completed", "failure", "failing", true}, {"success", "completed", "success", "passing", true}, {"conditional skip", "completed", "skipped", "skipped", true}, - {"unknown required set", "completed", "failure", "unknown", false}, + // A queued neighbour keeps an ambiguous-required ring in motion + // (hivecommons/hive#16631). + {"unknown required set", "completed", "failure", "running", false}, } { t.Run(tc.name, func(t *testing.T) { pr := github.PullRequest{HeadSHA: "head", CIActivity: &github.PRCIActivity{ @@ -274,13 +277,17 @@ func TestStageTrackerActivityCIRetryAndMixedChecks(t *testing.T) { RequiredKnown: true, Required: []string{"build", "lint"}, Checks: []github.PRActivityCheck{ {Name: "build", State: "completed", Conclusion: "failure"}, {Name: "lint", State: "in_progress"}, }} - if got := stageTrackerCIActivity(pr, now); got.State != "failing" || !got.Active { + if got := stageTrackerCIActivity(pr, now); got.State != "running" || !got.Active || got.ChecksFailed != 1 || !strings.Contains(got.Caption, "1 failing") { t.Fatalf("failing required check hid simultaneous running CI: %+v", got) } pr.CIActivity.Checks = append(pr.CIActivity.Checks, github.PRActivityCheck{Name: "build", State: "completed", Conclusion: "success"}) - if got := stageTrackerCIActivity(pr, now); got.State != "unknown" { + if got := stageTrackerCIActivity(pr, now); got.State != "running" || got.ChecksPassed != 0 || got.ChecksFailed != 0 { t.Fatalf("ambiguous check apps manufactured success: %+v", got) } + pr.CIActivity.Checks[1] = github.PRActivityCheck{Name: "lint", State: "completed", Conclusion: "success"} + if got := stageTrackerCIActivity(pr, now); got.State != "unknown" { + t.Fatalf("ambiguous check apps manufactured success once settled: %+v", got) + } dispatch.Fixes = []review.PendingFix{{Repo: pr.Repo, Number: pr.Number, HeadSHA: pr.HeadSHA, Agent: "fixer", Dispatched: now}} status.Agents[1].AwaitingCI = true it := StageTrackerItem{Repo: pr.Repo, Kind: "pr", Number: pr.Number, Head: pr.HeadSHA, Stage: trackerNumberFixing} @@ -366,9 +373,27 @@ func TestStageTrackerActivityCICaptionsReadInPlainLanguage(t *testing.T) { t.Fatalf("%s: want %s %q (detail mentioning %q), got %+v", tc.name, tc.state, tc.want, tc.detailMention, got) } } - mixed := ci(done("build"), chk("lint", "completed", "failure"), chk("test", "in_progress", "")) - if got := stageTrackerCIActivity(mixed, now); got.Caption != `CI failing · "lint" red · other checks still running` { - t.Fatalf("mixed red+running caption: %+v", got) + // Motion leads a settled word: a ring that is not full is running, + // however red, unreported or ambiguous its neighbours (hivecommons/hive#16631). + motion := []struct { + name string + pr github.PullRequest + want string + }{ + {"red+running", ci(done("build"), chk("lint", "completed", "failure"), chk("test", "in_progress", "")), "CI running · 2/3 checks done · 1 failing"}, + {"missing+running", ci(done("build"), chk("lint", "in_progress", "")), "CI running · 1/3 checks done"}, + } + for _, tc := range motion { + got := stageTrackerCIActivity(tc.pr, now) + if got.State != "running" || got.Caption != tc.want || !got.Active { + t.Fatalf("%s: want running %q active, got %+v", tc.name, tc.want, got) + } + } + if got := stageTrackerCIActivity(ci(done("build"), done("lint"), done("lint"), chk("test", "queued", "")), now); got.State != "queued" || got.Caption != `CI queued · "test" waiting for a runner` { + t.Fatalf("ambiguous+queued: a waiting runner keeps the ring queued, not unknown: %+v", got) + } + if got := stageTrackerCIActivity(ci(done("build"), chk("lint", "completed", "failure"), done("test")), now); got.State != "failing" || got.Active { + t.Fatalf("settled red head must not read as running: %+v", got) } if got := stageTrackerCIActivity(github.PullRequest{Repo: pr.Repo, Number: pr.Number, HeadSHA: pr.HeadSHA}, now); got.Caption != "CI unknown · no check results observed for this head yet" || got.Detail == "" { t.Fatalf("no-evidence caption: %+v", got) @@ -422,8 +447,8 @@ func TestStageTrackerActivityCICheckCounts(t *testing.T) { {Name: "other-head", State: "completed", Conclusion: "success", Head: "old-head"}, } got = stageTrackerCIActivity(pr, now) - if got.State != "unknown" || got.ChecksTotal != 3 || got.ChecksPassed != 1 || got.ChecksFailed != 1 || strings.Join(got.ChecksFailing, ",") != "flaky" { - t.Fatalf("head-wide counts = %d/%d failed %d %v (state %s), want 1/3 failed 1 [flaky] unknown: a red run of a name stays red", got.ChecksPassed, got.ChecksTotal, got.ChecksFailed, got.ChecksFailing, got.State) + if got.State != "running" || got.ChecksTotal != 3 || got.ChecksPassed != 1 || got.ChecksFailed != 1 || strings.Join(got.ChecksFailing, ",") != "flaky" { + t.Fatalf("head-wide counts = %d/%d failed %d %v (state %s), want 1/3 failed 1 [flaky] running: a red run of a name stays red while the queued one keeps the ring in motion", got.ChecksPassed, got.ChecksTotal, got.ChecksFailed, got.ChecksFailing, got.State) } // No evidence for the head at all: no count ("CI ?/?"). pr.CIActivity.Checks = nil @@ -485,3 +510,41 @@ func TestStageTrackerActivityReviewPerspectiveCounts(t *testing.T) { t.Fatalf("old-head evidence leaked into counts: %d/%d", got.PerspectivesDone, got.PerspectivesTotal) } } + +func TestStageTrackerActivityCIPartialRingIsRunning(t *testing.T) { + now := time.Date(2026, 11, 4, 18, 0, 0, 0, time.UTC) + name := func(i int) string { return fmt.Sprintf("check-%02d", i) } + build := func(passed, pending int) github.PullRequest { + var required []string + var bindings []github.PRRequiredCheck + var checks []github.PRActivityCheck + for i := 0; i < passed+pending; i++ { + required = append(required, name(i)) + bindings = append(bindings, github.PRRequiredCheck{Name: name(i), AppKnown: true}) + if i < passed { + checks = append(checks, github.PRActivityCheck{Name: name(i), State: "completed", Conclusion: "success"}) + } else if i%2 == 0 { + checks = append(checks, github.PRActivityCheck{Name: name(i), State: "in_progress"}) + } + // Odd pending checks are not reported at all (a job that only + // starts after the shards finish), as on hivecommons/hive#16628. + } + return github.PullRequest{HeadSHA: "head", CIActivity: &github.PRCIActivity{ + Head: "head", Source: "github-check-runs", ObservedAt: &now, RequiredKnown: true, StatusesKnown: true, + Required: required, RequiredSource: "protection", RequiredChecks: bindings, Checks: checks}} + } + got := stageTrackerCIActivity(build(13, 6), now) + if got.State != "running" || !got.Active || got.ChecksPassed != 13 || got.ChecksTotal != 19 || got.Caption != "CI running · 13/19 checks done" { + t.Fatalf("13/19 with 6 pending must be an active running track: %+v", got) + } + full := stageTrackerCIActivity(build(19, 0), now) + if full.State != "passing" || full.Active || full.ChecksPassed != 19 || full.ChecksTotal != 19 { + t.Fatalf("19/19 is a complete green ring: %+v", full) + } + // Required set unknown: the head-wide count still reads motion. + loose := build(13, 6) + loose.CIActivity.RequiredKnown, loose.CIActivity.Required, loose.CIActivity.RequiredChecks = false, nil, nil + if got := stageTrackerCIActivity(loose, now); got.State != "running" || !got.Active || got.Caption != "CI running · 13/16 checks done" { + t.Fatalf("head-wide count with checks in progress must run: %+v", got) + } +} diff --git a/src/pkg/dashboard/stage_tracker_remediation_chevron.test.js b/src/pkg/dashboard/stage_tracker_remediation_chevron.test.js index 9775682398..c00b99dc73 100644 --- a/src/pkg/dashboard/stage_tracker_remediation_chevron.test.js +++ b/src/pkg/dashboard/stage_tracker_remediation_chevron.test.js @@ -229,3 +229,27 @@ test('#16539 shape: a queued swarm reads 0/5 and, as the stage\'s own track, is assert.doesNotMatch(c[5], /data-motion=/, 'queued is lit but still'); assert.equal(litCount(c.join('')), 1, 'the Review column is where the item is: the one lit chevron'); }); + +// hivecommons/hive#16631: a CI ring that is not full is a running ring. +// 13/19 with checks still pending is active with its count beside the +// running Review; only a complete 19/19 ring is the silent green glyph. +test('#16628 shape: CI 13/19 with pending checks + review in progress → both tracks active with words', () => { + const review = { head: 'abc1234def', state: 'reviewing', active: true, caption: 'Review 0/5 · in progress', perspectives_done: 0, perspectives_total: 5, source: 'dispatch', observed_at: seen }; + for (const state of ['running', 'unknown', 'queued']) { + const c = cells(redPR({ display_column: 50, stage: 50, + ci_activity: { head: 'abc1234def', state, caption: 'CI ' + state, checks_passed: 13, checks_total: 19, source: 'checks', observed_at: seen }, + review_activity: review })); + assert.match(c[4], /class="ham-seg ham-activity-track active ham-current"/, state + ': a part-filled ring is lit'); + assert.match(c[4], /CI 13\/19 · (running|queued) matches ? Number(a[k]) || 0 : 0; if (kind === 'ci') { const total = n('checks_total'); @@ -68,7 +68,9 @@ if (stageTrackerWorkflowApprovalPending(a) > 0) return count + ' · waiting on workflow approval' + (failing ? ' · ' + failing : ''); return count + ' · ' + (passed ? (blocker ? blocker + ' not reported' : 'not all reported') : 'no checks reported yet') + (failing ? ' · ' + failing : ''); } - default: return count + ' · ' + (total ? 'no verdict yet' : 'no checks reported yet'); + // An unfinished ring with no settled word is still running + // (hivecommons/hive#16631). + default: return count + ' · ' + (total ? (passed + failed < total ? 'running' + (failing ? ' · ' + failing : '') : 'no verdict yet') : 'no checks reported yet'); } } const total = n('perspectives_total'); @@ -222,7 +224,19 @@ if (!a || !item.head || a.head !== item.head) return false; if (stageTrackerWaitingOnPerson(item)) return false; const moving = kind === 'ci' ? ['running', 'queued'] : ['reviewing', 'adjudicating', 'assigned']; - return !!(a.active || moving.includes(a.state)); + if (a.active || moving.includes(a.state)) return true; + // A CI ring that is not full is a running ring: checks counted on + // the head but not yet passed or failed are still in motion unless + // the track has settled on a word of its own (a finding, a pass, a + // skip, an unreported required check, a person's decision) + // (hivecommons/hive#16631). + if (kind !== 'ci') return false; + // Inferred motion only; a row parked on a person's decision is not + // waiting on checks, whatever its cached counts say. + if ((item.decision_needed && item.decision_needed.question) || item.human_attention) return false; + const total = Number(a.checks_total) || 0, done = (Number(a.checks_passed) || 0) + (Number(a.checks_failed) || 0); + const settledWords = ['passing', 'failing', 'skipped', 'missing', 'human_decision']; + return total > 0 && done < total && !settledWords.includes(a.state); } // Evidence is supplied independently by the backend. A native 050 label diff --git a/src/pkg/dashboard/static/index.html b/src/pkg/dashboard/static/index.html index ba8b3295a2..575abb0379 100644 --- a/src/pkg/dashboard/static/index.html +++ b/src/pkg/dashboard/static/index.html @@ -17919,7 +17919,7 @@

Where to get help

const a = item && item[kind + '_activity']; const matches = !!(a && item.head && a.head === item.head); const state = matches ? a.state || 'unknown' : 'unknown'; - if (state === 'unknown' && !current) return ''; + if (state === 'unknown' && !current && !stageTrackerTrackRunning(item, kind)) return ''; const n = k => matches ? Number(a[k]) || 0 : 0; if (kind === 'ci') { const total = n('checks_total'); @@ -17939,7 +17939,9 @@

Where to get help

if (stageTrackerWorkflowApprovalPending(a) > 0) return count + ' · waiting on workflow approval' + (failing ? ' · ' + failing : ''); return count + ' · ' + (passed ? (blocker ? blocker + ' not reported' : 'not all reported') : 'no checks reported yet') + (failing ? ' · ' + failing : ''); } - default: return count + ' · ' + (total ? 'no verdict yet' : 'no checks reported yet'); + // An unfinished ring with no settled word is still running + // (hivecommons/hive#16631). + default: return count + ' · ' + (total ? (passed + failed < total ? 'running' + (failing ? ' · ' + failing : '') : 'no verdict yet') : 'no checks reported yet'); } } const total = n('perspectives_total'); @@ -18093,7 +18095,19 @@

Where to get help

if (!a || !item.head || a.head !== item.head) return false; if (stageTrackerWaitingOnPerson(item)) return false; const moving = kind === 'ci' ? ['running', 'queued'] : ['reviewing', 'adjudicating', 'assigned']; - return !!(a.active || moving.includes(a.state)); + if (a.active || moving.includes(a.state)) return true; + // A CI ring that is not full is a running ring: checks counted on + // the head but not yet passed or failed are still in motion unless + // the track has settled on a word of its own (a finding, a pass, a + // skip, an unreported required check, a person's decision) + // (hivecommons/hive#16631). + if (kind !== 'ci') return false; + // Inferred motion only; a row parked on a person's decision is not + // waiting on checks, whatever its cached counts say. + if ((item.decision_needed && item.decision_needed.question) || item.human_attention) return false; + const total = Number(a.checks_total) || 0, done = (Number(a.checks_passed) || 0) + (Number(a.checks_failed) || 0); + const settledWords = ['passing', 'failing', 'skipped', 'missing', 'human_decision']; + return total > 0 && done < total && !settledWords.includes(a.state); } // Evidence is supplied independently by the backend. A native 050 label