Repository navigation
fix(scala-ci): install the sbt launcher from a pinned-hash download with a stable-path cache - #49
Closed
monsieurleberre wants to merge 1 commit into
Closed
monsieurleberre wants to merge 1 commit into
monsieurleberre wants to merge 1 commit into
Conversation
Contributor
Author
|
Superseded by #50, which carries the review fixes on a fresh branch. |
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, keyedsbt-launcher-<os>-<arch>-<version>;curl --fail --locationdownload ofsbt-<version>.zipfrom the sbt release, with connect and total timeouts. The zip is checked against a pinned SHA-256 and the step fails closed, on every OS, where ampel only monitored on Linux. Then it is unzipped;actions/cache/saveright after the install, 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
A draft PR pointed one consumer's
scala-cicall at this branch: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.
actionlint is clean.