mirror of
https://github.com/garrytan/gstack.git
synced 2026-11-30 11:53:55 +01:00
The factory scorecard counts each merge batch once in its red rate, not every re-run (GST-4128) (#4880)
The factory scorecard's red rate now counts each tested batch of PRs once, by its branch, so re-testing the same batch (a bisect or a rebuild) no longer moves it. Why: a red batch that was bisected and rebuilt added extra runs to both the red count and the total, so the rate could swing without any new batch running (#4767). Nothing to do: the row's name, its target and the published week's number (1 red of 22, recounted) stay the same. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
This commit is contained in:
1 parent
5bf787370c
commit
e8319ea59a
4 files changed
+30
-4
No files matched your search
@@ -425,7 +425,9 @@ export function scorecardRows(card: Scorecard): ScorecardRow[] {
|
||||
const by = (outcome: GateOutcome, kind?: GateKind) => gates.filter(g => g.outcome === outcome && (!kind || g.kind === kind)).length;
|
||||
const known = gates.filter(g => g.costUsd !== null);
|
||||
const knownUsd = known.reduce((s, g) => s + g.costUsd!, 0);
|
||||
const trains = gates.filter(g => g.kind === 'train' && g.outcome !== 'cancelled');
|
||||
const trainRed = new Map<string, boolean>();
|
||||
for (const g of gates) if (g.kind === 'train' && g.outcome !== 'cancelled') trainRed.set(g.branch, trainRed.get(g.branch) || g.outcome === 'red');
|
||||
const redTrains = [...trainRed.values()].filter(Boolean).length;
|
||||
const flakes = gates.reduce((s, g) => s + g.flakes, 0);
|
||||
const flakeUsd = gates.reduce((s, g) => s + g.flakeRerunUsd, 0);
|
||||
const retries = card.freeRuns.reduce((s, r) => s + (r.retries ?? 0), 0);
|
||||
@@ -453,8 +455,8 @@ export function scorecardRows(card: Scorecard): ScorecardRow[] {
|
||||
'completed runs of the gate workflow in the window; cost from the verdict artifact, else the PR verdict comment (one run per PR)'),
|
||||
row('cost_per_merge', 'Known gate cost per merged PR', ['gate runs', 'merged PRs'], () => (card.prs.length ? `${usd(knownUsd / card.prs.length)} (${gates.length - known.length} runs without a known cost)` : 'n/a (no merges)'),
|
||||
'known gate cost divided by merged PRs; unknown-cost runs make this a floor'),
|
||||
row('red_train', 'Red-train rate', 'gate runs', () => `${pct(trains.filter(t => t.outcome === 'red').length, trains.length)} (${trains.filter(t => t.outcome === 'red').length} red of ${trains.length} trains; ${by('red', 'backstop')} red backstop, ${by('red', 'screen')} red screens)`,
|
||||
`runs whose head branch starts with the train prefix, cancelled runs excluded; red means the run's conclusion was not success`),
|
||||
row('red_train', 'Red-train rate', 'gate runs', () => `${pct(redTrains, trainRed.size)} (${redTrains} red of ${trainRed.size} trains; ${by('red', 'backstop')} red backstop, ${by('red', 'screen')} red screens)`,
|
||||
'distinct head branches starting with the train prefix, each counted once; cancelled runs excluded, and a branch with only cancelled runs left out; a train is red when any of its non-cancelled runs did not succeed, even if a later rebuild did'),
|
||||
row('flaky', 'Flaky events', [], () => `${unavailable('gate runs') ? unavailableText('gate runs') : paidFlakes()}; ${unavailable('free retries') ? unavailableText('free retries') : freeRetries()}`,
|
||||
`flake-records artifacts of the newest ${card.artifactRunsRead} gate runs and flake-ledger artifacts of free runs on the base branch, reused main pushes left out`),
|
||||
row('issues', 'Issues opened / closed', 'issues', () => `${card.issuesOpened ?? 'n/a'} / ${card.issuesClosed ?? 'n/a'}`, 'GitHub search: created, closed inside the window'),
|
||||
|
||||
Reference in new issue
Block a user