ci: speed up Nix release setup - #264
Conversation
📝 WalkthroughWalkthroughThe flake adds a ChangesRelease devShell integration
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
5f01d80 to
ad22b79
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
flake.nix (1)
18-20: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick winUse
pkgs.mkShellNoCCfor the release-only shell.
devShells.ci-releaseonly needsx52-release-tools.pkgs.mkShelladds the standard compiler toolchain when one is not required, whilepkgs.mkShellNoCCkeeps the closure smaller.Proposed change
- devShells.ci-release = pkgs.mkShell { + devShells.ci-release = pkgs.mkShellNoCC {🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@flake.nix` around lines 18 - 20, Update the release-only dev shell declaration `devShells.release` to use `pkgs.mkShellNoCC` instead of `pkgs.mkShell`, keeping the existing `packages` list unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/release.yml:
- Around line 41-49: Replace the unsupported nixbuild/nix-quick-install-action
in the Install Nix step with a self-hosted-runner-compatible installer such as
cachix/install-nix-action, preserving the existing release-related condition and
ensuring the subsequent Enter Nix devshell step continues to use the release
environment.
---
Nitpick comments:
In `@flake.nix`:
- Around line 18-20: Update the release-only dev shell declaration
`devShells.release` to use `pkgs.mkShellNoCC` instead of `pkgs.mkShell`, keeping
the existing `packages` list unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 94bcd9b5-2ba8-4660-8d21-261c2c01b4f7
📒 Files selected for processing (2)
.github/workflows/release.ymlflake.nix
| - name: Install Nix | ||
| if: ${{ steps.release-plz.outputs.prs_created == 'true' || steps.release-plz.outputs.releases_created == 'true' }} | ||
| uses: DeterminateSystems/determinate-nix-action@d96678350ffd6a456235832eb11e1c491589b7bb # v3.21.8 | ||
| with: | ||
| extra-conf: lazy-trees = true | ||
|
|
||
| - name: Set up FlakeHub Cache | ||
| if: ${{ steps.release-plz.outputs.prs_created == 'true' || steps.release-plz.outputs.releases_created == 'true' }} | ||
| uses: DeterminateSystems/flakehub-cache-action@77c6bddd7d747943530aaa578c57f233ee5d920e # v3.21.8 | ||
| uses: nixbuild/nix-quick-install-action@9f63be77f412a248c9d9a65a4c82cf066cdf8f0c # v35 | ||
|
|
||
| - name: Enter Nix devshell | ||
| if: ${{ steps.release-plz.outputs.prs_created == 'true' || steps.release-plz.outputs.releases_created == 'true' }} | ||
| uses: nicknovitski/nix-develop@9be7cfb4b10451d3390a75dc18ad0465bed4932a # v1.2.1 | ||
| with: | ||
| arguments: .#release |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/usr/bin/env bash
set -euo pipefail
command -v nix
nix --version
command -v x52-bump-changelogs
command -v x52-update-release-notesRepository: x52dev/protobug
Length of output: 153
🏁 Script executed:
#!/usr/bin/env bash
set -euo pipefail
echo "== workflow files =="
git ls-files .github/workflows
echo "== release.yml =="
cat -n .github/workflows/release.yml | sed -n '1,140p'
echo "== release-plz action refs =="
rg -n "release-plz|blacksmith|nix-quick-install-action|nix-develop|runner" .github/workflows release.* 2>/dev/null || trueRepository: x52dev/protobug
Length of output: 7899
🌐 Web query:
nixbuild nix-quick-install-action README supported runners self-hosted
💡 Result:
The nixbuild/nix-quick-install-action currently does not support self-hosted runners [1][2]. The action is explicitly designed for managed GitHub Actions environments and lacks the necessary adaptation for self-hosted infrastructure [3]. Regarding supported platforms, the action officially supports Linux and macOS runners [1][4][2]. Recent updates and CI testing have specifically verified support for various runner types, including ubuntu-22.04, ubuntu-24.04 (arm/aarch64), macos-13, and macos-14 [5]. If you require Nix on a self-hosted runner, the maintainers recommend using alternative Nix installer actions, such as cachix/install-nix-action, which are better suited for those environments [3].
Citations:
- 1: https://github.com/nixbuild/nix-quick-install-action
- 2: https://p.rst.im/q/github.com/nixbuild/nix-quick-install-action
- 3: Installing on a self-hosted runner fails nixbuild/nix-quick-install-action#45
- 4: https://github.com/marketplace/actions/nix-quick-install
- 5: chore(deps): bump nixbuild/nix-quick-install-action from 28 to 30 orhun/binsider#123
Use a Nix installer action supported on self-hosted runners.
blacksmith-2vcpu-ubuntu-2404 is an organization/self-hosted Blacksmith runner, and nixbuild/nix-quick-install-action does not support self-hosted runners. Replace it with a runner-supported option, such as cachix/install-nix-action, so .#ci-release is not skipped and the release commands still run.
[stable_and_availability]
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.github/workflows/release.yml around lines 41 - 49, Replace the unsupported
nixbuild/nix-quick-install-action in the Install Nix step with a
self-hosted-runner-compatible installer such as cachix/install-nix-action,
preserving the existing release-related condition and ensuring the subsequent
Enter Nix devshell step continues to use the release environment.
Summary
nix-quick-install-actionon the Blacksmith release runnernix-developas a separate step.#ci-releaseshell containing only the x52 release toolsWhy
The latest Blacksmith release run spent most of its time setting up and uploading a cache for a very small Nix-backed operation:
The full release job took 4m19s. The Nix setup and cache teardown accounted for 3m28s.
This applies the setup already validated on Blacksmith in x52dev/confik: the pinned quick installer completed in 0–1s and the focused dev shell in 7s, without a cache post-step.
Validation
nix develop .#ci-release -c command -v x52-bump-changelogsnix develop .#ci-release -c command -v x52-update-release-notesnix flake check --no-build --all-systemsThe release workflow runs only after pushes to
main, so this PR cannot provide a direct after-change release timing before merge.