ci: run arcup installer shell tests and shellcheck - #247
Conversation
arcup/test_arcup.sh has 25 assertions covering release-target mapping, SHA-256 checksum verification, GitHub token/gh/curl download fallbacks, tar path-traversal rejection, and symlink rejection during install. No workflow or Make target ran it, so the installer every node operator pipes into bash had no CI coverage and regressions could land silently. Add a 'make test-arcup' target that discovers arcup/test_*.sh and arcup/*_test.sh, wire it into test-all, and add a standalone 'Arcup Installer' CI job that also runs shellcheck over arcup/arcup and arcup/install. Both scripts are shellcheck-clean today, so the job passes on main as-is. The suite glob keeps future arcup test files covered without a further CI change.
|
Ran this locally against current Claims verified:
One timing note in this PR's favor: #243 (just opened) adds regression tests to this exact suite for a checksum-verification edge case — and they only ever run if something like this lands. The two PRs compose cleanly with no overlap: #243 touches Only real design question is the one the author already flagged — standalone job vs. folding into an existing one. Standalone seems right to me: the job has zero toolchain deps, so folding it into a Rust job would couple a ~1-minute shell check to a much heavier setup for no gain, and a dedicated job name makes an installer regression legible at a glance in the checks list. |
|
Thanks for taking the time to run this locally — checking the raw patch On shellcheck: you're right that the job leans on ubuntu-latest shipping it Good catch on #243 composing with this — worth noting the direction of the And agreed on standalone vs folded. Still happy to fold it into an existing |
|
On the shellcheck guard question — the repo's own CI answers it. Looking at One nuance worth deciding deliberately rather than by accident: the two sources ship different shellcheck versions. The ubuntu-latest image bundles a recent release, while
I'd take always-apt for the convention match and determinism; both scripts pass under 0.9.x-era checks anyway given they're clean under the newer one (the check set mostly grows, and the handful of removed/renumbered checks don't apply to code that's warning-free). Either choice is a one-line push — the job design itself doesn't move. |
`.github/scripts/test-finalize-release.sh` covers the release finalizer's
tag and version parsing, and nothing invokes it — not CI, not the
Makefile, not another script:
$ grep -rn "test-finalize-release" .github/ Makefile \
| grep -v "^.github/scripts/test-finalize-release.sh"
(no matches)
Add a `make test-finalize-release` target and a standalone CI job that
calls it. No toolchain and no network, so it runs in parallel with
everything else and finishes in seconds.
The target mirrors the `test-arcup` pattern in circlefin#247, which covers the
other orphaned suite (`arcup/test_arcup.sh`) more thoroughly than an
earlier revision of this branch did. Scoped down to the finalize-release
half so the two compose instead of colliding: circlefin#247 anchors its job after
`proto` and its target before `test-all`, this one anchors before
`docker-build` and after `test-all`, so the diffs do not overlap.
`test-all` deliberately left alone — it is a single line both PRs would
otherwise touch. Happy to add this target to it in a follow-up once circlefin#247
lands.
Closes circlefin#248
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The job relied on ubuntu-latest shipping shellcheck, which made it the one place in ci.yml leaning on the runner image for a tool it depends on — every other job provisions its own (libclang/zlib via apt for the Rust jobs, setup-node, foundry-toolchain, buf-action). Install it via apt using the same phrasing those jobs use, so the lint gate is pinned to the distro package rather than to whatever the image happens to bundle.
|
Went with always-apt — pushed. Convention argument is the persuasive one: One correction on the premise, though, because it makes the choice That doesn't rescue the |
|
You're right, and I checked it against the source rather than taking either of our words for it: the Verified the push ( Where this leaves the PR from my side: every claim in the description verified locally (suite passes from repo root, real tabs, load-bearing |
Summary
arcup/test_arcup.shcontains 25 assertions covering the installer's release-target mapping, SHA-256 checksum verification, GitHub token /gh/curldownload fallbacks, tar path-traversal rejection, and symlink rejection on install.None of them run in CI. Nothing in
.github/workflows/or theMakefilereferencesarcup:So the installer that node operators pipe into
bash— the one that verifies checksums and refuses malicious archives — has no automated coverage, and a regression in it could land silently.Changes
make test-arcuptarget that discoversarcup/test_*.shandarcup/*_test.shand runs each withbash, failing fast on the first non-zero exit.test-arcuptotest-all.Arcup InstallerCI job that runsshellcheckoverarcup/arcupandarcup/install, thenmake test-arcup.The job is deliberately dependency-free: no Rust toolchain, no Foundry, no Docker. It checks out and runs, so it adds roughly a minute of runner time and cannot block the existing jobs.
The glob in the target means future
arcup/*_test.shfiles get picked up without another CI change.Verification
Both scripts are already shellcheck-clean, so the new job passes on
mainas-is — this change surfaces existing coverage rather than introducing new failures.Notes
Happy to adjust — if these tests are already covered by an internal pipeline, or if you'd rather fold the step into an existing job than add a new one, say the word and I'll rework it.