fix(release): install Nix profile tools after checkout #288

Merged
jwilger merged 1 commit from fix/release-publish-checkout-before-flake-install into main 2026-06-13 07:27:48 -07:00
Owner

Scope of this PR

Fixes the ordering of the release-publish Forgejo workflow so the Nix
profile tools are installed only after the repository is checked out.

What changed

  • .forgejo/workflows/release-publish.yml: move the Install or reuse Nix
    step (which runs nix profile install --inputs-from . nixpkgs#tea nixpkgs#coreutils nixpkgs#gawk nixpkgs#gnused) so it runs after both
    conditional checkout steps (push and workflow_dispatch) rather than
    before them.
  • crates/ar-gateway/tests/ci_workflow_contract.rs: add the
    release_publish_installs_profile_tools_after_checkout contract test that
    asserts both checkout steps precede the --inputs-from . profile install.

Why

nix profile install --inputs-from . resolves its inputs from the flake in
the working tree. Running it before checkout means there is no flake to
resolve against, so on a cold runner the profile-tools install could fail or
resolve against the wrong inputs. Installing after checkout guarantees the
flake is present first; the contract test guards the ordering against
regression.

Verification

  • cargo nextest run -p ar-gateway release_publish — 4 passed.
  • cargo fmt --check and cargo clippy -p ar-gateway --tests — clean.
  • Pre-push full-verification hook passed.

🤖 Generated with Claude Code

## Scope of this PR Fixes the ordering of the `release-publish` Forgejo workflow so the Nix profile tools are installed only after the repository is checked out. ### What changed - `.forgejo/workflows/release-publish.yml`: move the **Install or reuse Nix** step (which runs `nix profile install --inputs-from . nixpkgs#tea nixpkgs#coreutils nixpkgs#gawk nixpkgs#gnused`) so it runs **after** both conditional checkout steps (`push` and `workflow_dispatch`) rather than before them. - `crates/ar-gateway/tests/ci_workflow_contract.rs`: add the `release_publish_installs_profile_tools_after_checkout` contract test that asserts both checkout steps precede the `--inputs-from .` profile install. ### Why `nix profile install --inputs-from .` resolves its inputs from the flake in the working tree. Running it before checkout means there is no flake to resolve against, so on a cold runner the profile-tools install could fail or resolve against the wrong inputs. Installing after checkout guarantees the flake is present first; the contract test guards the ordering against regression. ### Verification - `cargo nextest run -p ar-gateway release_publish` — 4 passed. - `cargo fmt --check` and `cargo clippy -p ar-gateway --tests` — clean. - Pre-push `full-verification` hook passed. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
fix(release): install Nix profile tools after checkout
All checks were successful
CI / Classify changed paths (pull_request) Successful in 2s
CI / Format check (pull_request) Successful in 43s
CI / Clippy (pull_request) Successful in 1m24s
CI / opencode plugin tests (pull_request) Has been skipped
CI / Dependency policy (pull_request) Successful in 14s
CI / Test (pull_request) Successful in 1m4s
CI / Request auto_review semantic review (pull_request) Successful in 2s
auto_review auto_review: no findings
CI / Build (pull_request) Successful in 41s
CI / Build PR artifacts (no token) (pull_request) Has been skipped
d69b263bcf
The release-publish workflow ran `nix profile install --inputs-from .`
before checking out the repository. With no working tree present there is
no flake for `--inputs-from .` to resolve against, so on a cold runner the
profile-tools install (tea, coreutils, gawk, gnused) could fail or resolve
against the wrong inputs.

Move the "Install or reuse Nix" step to run after both conditional checkout
steps (push and workflow_dispatch) so the flake is always present first, and
add the `release_publish_installs_profile_tools_after_checkout` contract test
to guard the ordering against regression.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
auto-review left a comment

The PR fixes the order of operations in the release-publish workflow by ensuring the Nix profile tools are installed after the repository is checked out. This change is verified by a new contract test, which guards against future regressions.

LLM usage and cost

The PR fixes the order of operations in the `release-publish` workflow by ensuring the Nix profile tools are installed after the repository is checked out. This change is verified by a new contract test, which guards against future regressions. ## LLM usage and cost - Reasoning (gpt-4o) in=2210 out=216 cost=$0.014290 - Cheap (gpt-4o-mini) in=605 out=43 cost=$0.000117 Estimated total USD: $0.014407 via https://api.openai.com and https://api.openai.com
jwilger scheduled this pull request to auto merge when all checks succeed 2026-06-13 07:27:27 -07:00
jwilger deleted branch fix/release-publish-checkout-before-flake-install 2026-06-13 07:27:48 -07:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Slipstream/auto_review!288
No description provided.