Skip to content

Fix: Count a smoke job's install when the job fails after installing - #1457

Merged
huang195 merged 1 commit into
mainfrom
install-stats-install-step
Oct 20, 2026
Merged

huang195 merged 1 commit into
mainfrom
install-stats-install-step

Conversation

@Alan-Cha

Copy link
Copy Markdown
Member

Fixes #1455.

Summary

  • The install-stats collector counted each smoke run's CI installs as its successful jobs. The fresh install is the first thing a job does, so a job that fails a later check has already installed, and that install showed up on the page as a real person.
  • A job now counts when its Run the Linux release smoke test step ran, passed or failed. A skipped job, or one that failed before that step, still counts 0.
  • Each record gains installs_rule: "step". Records without it are queried once more, which corrects the counts already in data.json retroactively.
  • Also folds in Feat: Add an arm64 leg to the Linux release smoke test #1405's two review nits: ?per_page=100 on the jobs query, and the stale mergeRunTimes name in index.html.
  • The page's labels and comments, and the workflow header, now say "job that ran" instead of "successful job". The workflow step gets a comment saying the collector matches it by name.

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

  • Late re-runs. "Re-run failed jobs" keeps the run ID, and the collector never queries a counted run again, so a leg re-run after counting would read as a person. No smoke run has ever been re-run. The collector comment now says this and how to fix it if it starts happening.
  • Failure before the install. A job that fails inside the step but before the fresh install (for example, while resolving tags) counts 1 having installed nothing. It hasn't happened. Making it exact would mean splitting the install into its own workflow step.

Test plan

  • shellcheck and sh -n clean on the collector. Workflow YAML parses.
  • Ran the new jq filter on real API responses: a passing two-leg run (2, unchanged), the Oct 14 failed run (0 → 1), and a skipped run (0, unchanged). Ran it on synthetic jobs covering a failure before the step, a cancelled step, and a renamed step.
  • Ran the collector against a copy of the published 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.
  • Recomputed the daily table from both files with jq, mirroring mergeRuns, runsBetween and people(): only the 10-15 row differs. Node wasn't available, so the page itself wasn't driven.
  • After merge, the next daily install-stats.yaml run should print newly-queried runs: ~100 once, 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]

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]>
@Alan-Cha
Alan-Cha requested review from a team, huang195 and rubambiza as code owners October 20, 2026 19:41
@coderabbitai

coderabbitai Bot commented Oct 20, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You'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.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: cd67aee8-74df-4029-8a0b-8d54d959ab5b
📥 Commits

Reviewing files that changed from the base of the PR and between 8709361 and ee02af3.

📒 Files selected for processing: 3
  • .github/workflows/release-smoke-linux.yaml
  • docs/install-stats/index.html
  • scripts/collect-install-stats.sh
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@huang195 huang195 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-300 was missed by the wording sweep. It still says "one install per successful run", and it tells readers to update CI_INSTALLS_PER_RUN in index.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 -1 of 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 ≤85 net 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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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".

@huang195
huang195 merged commit 54c75d0 into main Oct 20, 2026
30 checks passed
@github-project-automation github-project-automation Bot moved this from New/ToDo to Done in Rossoctl Issue Prioritization Oct 20, 2026
@huang195
huang195 deleted the install-stats-install-step branch October 20, 2026 20:38
huang195 added a commit that referenced this pull request Oct 21, 2026
Docs: Correct install-stats collector comments from #1457's review
evaline-ju pushed a commit to evaline-ju/cortex that referenced this pull request Oct 22, 2026
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

bug: install-stats counts a smoke job that installed then failed as 0 CI installs

2 participants