Skip to content

ci: speed up Nix release setup - #264

Merged
robjtede merged 1 commit into
mainfrom
agent/ci-fast-nix-no-cache
Aug 2, 2026
Merged

ci: speed up Nix release setup#264
robjtede merged 1 commit into
mainfrom
agent/ci-fast-nix-no-cache

Conversation

@robjtede

@robjtede robjtede commented Aug 2, 2026

Copy link
Copy Markdown
Member

Summary

  • install Nix with nix-quick-install-action on the Blacksmith release runner
  • remove the FlakeHub cache from the release job
  • keep nix-develop as a separate step
  • add a focused .#ci-release shell containing only the x52 release tools
  • keep the full default development shell unchanged

Why

The latest Blacksmith release run spent most of its time setting up and uploading a cache for a very small Nix-backed operation:

Step Duration
Install Determinate Nix 31s
Set up FlakeHub Cache 6s
Enter full dev shell 16s
Bump changelog versions 2s
FlakeHub Cache post-step 2m35s

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-changelogs
  • nix develop .#ci-release -c command -v x52-update-release-notes
  • nix flake check --no-build --all-systems

The release workflow runs only after pushes to main, so this PR cannot provide a direct after-change release timing before merge.

@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The flake adds a devShells.release shell with x52-release-tools. The release workflow replaces its Nix setup and enters .#release while preserving its existing execution condition.

Changes

Release devShell integration

Layer / File(s) Summary
Configure release shell and workflow
.github/workflows/release.yml, flake.nix
The flake exposes x52-release-tools through devShells.release. The workflow uses nix-quick-install-action and enters .#release for created pull requests or releases.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • x52dev/protobug#245: Extends the same release workflow and Nix development shell integration.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: reducing the time required to set up Nix for releases in CI.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch agent/ci-fast-nix-no-cache

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@robjtede
robjtede marked this pull request as ready for review August 2, 2026 02:16
@robjtede
robjtede force-pushed the agent/ci-fast-nix-no-cache branch from 5f01d80 to ad22b79 Compare August 2, 2026 02:16
@robjtede
robjtede merged commit a3b76aa into main Aug 2, 2026
7 of 8 checks passed
@robjtede
robjtede deleted the agent/ci-fast-nix-no-cache branch August 2, 2026 02:21

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
flake.nix (1)

18-20: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Use pkgs.mkShellNoCC for the release-only shell.

devShells.ci-release only needs x52-release-tools. pkgs.mkShell adds the standard compiler toolchain when one is not required, while pkgs.mkShellNoCC keeps 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

📥 Commits

Reviewing files that changed from the base of the PR and between 4ab2962 and 5f01d80.

📒 Files selected for processing (2)
  • .github/workflows/release.yml
  • flake.nix

Comment thread .github/workflows/release.yml Outdated
Comment on lines +41 to +49
- 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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 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-notes

Repository: 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 || true

Repository: 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:


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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant