Repository navigation
fix(scala-ci): install the sbt launcher from a pinned-hash download with a stable-path cache - #50
Merged
Conversation
…ith a stable-path cache
Contributor
Author
|
Consumer probe of head 50d0bd6, all
An independent review found no P0/P1. |
monsieurleberre
marked this pull request as ready for review
November 6, 2026 11:21
monsieurleberre
enabled auto-merge (squash)
November 6, 2026 11:21
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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.
Why
On self-hosted ephemeral runners,
sbt/setup-sbt's own cache never hits. Each job gets a fresh$RUNNER_TOOL_CACHE, and that path is part of theactions/cacheversion. So every job downloads sbt again, and setup-sbt then bootstraps ampel from GitHub releases to verify the signature. That bootstrap fails intermittently. The two errors seen so far areampel-v1.3.6.provenance.json: context deadline exceededandcompiling policy: unable to parse a policy, group or policySet from data. Either one fails thebuild-and-testjob, even though ampel runs in monitor-only mode (fail: false).What
In
scala-ci.yaml, thesbt/setup-sbtstep is replaced by:actions/cache/restoreof a fixed~/.cache/sbt-launcher, keyedscala-ci-sbt-launcher-<runner.environment>-<os>-<arch>-<version>.actions/cachestores the path relative to the workspace, and hosted and self-hosted runners lay it out at different depths, so the runner environment is part of the key;sbt/bin/sbtis missing after the restore, not oncache-hitalone;curl --fail --locationdownload ofsbt-<version>.zipfrom the sbt release, with connect and total timeouts. The zip is hashed from stdin, so a Windows backslash path can't corrupt the output, and checked against a pinned SHA-256 and the step fails closed, on every OS, where ampel only monitored on Linux. Then it is unzipped, using POSIX paths viacygpath -uon Windows;actions/cache/saveright after an install, and only then,, so a later build failure still leaves the launcher cached;bindirectory added to PATH, usingcygpath -won Windows.The pinned hash for sbt 2.0.12 is
73f9c4a10584cde3d37d773e2b38d2fc4348c6cef8d88da8b7dd41e7d5f614d7. It matches a localshasum -a 256of the download, the release's publishedsbt-2.0.12.zip.sha256, and the GitHub release-asset digest.Inputs, outputs and secrets are unchanged, so this is a contract-compatible change on v2. The setup-sbt sbt 2.x disk-cache step is dropped; the CHANGELOG notes the drop.
Verified in a consumer
An earlier revision of this change (without the environment-aware key and the stdin hash) was probed in a consumer:
Cache not found for input keys: sbt-launcher-Linux-X64-2.0.12. The download and hash check passed, andCache saved with key: sbt-launcher-Linux-X64-2.0.12. The job is green.Cache hit for: sbt-launcher-Linux-X64-2.0.12. Download and save were skipped, and the job is green.Only the Linux shard ran in that consumer. The Windows and macOS paths have not run on a real runner yet.
The download step was also re-run in
ubuntu:24.04with real and wrong hashes, on plain and backslash temp paths: real hashes install, wrong hashes exit 1 with nothing installed.actionlint is clean.