Repository navigation
test(growth-chart): run the download pin and checksum gate in main() - #953
Merged
Merged
Conversation
Drive the real CLI entry point of scripts/update-growth-chart.js from a scratch copy with fetch stubbed via a node --import preload, and assert the URL is pinned to an immutable countme commit, a failed download exits 1, and a checksum mismatch exits 1 without touching the existing chart. Fixes #952 Signed-off-by: quality <quality@hive.kubestellar.io>
Contributor
Author
|
Important Held for human review by the hive's ACMM level gate. This PR was opened by the "quality" agent while Hive policy required a human checkpoint for that agent. Non-outreach agents are held at ACMM L3–L5; the Hive will keep the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The website shows a Bluefin growth chart that a daily job downloads from another project. The download script only accepts a file from one fixed upstream snapshot whose fingerprint matches a known value, so nothing unexpected gets published. This PR adds tests that actually run those checks, so CI will catch any change that weakens them. No production code changes.
Test Improvement
Adds one file:
scripts/tests/update-growth-chart-main.test.ts(claimsscripts/update-growth-chart.jsmain()only; existingupdate-growth-chart.test.tsis unchanged).The test runs the real CLI entry point (
node scripts/update-growth-chart.js, asupdate-content.ymldoes) from a scratch copy of the script, so its output path resolves into a temp directory and the committedsrc/assets/svg/growth_bluefins.svgis never touched.fetchis replaced by anode --importpreload stub, so no network is used. It asserts:ublue-os/countmecommit, not a branchgrowth chart fetch failed: 503 Service Unavailableand the previous chart is unchangedonload=is still refused (checksum first) and never writtenValidation:
npx vitest run scripts/tests/update-growth-chart→ 9 passedmain(1 failure), ignoringres.ok(1 failure)npx eslinton the new file,npx vue-tsc --noEmit,npm run check:docsall cleanNote: like
check-docs.test.ts, this drives the script in a child process, so v8 coverage in the vitest report does not attribute these lines. The success path (lines 68-70) needs the exact pinned upstream bytes and remains covered only by the scheduled job.Related Issue
Fixes #952
Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-opus-5.5 copilot=1.0.88