Repository navigation
🐛 Stage tracker: say CI running (not activity unknown) when checks are still pending - #16637
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of
|
1f7e5b1 to
7f7b41a
Compare
|
Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor. @clubanderson this PR is held at Failing checks:
Next: the hive does not push to your branch. Push a new head (or reply here); CI and the review swarm re-run automatically and the PR returns to the normal path. Review findings from Correctness re-review at 2ac426b (delta since 43f6f31 is the Previous findings: test-vs-code "stale running is not Active" — fixed ( 1. Head-wide path: a
|
There was a problem hiding this comment.
Correctness review (read at head 7f7b41a; #16636 is merged, so only the one commit on top was judged).
1. Unknown required set: a finished skipped/neutral check is counted as pending and flips the head to CI running forever — src/pkg/dashboard/stage_tracker_activity.go:324-351
stageTrackerCountHeadChecks tallies only passing and failing; a check whose latest run is completed with conclusion skipped/neutral hits the new default: arm (line 346) and lands in ChecksPending. With no red check that selects case len(out.ChecksPending) > 0 (line 364): State = "running", caption CI running · "lint" pending, and out.Active pulses while the poll is fresh (line 76). Path-filtered workflows report skipped on most heads, so on an unprotected base (the v6 case the file comments call out) a fully finished head reads as running with no way to settle. The required-set path treats skipped as its own state (line 150-152, 196), so the two paths now disagree, and the issue's "running" is specifically "the rest are running or pending", not finished-as-skipped. Not covered: TestStageTrackerActivityCIRunningWhileChecksPending and the head-wide block in TestStageTrackerActivityCICounts... (stage_tracker_activity_test.go:414-431) use only success/failure/queued/in_progress.
Suggested fix — track skipped in the tally and keep it out of pending:
type tally struct {
- passing, failing bool
+ passing, failing, skipped bool
since time.Time
}
@@
if !at.Before(t.since) {
- t.since, t.passing = at, check.State == "completed" && check.Conclusion == "success"
+ t.since = at
+ t.passing = check.State == "completed" && check.Conclusion == "success"
+ t.skipped = check.State == "completed" && (check.Conclusion == "skipped" || check.Conclusion == "neutral")
}
@@
case t.passing:
out.ChecksPassed++
+ case t.skipped:
default:
out.ChecksPending = append(out.ChecksPending, name)
}and a case in TestStageTrackerActivityCIRunningWhileChecksPending with run("docs", "completed", "skipped", &t2) alongside the 12 green on rowB with the 54 in-progress removed, asserting State == "unknown" and len(ChecksPending) == 0.
Note the JS side computes pendingCount = total - passed - failed (tracker-row-strip.js:74), which would still count a skipped check; once the Go side excludes it, Math.max(..., pendingNames.length) keeps the chevron at the arithmetic count (CI 12/13 · 1 running). Consider deriving the count from checks_pending.length when the array is present so the chevron matches the caption.
— hive: agent=ci-maintainer backend=copilot model=claude-fable-5.1 copilot=1.0.88
12a8abb to
75f06f0
Compare
|
CI triage (scanner):
(replaces the 🐝 Hive Agent: — hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
|
Follow-up to the scanner triage above (quality): #16634 (green, waiting on tide) already converts all four 🐝 Hive Agent: — hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
There was a problem hiding this comment.
Correctness — delta re-review at 75f06f0 (previous head 12a8abb). The rebase onto #16632/#16636 and the single-quote pass look right; the two findings from the previous round are still present.
1. Unknown required set: a completed skipped/neutral run is counted as pending → CI running forever (still present)
src/pkg/dashboard/stage_tracker_activity.go:341-359 — the per-name tally only knows failing (red conclusions, L341) and passing (completed+success, L346). A run that completed as skipped or neutral is neither, so the switch at L352-359 falls to default: and appends it to ChecksPending. Then L368 (case len(out.ChecksPending) > 0) sets State = "running" and the caption reads CI running · 'docs' pending indefinitely, with Active pulsing while the poll is fresh. The required-known path already handles this (case "skipped": at L214), so the two paths disagree on the same head. stage_tracker_activity_test.go has no skipped/neutral case on the unknown-required path (the only skipped fixtures, L26/L366, use RequiredKnown: true).
type tally struct {
- passing, failing bool
+ passing, failing, settled bool
since time.Time
}
@@
if !at.Before(t.since) {
- t.since, t.passing = at, check.State == "completed" && check.Conclusion == "success"
+ t.since, t.passing, t.settled = at, check.State == "completed" && check.Conclusion == "success", check.State == "completed"
}
@@
case t.passing:
out.ChecksPassed++
+ case t.settled:
+ // skipped / neutral: finished, counts neither way (mirrors the
+ // required-known "skipped" case above).
default:
out.ChecksPending = append(out.ChecksPending, name)Plus one table case: chk("docs","completed","skipped") beside a green run with RequiredKnown: false → expect state unknown, not running. (The default: caption at L380 then needs %d/%d observed checks passed instead of all … passed, since a skipped name is in ChecksTotal but not ChecksPassed.)
2. JS pendingCount still counts skipped checks as running (still present)
src/pkg/dashboard/static-src/js/tracker-row-strip.js:77 — Math.max(total - passed - failed, pendingNames.length): on the required-known path the backend now excludes skipped names from checks_pending but they remain in checks_total, so with ≥3 pending plus one skipped the chevron says e.g. CI 10/14 · 4 running for 3 running. Prefer the backend's list when it is present:
const pendingCount = pendingNames.length || (total ? Math.max(total - passed - failed, 0) : 0);
— hive: agent=adjudicator backend=copilot model=claude-fable-5.1 copilot=1.0.88
75f06f0 to
420a88f
Compare
420a88f to
43f6f31
Compare
|
@clubanderson this PR is back in your court (
Once the new head lands, CI and the review swarm re-run automatically and the PR returns to the normal path. |
1 similar comment
|
@clubanderson this PR is back in your court (
Once the new head lands, CI and the review swarm re-run automatically and the PR returns to the normal path. |
There was a problem hiding this comment.
Correctness re-review at 43f6f31 (delta since 75f06f0; the compare is dominated by the v5 rebase, the PR's own diff is the 10 dashboard files).
Prior findings:
stage_tracker_motion_test.goE2BIG fromnode -e— fixed: all four fixtures now feed the script on stdin (stage_tracker_motion_test.go:220-223, 377-380, 915-918,stage_tracker_repo_grouping_test.go:561-563);test (dashboard *)is green on this head.- Conflict with #16644 — no longer applies: #16644 merged, the PR is rebased and
MERGEABLE.
Delta reads correctly: the empty case out.State == "missing" && a.WorkflowApproval… at stage_tracker_activity.go:189 keeps the approval-gated head out of the motion override (no fallthrough in Go), stageTrackerLatestCheckTime is only applied to running/queued (:225-229), and TestStageTrackerActivityCIRunningWhileChecksPending pins state, caption, pending count and Since per case.
One low advisory, not blocking:
Chevron count includes skipped required checks — static-src/js/tracker-row-strip.js:77: pendingCount = Math.max(total - passed - failed, pendingNames.length). In the required-known path Go leaves skipped/neutral names out of both ChecksPassed and ChecksPending (stage_tracker_activity.go:203-219), so with ≥3 pending names plus one skipped check the chevron reads N+1 running while the caption says N checks pending. Prefer the names when the backend sent them and fall back to arithmetic only for older payloads:
const pendingCount = pendingNames.length || (total ? Math.max(total - passed - failed, 0) : 0);
— hive: agent=ci-maintainer backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
CI diagnosis (from the hive; it can't push to a human-authored branch, so this needs to be applied by the author)
Fix in @@ line 226 (test 10)
- assert.match(a[4], /class="ham-seg ham-activity-track active"[^]*CI 4\/11 · [^<]*1 failing \(Sign-off survives\)</);
+ assert.match(a[4], /class="ham-seg ham-activity-track active"[^]*CI 4\/11 · [^<]*1 failing \('Sign-off survives'\)</);
@@ line 310 (test 14)
- assert.match(old[4], /class="ham-seg ham-activity-track active ham-current"[^]*CI 14\/67 · running</, '...');
+ assert.match(old[4], /class="ham-seg ham-activity-track active ham-current"[^]*CI 14\/67 · 53 running</, '...');Both strings match the 🐝 Hive Agent: — hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
|
Addendum to the scanner diagnosis above (quality): One more line to touch while you are in assert.doesNotMatch(b[4], /Sign-off survives\)</, 'the inactive red track is its icon alone');still passes, but only because the strip now renders 🐝 Hive Agent: — hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
|
Scanner (this kick): since the diagnoses above, #16637 has gone 🐝 Hive Agent: — hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
…e still pending A head with 7/11 checks reported is mid-pipeline, not unknown: when checks still run or queue, the CI state is running (or queued) and the caption counts the unfinished checks; a required check with no run yet is one sentence in Detail instead of the missing verdict, and head-wide counts (required set unknown) follow the same rule. "no check results observed" is reserved for a head with zero check runs. The chevron word drops "no verdict yet" / bare "running" for the unfinished count or names, and the tooltip composes distinct facts once. Fixes #16630 Signed-off-by: Andrew Anderson <andy@clubanderson.com>
…text Signed-off-by: Andrew Anderson <andy@clubanderson.com>
43f6f31 to
76efda9
Compare
There was a problem hiding this comment.
Delta re-review at 76efda9 (intent-alignment). Previous findings: stale-running Active test mismatch — fixed (stage_tracker_activity_test.go:669 now asserts Active for a stale running head-wide row, matching stage_tracker_activity.go:88 out.Active = out.State == "running"); unquoted check name in the chevron JS test — fixed (stage_tracker_remediation_chevron.test.js:226 expects ('Sign-off survives')). One is still present and bears on #16630's intent:
Skipped/neutral checks keep the head-wide CI track "running" forever — src/pkg/dashboard/stage_tracker_activity.go:350-369. In stageTrackerCountHeadChecks a name is passing only when completed && success (l.355) and red only for the failure-class conclusions (l.350); a run that completed with skipped/neutral is neither, so it lands in ChecksPending (l.368) and the new switch picks State = "running" / CI running · 'docs' pending (l.377-381) for a head whose checks have all finished. The required-set path explicitly handles this (case "skipped": at l.226); the head-wide path does not. Issue #16630 asks for "running" only while checks are still running or pending; a 66-check matrix (Row B) almost always has conditional skips, so this is the mirror of the reported bug: a false "running" that never settles. Not covered by a test (stage_tracker_activity_test.go has no head-wide skipped case).
--- a/src/pkg/dashboard/stage_tracker_activity.go
+++ b/src/pkg/dashboard/stage_tracker_activity.go
@@ func stageTrackerCountHeadChecks(out *StageTrackerActivity, a *github.PRCIActivity) {
type tally struct {
- passing, failing bool
+ passing, failing, skipped bool
since time.Time
}
@@
if !at.Before(t.since) {
- t.since, t.passing = at, check.State == "completed" && check.Conclusion == "success"
+ t.since = at
+ t.passing = check.State == "completed" && check.Conclusion == "success"
+ t.skipped = check.State == "completed" && (check.Conclusion == "skipped" || check.Conclusion == "neutral")
}
@@
case t.passing:
out.ChecksPassed++
+ case t.skipped:
+ // Finished without a verdict: not pending, not a pass.
default:
out.ChecksPending = append(out.ChecksPending, name)The JS side has the same gap: tracker-row-strip.js:77 pendingCount = Math.max(total - passed - failed, pendingNames.length) counts a skipped check as unfinished, so even with the Go fix the default: branch (l.93) would print CI 12/13 · 1 running. When the backend sends checks_pending, trust it:
const pendingCount = Array.isArray(a.checks_pending) && matches ? pendingNames.length : (total ? total - passed - failed : 0);
— hive: agent=ci-maintainer backend=copilot model=claude-fable-5.1 copilot=1.0.88
There was a problem hiding this comment.
Style / maintainability re-review at 76efda9 (delta since 43f6f31). Prior findings: remediation-chevron JS quoting — fixed; stale-running head-wide Active test vs code — fixed (stage_tracker_activity_test.go:666-672 now asserts active for both polls). The head-wide skipped/neutral finding is still present and is the one thing holding this back.
1. Head-wide tally still files completed skipped/neutral runs under ChecksPending → "CI running" forever — src/pkg/dashboard/stage_tracker_activity.go:350-369. The tally only knows failing (line 350) and passing (line 355); a run with State=="completed" and Conclusion=="skipped"|"neutral" hits the default: at 367 and lands in ChecksPending, so line 375 (case len(out.ChecksPending) > 0) keeps the track running with N checks pending after every run has finished. The required-set path already settles these (:164-165), so the two paths disagree on the same run. The red-conclusion list is also now duplicated verbatim between :166 and :350, which is how this drift happened. Suggested fix (settle skipped, and reuse one classifier):
@@ func stageTrackerCountHeadChecks(out *StageTrackerActivity, a *github.PRCIActivity) {
type tally struct {
- passing, failing bool
+ passing, failing, skipped bool
since time.Time
}
@@
if !at.Before(t.since) {
t.since, t.passing = at, check.State == "completed" && check.Conclusion == "success"
+ t.skipped = check.State == "completed" && (check.Conclusion == "skipped" || check.Conclusion == "neutral")
}
@@
case t.passing:
out.ChecksPassed++
+ case t.skipped:
+ // A skipped or neutral run has finished; it is neither pending nor a verdict.
default:
out.ChecksPending = append(out.ChecksPending, name)(and lift the failure|timed_out|…|stale list shared by :166 and :350 into one stageTrackerCheckConclusionRed(conclusion string) bool.)
2. Failing names in Detail bypass the new quoting helper — stage_tracker_activity.go:258 and :387 build "… already red: " + strings.Join(out.ChecksFailing, ", ") with raw names, while the PR body says names in captions/details/chevrons are single-quoted and stageTrackerPendingChecksWord (:427-435) / stageTrackerUnreportedChecksSentence (:441-447) each hand-roll the same quote-and-join loop. One helper used in all four places keeps the convention in one spot:
+// stageTrackerCheckNames quotes and comma-joins check names for prose.
+func stageTrackerCheckNames(names []string) string {
+ quoted := make([]string, 0, len(names))
+ for _, name := range names {
+ quoted = append(quoted, stageTrackerCheckName(name))
+ }
+ return strings.Join(quoted, ", ")
+}then strings.Join(out.ChecksFailing, ", ") → stageTrackerCheckNames(out.ChecksFailing) at :258/:387, and the loops at :429-433 and :443-446 collapse to the helper.
3. Misplaced comment — stage_tracker_activity.go:231-236 describes the unreported-name/Detail rule and repeats the approve-workflows sentence already at :198-199, but the code it sits on (:237-241) only sets Since. Move the first sentence to the case "running": block at :250 and drop the duplicated gate sentence.
— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
merged by Hive trusted-author auto-merge: author @clubanderson holds role owner and GitHub permission admin on repo; CI green at 2ac426b. |
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
Fixes #16630
Rebased onto v5 after #16636, #16632, #16644, #16662 and #16669 merged; the overlapping parts of this PR that those already cover were dropped. What remains, on top of #16662's semantics:
stage_tracker_activity.go): running/queued captions name what is pending —CI running · 4 checks pending(or the one/two pending names) plus· N failingwhen a neighbour is red — instead ofN/M checks done, which duplicated the chevron count in the tooltip; the unreported required check is one sentence in Detail (Required check 'test' has not reported for this head yet.) rather than the "missing" verdict while others still run;Sinceis the latest check-run timestamp on the head;ChecksPendingis exposed; the head-wide (required-set-unknown) path reads motion instageTrackerCountHeadChecksdirectly (replacingstageTrackerHeadChecksMotion). 🐛 Review and CI chevrons state what the head waits on, never "activity unknown" #16662's no-data captions and 🐛 PR in progress chevron lights beside a running CI chevron and speaks the CI verdict #16643's "running is active" rule are kept.tracker-row-strip.js): chevron suffix carries the pending count/names (CI 12/66 · 54 running,CI 7/11 · 'test' not reported),no verdict yetis gone; the tooltip is composed from deduplicated facts (count word → caption unless the detail already says it → detail → blocker → ask), keeping 🐛 Review and CI chevrons state what the head waits on, never "activity unknown" #16662's since-ago and perspective lines.