ci: fix Renovate's Nix updates and bump nixpkgs to nixos-26.05 - #257
Conversation
Renovate's post-upgrade tasks fail here, so nix run .#tidy and nix run .#generate never refresh gomod2nix.toml or our generated code. The docker/cli bump in crossplane#253 was opened with go.mod and go.sum alone for this reason. Nix builds without its sandbox in Renovate's container, where HOME is /homeless-shelter on the real filesystem. A build that writes there creates the directory, and Nix then refuses to start any later build. pkgs.gomod2nix is one of the builds that creates it, and it comes from a dependency rather than our own Nix code, so we have nowhere to set a writable HOME. The entrypoint now registers a post-build hook that removes the directory after each build, and sets max-jobs to 1 so no build starts before the cleanup runs. The nix manager is disabled by default, so flake.lock has never been updated here and everything it pins is frozen. This commit enables the manager along with lock file maintenance, on an empty schedule so a refresh can open during any run, and gives it a prPriority that sorts it behind security updates only. Release branches opt out of non-security updates, but they build with Nix too and pick up newer Go versions through the lock file, so a rule re-enables maintenance for them. Renovate installs its own Nix through containerbase whenever it updates flake.lock. That one goes earlier on PATH and ignores /etc/nix/nix.conf, so the entrypoint publishes a crossplane-nix launcher that pins both the binary and the config it reads, and the post-upgrade tasks call it. RENOVATE_ALLOWED_COMMANDS no longer permits a bare nix, so a command still spelled that way fails on the allowlist instead of running against the wrong Nix. RENOVATE_VERSION now pins the version the validator runs and the version the action runs, so the two cannot disagree, and a customManager keeps it current. prConcurrentLimit returns to Renovate's default of 10 and the hourly PR limit is disabled so a backlog drains faster, security fixes skip dependency dashboard approval, and the entrypoint no longer installs Earthly, which nothing in this repo builds with. Signed-off-by: Jared Watts <jbw976@gmail.com>
The nixos-25.11 branch stopped moving at the end of June 2026 when the channel reached end of life, so every tool we pin through it is frozen. This commit points the nixpkgs input at nixos-26.05 and refreshes both inputs in flake.lock, neither of which had moved since April. Moving the channel moves the toolchain, and that accounts for the rest of the diff. protoc-gen-go 1.36.10 to 1.36.11 regenerates the render protobuf output. golangci-lint 2.11.4 to 2.12.2, which arrives with the nixpkgs-unstable refresh, reports new goconst and modernize findings, each addressed in place. nixpkgs 26.05 makes nixfmt-rfc-style an alias of nixfmt and warns when it is used, so we call nixfmt directly. Signed-off-by: Jared Watts <jbw976@gmail.com>
|
oops, fixed the goofy title that came from Github using the branch name instead of a commit subject because there's more than 1 commit 😇 |
📝 WalkthroughWalkthroughThe PR updates Renovate to use a controlled Nix environment, centralizes XRD schema constants, replaces manual reverse loops with ChangesMaintenance updates
Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (5 passed)
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 |
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 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/renovate-entrypoint.sh:
- Around line 29-30: Add the Nix configuration setting sandbox = false alongside
max-jobs in the Renovate build configuration, ensuring Renovate builds
explicitly run without sandboxing.
- Around line 40-47: Update the crossplane-nix launcher to set
NIX_USER_CONF_FILES=/dev/null and explicitly unset NIX_CONFIG before executing
/usr/bin/nix, while retaining NIX_CONF_DIR=/etc/nix. Ensure the launcher
prevents user and environment configuration from overriding the pinned settings.
- Around line 32-33: Update the serialized crossplane-nix launcher invocation in
the entrypoint to run /usr/local/bin/nix-clean-homeless-shelter both before
starting and after completing each invocation, including when it fails or is
interrupted, while retaining the existing post-build-hook as a backup.
In @.github/workflows/renovate.yml:
- Line 52: Restrict RENOVATE_ALLOWED_COMMANDS to exact allowlisted invocations
for crossplane-nix run .#tidy, run .#generate, and run .#lint, preventing extra
arguments or alternate subcommands; only retain the broader pattern if this
container’s Docker-socket access is explicitly justified.
🪄 Autofix
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: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: e97f6f7d-caa5-4995-8916-1154702d2e2d
⛔ Files ignored due to path filters (5)
.github/renovate.json5is excluded by none and included by noneflake.lockis excluded by!**/*.lockand included by nonenix/apps.nixis excluded by none and included by nonenix/checks.nixis excluded by none and included by noneproto/render/v1alpha1/render.pb.gois excluded by!**/*.pb.go,!**/*.pb.goand included by**/*.go
📒 Files selected for processing (6)
.github/renovate-entrypoint.sh.github/workflows/renovate.ymlcmd/crossplane/render/engine_docker_test.gocmd/crossplane/trace/internal/printer/default.gocmd/crossplane/xrd/generate.goflake.nix
haarchri
left a comment
There was a problem hiding this comment.
thanks - let's see in a bit that the renovate PRs working again
|
Thanks for approving/merging @haarchri! Renovate ran overnight in https://github.com/crossplane/cli/actions/runs/31472551934 and we look to be good with these fixes!
There are more lock file maintenance PRs for release branches that are rate limited right now, but that's expected until we clear the backlog of updates on main first since Renovate goes branch by branch starting with main. we see the same thing with c/c. I think these changes are good! 🎉 |
Description of your changes
We've done a bunch of work recently in crossplane and crossplane-runtime to get Renovate+Nix working well together and regular dependency updates (including lock file maintenance) flowing.
This repo also uses Nix as the build system and Renovate to update dependencies, and it's showing some of the same behavior we've fixed recently, e.g., PR #253 which failed its run with:
This PR ports over all the fixes and updates we worked through in crossplane/crossplane and crossplane-runtime:
How has this code been tested
I had an agent run this repo's updated entrypoint inside
ghcr.io/renovatebot/renovate:44, the same image the action pulls, and then invoke thecrossplane-nixlauncher for postUpgradeTasks, which complete successfully:git statusin that container showed nothing beyond the changes already in this PR, sotidyandgeneratereproduce the committedgomod2nix.tomland generated code exactly.I've also run
nix flake check(all five checks pass) andnix build .#release, which produces all seven platforms with checksums matching what CI validates.I have:
./nix.sh flake checkto ensure this PR is ready for review.Added or updated unit tests.Linked a PR or a docs tracking issue to document this change.Addedbackport release-x.ylabels to auto-backport this PR.Need help with this checklist? See the cheat sheet.