Repository navigation
Fix: Count a smoke job's install when the job fails after installing - #1457
Conversation
The install-stats collector counted each smoke run's CI installs as its successful jobs. But the fresh install is the first thing a job does, so a job that fails a later check has already installed, and its install was read as a real person. Run 38583376563 did this on Oct 14: it installed v0.8.1, failed its upgrade on an HTTP 500 from GitHub, and was recorded as 0, so the 10-15 row reads 9 people where 8 is right. A job now counts when its "Run the Linux release smoke test" step ran, passed or failed. Success is kept as a fallback, so renaming the step brings back the old undercount instead of zeroing CI. Records gain installs_rule: "step", and older records without it are queried once more, so the Oct 14 run is corrected retroactively. Also from #1405's review: per_page=100 on the jobs query, and the stale mergeRunTimes name. The page's labels and the workflow header now say "job that ran" rather than "successful job". Fixes #1455 Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Alan Cha <[email protected]>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 45 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
huang195
left a comment
There was a problem hiding this comment.
Summary
The new rule is right, and the PR's numbers reproduce. I ran the head collector against a copy of the live gh-pages data.json. Cold, it queried 100 runs in 49s. Warm, it queried 0. Exactly one stored count changed: 38583376563, 0 → 1. It is the only failure among all 158 runs the workflow has ever had, and none of the 158 has a run_attempt above 1, so "no re-runs yet" is true too. I also rendered the page's <script> in node at base and head. The daily table changes only on 2026-10-15: CI 12 → 13, people 9 → 8. The filter gives the right answer on the failed run's real jobs response (the step reads failure, so it counts 1). On real cancelled jobs from release-binaries.yaml, a step that started reads cancelled (counts), and a step that never started reads skipped (does not count).
One correction for the PR body: "Every other row is unchanged" holds for the daily table only. The by-release table moves too: v0.9.0-rc.3's CI Tests goes 38 → 39. Its Linux cell stays ~0.
Outside the diff, two things:
CONTRIBUTING.md:294-300was missed by the wording sweep. It still says "one install per successful run", and it tells readers to updateCI_INSTALLS_PER_RUNinindex.html. That constant no longer exists anywhere in the tree. Since this PR rewrites the rule in every other place it is described, this paragraph should get the same treatment.- Older problem, not this PR's: that rc.3 row shows the by-release table charging main-push runs to pre-releases. On a push to main the smoke test fresh-installs the newest stable tag (
main-latest→sort -V | tail -1of the stable list), and that was v0.8.1 for the whole rc window. All 39 runs in rc.3's window were main pushes. So their installs landed on v0.8.1, but the page subtracts them from rc.3: 39 CI against a Linux figure of about 1, hence~0. Meanwhile v0.8.1 shows≤85net of only≥8. The page comment says pre-release rows count "what the tag's OWN push-run upgraded onto", which is one run, not the whole window. Up to you whether that belongs here or with whoever owns the page next.
Author: Alan-Cha (MEMBER — maintainer)
Areas reviewed: Shell (collector), CI/GitHub Actions (smoke workflow comments), Docs/Frontend (install-stats page)
Agent/IDE config (.claude/.vscode): none
Commits: 1 commit, all signed-off: yes
CI status: passing
Assisted-By: Claude (Anthropic AI) [email protected]
| # | ||
| # Keyed on the id alone, so a snapshot written before this change -- whose runs | ||
| # carry no `installs` -- contributes nothing here and gets queried properly. | ||
| # "Rarely", not never: "Re-run failed jobs" keeps the run id, so a leg re-run |
There was a problem hiding this comment.
suggestion: The fix this paragraph describes (store run_attempt, re-query when it rises) would still miscount with the jq below. The jobs endpoint defaults to filter=latest. After a re-run, that returns every job with the new run_attempt, including copies of the jobs that were not re-run.
I checked this on a real re-run, CI run 39469900873. One job (core peerproc, macOS) was re-run. filter=latest lists all 15 jobs with run_attempt: 2. The 14 that did not re-run have new job ids, but they keep attempt 1's started_at/completed_at and its steps.
So for a smoke run whose arm64 leg failed and was re-run, re-querying gives 2, but 3 installs happened: amd64 once, arm64 twice. Exact would need ?filter=all, then dropping the carried-over copies (a job whose name and started_at match a job from an earlier attempt). Worth saying in this comment, so whoever picks it up doesn't ship the half-fix.
| # steady state is the handful of runs since yesterday. | ||
| # | ||
| # Only counts carrying installs_rule "step" are reused. A count recorded without | ||
| # it was taken under the old successful-jobs rule (#1455), so that run is queried |
There was a problem hiding this comment.
nit: "that run is queried once more" holds only for runs still in the API's last-100 window. The loop walks ${pairs}, which comes from the 100-run query, so an old-rule record that has already dropped out of the window is never re-queried. It keeps its successful-jobs count, with no rule marker, for good.
Today 58 of the workflow's 158 runs are outside the window. None of them failed, so no number changes. But this sentence, and "corrects the counts already in data.json retroactively" in the PR body, read as if they cover the whole series. Suggest "a run still in the last-100 window is queried once more".
Also, the record shape is still written as {id, created_at, installs} at L124 and L329, without the new installs_rule.
| each job installs three times, but on a push to main the other two land on | ||
| <code>main-latest</code>, whose counts reset on every push and are excluded | ||
| here. The test runs an architecture matrix, so a run is worth as many installs | ||
| as it had legs run; |
There was a problem hiding this comment.
nit: "as many installs as it had legs run" reads as a typo. Same at L127 ("as it had legs run, passing or not"). Suggest "as many installs as it had legs that ran".
Docs: Correct install-stats collector comments from #1457's review
…eview Comment and wording fixes only; no behaviour changes. - The re-run note described a fix that would still miscount. The jobs endpoint defaults to filter=latest, which lists every job under the new attempt, so re-querying when run_attempt rises counts a failed-then-re-run leg once instead of twice. It now says an exact count needs filter=all with the carried-over copies dropped. - "That run is queried once more" held only for runs still in the last-100 window. Older records keep their old count. None of them failed, so the two rules agree on all of them. - The record shape comments now include installs_rule. - "had legs run" on the install-stats page is now "had legs that ran". Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Alan Cha <[email protected]>
Fixes #1455.
Summary
Run the Linux release smoke teststep ran, passed or failed. A skipped job, or one that failed before that step, still counts 0.installs_rule: "step". Records without it are queried once more, which corrects the counts already indata.jsonretroactively.?per_page=100on the jobs query, and the stalemergeRunTimesname inindex.html.Effect on published figures
Only one run in the series changes: 38583376563 (Oct 14) installed v0.8.1, then failed its upgrade on an HTTP 500 from GitHub. It goes from 0 installs to 1, so the 2026-10-15 row goes from 12 CI / 9 people to 13 CI / 8 people. Every other row is unchanged.
Not fixed here
Test plan
shellcheckandsh -nclean on the collector. Workflow YAML parses.data.json. Cold, it queried all 100 runs in 73s. Warm, it queried 0 in 5.6s, so reuse works. Exactly one run's count changed (38583376563, 0 → 1), and all 100 records carry the new rule.mergeRuns,runsBetweenandpeople(): only the 10-15 row differs. Node wasn't available, so the page itself wasn't driven.install-stats.yamlrun should printnewly-queried runs: ~100once, then a handful on later days. The Oct 14 run is about halfway through the API's last-100 window, so this needs to merge within a few days to correct it.Assisted-By: Claude (Anthropic AI) [email protected]