Skip to content

Fix: Count checksums files from v0.1-v0.4 in install stats - #1368

Merged
mrsabath merged 1 commit into
mainfrom
fix/checksums-pattern
Oct 13, 2026
Merged

mrsabath merged 1 commit into
mainfrom
fix/checksums-pattern

Conversation

@mrsabath

@mrsabath mrsabath commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

Closes #1367.

The bug

platform_of in scripts/collect-install-stats.sh anchored its checksums test:

elif $name | test("^checksums")   then "checksums"

v0.1 through v0.4 published the file as kagenti-extensions_<ver>_checksums.txt, which does not start with checksums. Those 24 releases were filed under other and read 0 installs apiece.

checksums.txt is the page's primary install metric, so:

Downloads invisible to the collector 79
All-time total, before 257
All-time total, actual 338
Releases reporting a real count 19 → 43

A 24% understatement. Found by @huang195 during review of #1351, where 26 of 42 by-release rows disagreed with their halved-tarball counts by more than rounding explains — the page blamed people fetching tarballs without the installer, and the real cause was this.

The fix

Drop the anchor. Verified against every asset the repo has ever published:

  • Exactly two naming variants exist — checksums.txt and kagenti-extensions_<ver>_checksums.txt. Both now match.
  • Nothing is reclassified. Zero assets have checksums in the name and are also a .tar.gz, so no tarball moves. The platform tests still run first in the elif chain.
  • After the change the other bucket is empty — it held exactly the 79, all of which moved to checksums.

Repairing the published series

#1367 raised this as an open decision: the fix would otherwise show a one-day jump of ~79 in a column whose daily deltas are 1-5.

The series is repaired on the way past instead. Those downloads were counted all along, just under the wrong key, so moving totals.other into totals.checksums is exact arithmetic rather than a guess — and the data confirms it, since other is a constant 79 across every published snapshot.

Checked against the five live snapshots:

date before after daily delta before → after
2026-10-09 246 325 —
2026-10-10 248 327 2 → 2
2026-10-11 249 328 1 → 1
2026-10-12 254 333 5 → 5
2026-10-13 257 338 3 → 5 ¹

Each historical snapshot gains exactly 79, other disappears, and the daily deltas the page renders are unchanged.

¹ Oct 13 is the snapshot being re-collected this run, so it also picked up two genuinely new downloads since the morning cron. In production the cron never re-collects a past day, so historical deltas stay frozen.

The repair keys on the presence of other, so it is a no-op once every snapshot has been through it — no version flag, no cutoff date to maintain. Verified idempotent: a second run leaves five snapshots, zero other, same total.

Per-release figures inside each snapshot are deliberately untouched. They are already correct under the new pattern and are what a future reader would recompute from.

Scope

One file, one pattern change plus the repair pass. No change to the page, the workflow, or the daily table's logic.

Note

The daily series was never wrong — every affected release is from 2026-02 to 2026-04 and sits at a flat dl=3, so they contributed nothing to day-over-day deltas. This corrupted lifetime readings only. The four days of live data since #1345 merged (net installs 1/0/2/1) are unaffected.

Assisted-By: Claude (Anthropic AI) [email protected]

Summary by CodeRabbit

  • Bug Fixes
    • Checksum assets are now categorized correctly when “checksums” appears anywhere in the asset name.
    • Historical install statistics with a positive “other” total now have that amount counted under checksums instead. Other historical snapshots remain unchanged.

Closes #1367.

platform_of anchored its checksums test at the start of the name, but
v0.1 through v0.4 published the file as
kagenti-extensions_<ver>_checksums.txt. Those 24 releases were filed under
"other" and read 0 installs apiece: 79 downloads invisible, and the
all-time total understated by 24%.

Dropping the anchor fixes it. Verified against every asset the repo has
ever published: exactly two naming variants exist and both now match, no
asset has "checksums" in a tarball name so nothing is reclassified, and
the platform tests still run first. After the change the "other" bucket is
empty and 43 releases report a real install count, against 19 before.

Historical snapshots are repaired on the way past rather than left with a
seam. The misclassified downloads were counted all along -- just under the
wrong key -- so moving totals.other into totals.checksums is exact
arithmetic. Checked against the five published snapshots: each gains
exactly 79, "other" disappears, and the daily deltas the page renders are
unchanged (2/1/5). Without it the series would show a one-day jump of ~79
in a column whose deltas are 1-5.

The repair keys on the presence of "other", so it is a no-op once every
snapshot has been through it -- no version flag, no cutoff date. Verified
idempotent: a second run leaves five snapshots, zero "other", same total.

Per-release figures inside each snapshot are deliberately untouched. They
are already correct under the new pattern and are what a future reader
would recompute from.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Mariusz Sabath <[email protected]>
@coderabbitai

coderabbitai Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 36fb204d-c251-4ffa-bd7d-a75c40afd99c
📥 Commits

Reviewing files that changed from the base of the PR and between 7821df6 and ceb5c61.

📒 Files selected for processing (1)
  • scripts/collect-install-stats.sh

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

📝 Walkthrough

The install-stats collector now classifies assets containing checksums as checksum assets. Before merging a new snapshot, it transfers positive totals.other values in retained snapshots to totals.checksums.

Changes: Install statistics collection

Layer / File(s) Summary
Checksum classification and snapshot totals
scripts/collect-install-stats.sh
The classifier matches checksums anywhere in an asset name. Before merging, retained snapshots with a positive totals.other value transfer that amount to totals.checksums and remove totals.other. The collector still replaces the current date’s snapshot and sorts snapshots by date.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: abigailgold

Merge Risk: ⚪ Minimal · up to ceb5c

The change reclassifies checksum downloads in the totals without changing the aggregate count. Current asset naming shows no tarball conflict. The historical snapshot records needed to confirm whether old per-release rows also need correction are unavailable; no concrete merge-blocking issue is established.

Pre-merge checks · Passed 5
Passed Passed checks (5 passed)
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly identifies the main change: counting checksum files from versions v0.1 through v0.4 in install statistics.
Linked Issues check Passed The change satisfies the coding requirements in [#1367]. platform_of now matches both checksums.txt and kagenti-extensions_<ver>_checksums.txt. The existing platform checks run first. The repair…
Out of Scope Changes check Passed The diff changes only scripts/collect-install-stats.sh. The pattern change and historical snapshot repair directly implement [#1367]. The added comments document the fix and remain within scope. No …
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • 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.

@evaline-ju evaline-ju left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Verified against GitHub's actual release asset lists: 24 kagenti-named releases (v0.1-v0.4) exist with kagenti-extensions_<ver>_checksums.txt, the newer v0.7+ releases use checksums.txt, and no tarball name contains "checksums" — so dropping the anchor matches both variants without over-matching. The jq repair pass is exact arithmetic (relocating a constant other = 79 into checksums) rather than an estimate, correctly scoped to historical snapshots only, and idempotent via the .totals.other // 0 > 0 guard.

Author: mrsabath (MEMBER) · CI green

@mrsabath
mrsabath merged commit aa391a1 into main Oct 13, 2026
30 checks passed
@github-project-automation github-project-automation Bot moved this from New/ToDo to Done in Rossoctl Issue Prioritization Oct 13, 2026
@mrsabath
mrsabath deleted the fix/checksums-pattern branch October 13, 2026 16:38
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.

Fix: install-stats collector misses checksums files from v0.1-v0.4, understating the all-time total by 24%

2 participants