ci: push to the niks3 cache at build time through one composite action #477

Merged
natsukium merged 3 commits from ci/niks3-push-action into main 2026-09-26 12:23:57 +09:00
Owner

Two commits:

  1. One composite action for the niks3 push. The OIDC-token exchange and niks3 push were copied into four jobs and had drifted (readlink -f result in two, nix path-info .#felis in two). .forgejo/actions/niks3-push carries the one copy and resolves the path with nix path-info.
  2. Push at build time, not behind the smoke. The derivation is content-addressed, so a revision the cache lacks still builds to the same store path for a user; gating the cache withheld only speed. The push now runs in the job that builds the package: pr.yml linux-smoke and darwin.yml darwin-build on a push to main, and release.yml linux-smoke / darwin-package (renamed from darwin-publish) on a tag, after the identity check. linux-publish and darwin-publish are gone. The release page still waits on every job of the tag's chains (its needs: now names flake-check, build and proto-compat directly, which it previously reached through the publish jobs). Pull requests never push.

Docs: the decision in explanation/testing.md ("The cache is a substituter; the release is the claim", with the rejected per-target publish job and a Revisit if) and the facts in reference/workspace.md follow.

Not exercised by this PR's own CI: pushes happen only on main and tags. The first main run after merge is the check. Conflicts textually with #485 in explanation/testing.md; whichever merges second takes the other's structure.

Two commits: 1. **One composite action for the niks3 push.** The OIDC-token exchange and `niks3 push` were copied into four jobs and had drifted (`readlink -f result` in two, `nix path-info .#felis` in two). `.forgejo/actions/niks3-push` carries the one copy and resolves the path with `nix path-info`. 2. **Push at build time, not behind the smoke.** The derivation is content-addressed, so a revision the cache lacks still builds to the same store path for a user; gating the cache withheld only speed. The push now runs in the job that builds the package: `pr.yml` `linux-smoke` and `darwin.yml` `darwin-build` on a push to `main`, and `release.yml` `linux-smoke` / `darwin-package` (renamed from `darwin-publish`) on a tag, after the identity check. `linux-publish` and `darwin-publish` are gone. The release page still waits on every job of the tag's chains (its `needs:` now names flake-check, build and proto-compat directly, which it previously reached through the publish jobs). Pull requests never push. Docs: the decision in `explanation/testing.md` ("The cache is a substituter; the release is the claim", with the rejected per-target publish job and a _Revisit if_) and the facts in `reference/workspace.md` follow. Not exercised by this PR's own CI: pushes happen only on `main` and tags. The first `main` run after merge is the check. Conflicts textually with #485 in `explanation/testing.md`; whichever merges second takes the other's structure.
ci: push to the niks3 cache through one composite action
Some checks failed
darwin / detect relevant changes (pull_request) Successful in 15s
windows / detect relevant changes (pull_request) Successful in 14s
darwin / darwin docs-only no-op (pull_request) Has been skipped
windows / windows docs-only no-op (pull_request) Has been skipped
darwin / build felis (aarch64-darwin) (pull_request) Successful in 55s
darwin / publish felis (aarch64-darwin) (pull_request) Has been skipped
windows / cargo nextest (Windows) (pull_request) Successful in 3m52s
windows / frontend smoke (Windows) (pull_request) Successful in 1m17s
windows / package felis (x86_64-pc-windows-msvc) (pull_request) Has been skipped
pr / nix flake check (pull_request) Successful in 3m7s
pr / cargo build / clippy / test / deny (pull_request) Successful in 4m6s
pr / frontend smoke (x86_64-linux) (pull_request) Has been cancelled
pr / publish felis (x86_64-linux) (pull_request) Has been cancelled
windows / cargo clippy (Windows cross) (pull_request) Has been cancelled
pr / wire schema is compatible with the base (pull_request) Has been cancelled
c9e4d0fb9f
The OIDC-token script and niks3 push were copied into four jobs
(pr.yml, darwin.yml, and both publish jobs in release.yml), and the
copies had already drifted: two resolved the store path with
`readlink -f result`, two with `nix path-info .#felis`. The action takes
the path from `nix path-info`, which works on both runners without
depending on the `result` symlink, so a fix to the token exchange now
lands once.

Assisted-by: Claude Code
natsukium scheduled this pull request to auto merge when all checks succeed 2026-09-26 10:53:50 +09:00
natsukium canceled auto merging this pull request when all checks succeed 2026-09-26 11:15:55 +09:00
ci: push to the niks3 cache as the package builds, not behind the smoke
All checks were successful
windows / detect relevant changes (pull_request) Successful in 14s
windows / windows docs-only no-op (pull_request) Has been skipped
darwin / detect relevant changes (pull_request) Successful in 17s
darwin / darwin docs-only no-op (pull_request) Has been skipped
darwin / build felis (aarch64-darwin) (pull_request) Successful in 55s
windows / cargo nextest (Windows) (pull_request) Successful in 3m6s
windows / frontend smoke (Windows) (pull_request) Successful in 34s
windows / package felis (x86_64-pc-windows-msvc) (pull_request) Has been skipped
pr / nix flake check (pull_request) Successful in 28s
pr / cargo build / clippy / test / deny (pull_request) Successful in 1m57s
pr / wire schema is compatible with the base (pull_request) Successful in 16s
pr / frontend smoke (x86_64-linux) (pull_request) Successful in 28s
windows / cargo clippy (Windows cross) (pull_request) Successful in 16s
d15e8afa43
The cache push waited in its own job (linux-publish, darwin-publish)
until that revision's suite and smoke passed, on the argument that a
cached path is a claim someone installs. It is not: the derivation is
content-addressed, so a revision the cache lacks still builds to the
same store path on a user's machine, and holding the push back withheld
only speed. What a user installs on the project's word is the release,
and release.yml's page still waits on every job of the tag's chains.

The push now runs in the job that builds the package (pr.yml's
linux-smoke and darwin.yml's darwin-build on a push to main, and
release.yml's linux-smoke and the renamed darwin-package on a tag, each
after the identity check). That drops two jobs and a second `nix build`
evaluation per main revision from the runners, and lets the release's
darwin chain start without waiting on the Linux gates. Pull requests
still never push.

Assisted-by: Claude Code
natsukium changed title from ci: push to the niks3 cache through one composite action to ci: push to the niks3 cache at build time through one composite action 2026-09-26 11:18:01 +09:00
natsukium scheduled this pull request to auto merge when all checks succeed 2026-09-26 11:28:56 +09:00
natsukium deleted branch ci/niks3-push-action 2026-09-26 12:23:57 +09:00
Commenting is not possible because the repository is archived.
No description provided.