Repository navigation
feat(nix-cache-push): add opt-in verify that fails on a missing upload - #3
Merged
Merged
Conversation
A refused upload was only a warning, so an expired push token left every job green and the cache without its builds. verify: "true" fails the job and reads each pushed path back from the cache; the default stays warn-only.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
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.
What
nix-cache-pushgets an opt-in inputverify(default"false"). Withverify: "true":::error::) instead of warning and exiting 0;<endpoint>/<cache>/<hash>.narinfo,Authorization: Bearerwith the push token, which can pull; the token goes to curl through a config on stdin, not argv). Any answer but 200 fails the job and names the path and the HTTP code.Default behaviour is unchanged: every failure still warns and exits 0, so no current consumer changes. The
add-an-action.mdrule ("must not fail the job when the cache is unavailable") now names this opt-in as the exception;actions.mddocuments the input.Why
The CI push token (
NIX_CACHE_PUSH_TOKEN) has been refused withError: Unauthorizedsince 1-2 Nov 2026 in genlayer-node (last good run 41236365964, 31 Oct 19:54Z) and genlayer-consensus (last good run 41220838821, 31 Oct 16:40Z). This action turned that into::warning::attic push failed, so every job stayed green and no build reached the cache for 8 days. Only consensus's release workflow noticed, through its own extra check. [Inference] The token was minted with--validity '90d'(devexp-nix-cache bootstrap step 6) and expired; pulls still authenticate.Node and consensus each grew an inline check after this action. With
verifythe check lives here once, and each repo sets one input:nix-build.yml, which is also the vX.Y release gate) — already points at this branch to test it;nix-build.ymlandrelease-tag.yml).Tests
Step script extracted with
yqand run against stubnix/atticand the real cache (a pull token stands in for the push token on the read-back):::error::attic push failed …::warning::(as before)verified 3 path(s)HTTP 404::error::line, as beforeHTTP 401shellcheckon the step: clean (except SC2164 on the existingcd; the step runs underbash -e).nix flake check(this repo's CI): pass.verify: "true"; with the expired token it must fail at the push step.Merging is a release to every consumer at
@main; nothing changes for a consumer until it setsverify.