fix(dotfiles-updater): skip flake update during automated updates - #468
Conversation
|
You do not have enough credits to review this pull request. Please purchase more credits to continue. |
Summary of ChangesHello @shunkakinoki, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces a modification to the Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
📝 WalkthroughSummary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings. WalkthroughThe Makefile is modified to extend the bypass condition for the Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related PRs
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 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 |
Prevents flake.lock from being modified during automated dotfiles updates by checking for AUTOMATED_UPDATE environment variable. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Mesa DescriptionTL;DRSkip What changed?
Description generated by Mesa. Update settings |
There was a problem hiding this comment.
Code Review
This pull request correctly modifies the Makefile to skip nix flake update during automated updates by checking for the AUTOMATED_UPDATE environment variable. This change effectively prevents unintended modifications to flake.lock in automated workflows. The implementation is sound. I have added one review comment pointing out a pre-existing issue with a misleading success message that this change makes more apparent, with a suggestion for how to improve the script's feedback.
| @if [ "$$CI" = "true" ] || [ "$$IN_DOCKER" = "true" ] || [ "$$AUTOMATED_UPDATE" = "true" ]; then \ | ||
| echo "Bypassing flake update in CI/Docker/automated update"; \ |
There was a problem hiding this comment.
This condition correctly skips the flake update. However, it highlights a pre-existing issue: the message ✅ flake.lock updated! on line 293 is always printed, which is misleading when the update is skipped.
To prevent confusion, the success message should only be shown when the update actually runs. Consider moving echo "✅ flake.lock updated!" into the else block.
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
Makefile (1)
288-289: Consider documenting theAUTOMATED_UPDATEenvironment variable.The
AUTOMATED_UPDATEvariable is now used in multiple targets (nix-connectat line 176 andnix-flake-updateat line 288), but there's no documentation explaining:
- When this variable should be set
- What its intended behavior is across different targets
- How it differs from
CIandIN_DOCKERcontextsConsider adding a comment block near the variable declarations (around lines 1-20) documenting this environment variable:
# Environment variables NIX_ALLOW_UNFREE := NIXPKGS_ALLOW_UNFREE=1 # AUTOMATED_UPDATE - Set to "true" to skip flake updates and daemon management during automated runs # This keeps the git status clean by preventing flake.lock modifications
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
Makefile
🧰 Additional context used
🧠 Learnings (6)
📓 Common learnings
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/general.mdc:0-0
Timestamp: 2025-11-25T09:34:40.062Z
Learning: Applies to flake.nix : Maintain flake.nix as the main Nix configuration with proper structure
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/nix.mdc:0-0
Timestamp: 2025-11-25T09:35:01.066Z
Learning: Test configurations before committing using `nix flake check` and `home-manager build --show-trace`
📚 Learning: 2025-11-25T09:34:40.062Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/general.mdc:0-0
Timestamp: 2025-11-25T09:34:40.062Z
Learning: Applies to flake.nix : Maintain flake.nix as the main Nix configuration with proper structure
Applied to files:
Makefile
📚 Learning: 2025-11-25T09:34:40.062Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/general.mdc:0-0
Timestamp: 2025-11-25T09:34:40.062Z
Learning: Document all major changes in Nix configurations
Applied to files:
Makefile
📚 Learning: 2025-11-25T09:34:47.854Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/github-workflows.mdc:0-0
Timestamp: 2025-11-25T09:34:47.854Z
Learning: Applies to .github/workflows/*.yml : CI Pipeline must run on all pull requests and main branch pushes, validating Nix flake checks, home-manager builds, nix-darwin builds, and system configurations
Applied to files:
Makefile
📚 Learning: 2025-11-25T09:35:01.066Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/nix.mdc:0-0
Timestamp: 2025-11-25T09:35:01.066Z
Learning: Test configurations before committing using `nix flake check` and `home-manager build --show-trace`
Applied to files:
Makefile
📚 Learning: 2025-11-25T09:35:01.066Z
Learnt from: CR
Repo: shunkakinoki/dotfiles PR: 0
File: .cursor/rules/nix.mdc:0-0
Timestamp: 2025-11-25T09:35:01.066Z
Learning: Applies to flake.nix : Always pin package versions in `flake.lock`
Applied to files:
Makefile
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (13)
- GitHub Check: shell-lint
- GitHub Check: shell-test
- GitHub Check: docker-build-push (linux/arm64, arm64, ubuntu-24.04-arm)
- GitHub Check: lua-neovim
- GitHub Check: lua-neovim-test
- GitHub Check: docker-build-push (linux/amd64, amd64, ubuntu-latest)
- GitHub Check: lua-hammerspoon
- GitHub Check: e2e-run (NixOS, ubuntu-latest)
- GitHub Check: e2e-run (Ubuntu, ubuntu-latest)
- GitHub Check: e2e-run (MacOS, macos-latest)
- GitHub Check: nix-linux
- GitHub Check: nix-darwin
- GitHub Check: nix-nixos
🔇 Additional comments (2)
Makefile (2)
288-289: Implementation looks correct for the stated objective.The addition of the
AUTOMATED_UPDATEcheck properly skips the flake update during automated runs, which aligns with keeping the git status clean.
288-289: Ensurenix-buildandnix-switchtargets respectAUTOMATED_UPDATEfor consistency.When the dotfiles-updater service runs, it sets
AUTOMATED_UPDATE=trueand executes./install.sh, which callsmake install. This chainsnix-flake-update→nix-build→nix-switch. Currently:
nix-flake-updaterespectsAUTOMATED_UPDATEand bypasses the lock file update ✓nix-buildchecks onlyCIandIN_DOCKER, notAUTOMATED_UPDATE✗nix-switchchecks onlyCIandIN_DOCKER, notAUTOMATED_UPDATE✗Since
nix-connectalready usesAUTOMATED_UPDATEto skip daemon management in automated contexts, the targets should consistently handle this variable. Consider addingAUTOMATED_UPDATEchecks tonix-buildandnix-switchto match the behavior innix-flake-updateandnix-connect.
Summary
nix flake updatewhenAUTOMATED_UPDATE=trueis setflake.lockfrom being modified during automated dotfiles-updater runsTest plan
🤖 Generated with Claude Code
Summary by cubic
Skip nix flake update when AUTOMATED_UPDATE=true to avoid modifying flake.lock during automated dotfiles-updater runs. The Makefile now bypasses flake updates in CI, Docker, and automated updates, keeping git status clean.
Written for commit 9dc4f2b. Summary will update automatically on new commits.