Pipelines page: a stage's count is of the worst outcome's group

Passed, carried and passed read "passed 2/3", as if one did not pass: the cell
counts the artifacts in the group of its worst outcome (failed, not run,
waiting, running, passed) and shows the count only where fewer than all are in
it, so a cell never reads worse or better than it is.

Builds: design 47 H2 H-A-531 addendum (3), as read in hq d7e7d204
This commit is contained in:
2026-11-23 11:09:42 +01:00
parent 81387d0f3b
commit 9bba3000f3
2 changed files with 10 additions and 8 deletions
@@ -165,7 +165,7 @@ func TestThePipelinesPage(t *testing.T) {
"failed; first failure: unit beta:program: could not run: no build node; 1 of 4 movers run their build on every node they are placed on; 1 is placed on none",
"<h2>TIER 1</h2>", "<th>MOVER</th><th>OUTCOME</th><th>BUILD</th><th>LINT</th><th>UNIT</th><th>INTEGRATION</th><th>VALIDATE</th><th>COMPOSITION</th><th>CODE REVIEW</th><th>APPROVAL</th><th>n1</th><th>n2</th><th>n3</th>",
`<a href="/pipelines/show?mover=alpha&amp;pipeline=main.12">alpha</a></td><td class="passed">passed</td><td class="passed" title="alpha:program: passed`,
">passed 2/3</td>", `<td class="passed">running the pipeline&#39;s build</td><td class="passed">running the pipeline&#39;s build</td><td class="none"></td></tr>`,
`alpha:tool: passed">passed</td>`, `<td class="passed">running the pipeline&#39;s build</td><td class="passed">running the pipeline&#39;s build</td><td class="none"></td></tr>`,
`<td class="failed" title="beta:program: could not run, waited 2m40s, ran 20s on n1: no build node`, ">could not run 1/2</td>",
`<td class="waiting" title="approval: waiting: a person">waiting</td>`,
`<td class="wanted">wanted</td><td class="applying">applying</td><td class="not-run">no want written</td>`,
@@ -180,8 +180,8 @@ func TestThePipelinesPage(t *testing.T) {
return stageCell(ss, t0).Text()
}
return strings.Join([]string{at("passed", "running", "waiting for a build node", "not asked", "running"), at("cancelled", "could not run"),
at("frobbed", "passed"), at("running", "running"), at("nothing to run"), at()}, "|")
}, []string{"not asked 1/5|could not run 1/2|frobbed 1/2|running 2/2|nothing to run|"}},
at("frobbed", "passed"), at("running", "running"), at("nothing to run"), at("failed", "passed", "carried"), at()}, "|")
}, []string{"not asked 1/5|could not run 1/2|frobbed 1/2|running|nothing to run|failed 1/3|"}},
{"a mover's page is its steps, each asked, taken and ended, how long it waited and how long it ran", func() string {
return web("/pipelines/show?pipeline=main.12&mover=beta")
}, []string{"<th>ASKED</th><th>TAKEN</th><th>ENDED</th><th>WAITED</th><th>RAN</th>",
@@ -212,7 +212,7 @@ func TestThePipelinesPage(t *testing.T) {
return text(func(b *bytes.Buffer) { PipelineTable(b, *got, "") })
}, []string{"PIPELINE main.12: failed; first failure: unit beta:program: could not run: no build node; 1 of 4 movers",
"TIER 1 MOVER OUTCOME BUILD LINT UNIT INTEGRATION VALIDATE COMPOSITION CODE REVIEW APPROVAL N1 N2 N3",
"alpha passed passed 2/3 - - - - - passed - running the pipeline's build running the pipeline's build -",
"alpha passed passed - - - - - passed - running the pipeline's build running the pipeline's build -",
"delta passed - - - - - - - - - - -", "TIER 2",
"beta failed - - could not run 1/2 - - - - waiting wanted applying no want written",
"gamma passed - - - - - - - - held: connection refused held: health failed on n1 -"}},
@@ -72,7 +72,8 @@ type MoverStage struct {
Nodes []NodeCell `json:"nodes"`
}
// StageCell is one stage of one mover: the worst outcome over its artifacts, how many hold it of how many, and each
// StageCell is one stage of one mover: the worst outcome over its artifacts, how many are in its group (failed, not run,
// waiting, running, passed) of how many, and each
// artifact's waited, ran and why, shown on hover.
type StageCell struct {
Outcome string `json:"outcome,omitempty"`
@@ -81,9 +82,10 @@ type StageCell struct {
Steps []string `json:"steps,omitempty"`
}
// Text is the cell's outcome, with the count where the stage has several artifacts (H-A-531 addendum (3)).
// Text is the cell's outcome, with how many artifacts are in its group where fewer than all are (H-A-531 addendum (3), as read
// in hq d7e7d204): passed, carried and passed read "passed"; failed, passed and passed "failed 1/3".
func (c StageCell) Text() string {
if c.Of > 1 {
if c.Count < c.Of {
return fmt.Sprintf("%s %d/%d", c.Outcome, c.Count, c.Of)
}
return c.Outcome
@@ -133,7 +135,7 @@ func stageCell(steps []seat.StepResult, now time.Time) StageCell {
switch r := stepRank(s.Outcome); {
case r > worst:
worst, c.Outcome, c.Count = r, s.Outcome, 1
case s.Outcome == c.Outcome:
case r == worst:
c.Count++
}
waited, ran := waitedRan(s, now)