Skip to content

fix(dotfiles-updater): skip flake update during automated updates - #468

Merged
shunkakinoki merged 1 commit into
mainfrom
fix/skip-flake-update-automated
Dec 29, 2025
Merged

fix(dotfiles-updater): skip flake update during automated updates#468
shunkakinoki merged 1 commit into
mainfrom
fix/skip-flake-update-automated

Conversation

@shunkakinoki

@shunkakinoki shunkakinoki commented Dec 29, 2025

Copy link
Copy Markdown
Owner

Summary

  • Skip nix flake update when AUTOMATED_UPDATE=true is set
  • Prevents flake.lock from being modified during automated dotfiles-updater runs
  • Keeps git status clean after automated updates

Test plan

  • Verify dotfiles-updater service still runs successfully
  • Confirm flake.lock is not modified after automated update

🤖 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.

@mesa-dot-dev

mesa-dot-dev Bot commented Dec 29, 2025

Copy link
Copy Markdown

You do not have enough credits to review this pull request. Please purchase more credits to continue.

@shunkakinoki
shunkakinoki enabled auto-merge (squash) December 29, 2025 09:44
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @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 Makefile to prevent the flake.lock file from being updated during automated execution of the dotfiles-updater. By conditionally skipping the nix flake update command when an AUTOMATED_UPDATE flag is present, the change aims to maintain a clean Git status and ensure that automated processes do not inadvertently alter dependency pins.

Highlights

  • Automated Updates: The nix flake update command will now be skipped when the AUTOMATED_UPDATE=true environment variable is set.
  • Flake Lock File Integrity: This change prevents the flake.lock file from being modified during automated dotfiles-updater runs.
  • Clean Git Status: Ensures that the Git working directory remains clean after automated updates by avoiding unintended flake.lock changes.

🧠 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 Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@coderabbitai

coderabbitai Bot commented Dec 29, 2025

Copy link
Copy Markdown
📝 Walkthrough

Summary by CodeRabbit

  • Chores
    • Updated automated build behavior to conditionally handle nix flake updates based on deployment context (CI, Docker, or automated update modes).

✏️ Tip: You can customize this high-level summary in your review settings.

Walkthrough

The Makefile is modified to extend the bypass condition for the nix-flake-update target, now also considering AUTOMATED_UPDATE alongside existing CI and Docker modes. The echoed message is updated to reflect these deployment contexts.

Changes

Cohort / File(s) Summary
Makefile Build Configuration
Makefile
Extended bypass condition for nix-flake-update target to include AUTOMATED_UPDATE mode; updated contextual status message to reflect CI/Docker/automated update scenarios.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

Poem

🐰 The flake hops gently, skipping its dance,
When automation takes the reins and chance,
No nix update runs in the CI light,
Just Docker and bots keeping systems tight!

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: skipping flake updates during automated updates, which aligns with the changeset's primary objective.
Description check ✅ Passed The description is directly related to the changeset, explaining the rationale for skipping nix flake updates when AUTOMATED_UPDATE is set and the expected benefits.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/skip-flake-update-automated

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 and usage tips.

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-dot-dev

mesa-dot-dev Bot commented Dec 29, 2025

Copy link
Copy Markdown

Mesa Description

TL;DR

Skip nix flake update during automated dotfiles updates to prevent flake.lock modification.

What changed?

  • Skip nix flake update when AUTOMATED_UPDATE=true is set
  • Prevents flake.lock from being modified during automated dotfiles-updater runs
  • Keeps git status clean after automated updates

Description generated by Mesa. Update settings

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 1 file

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Comment thread Makefile
Comment on lines +288 to +289
@if [ "$$CI" = "true" ] || [ "$$IN_DOCKER" = "true" ] || [ "$$AUTOMATED_UPDATE" = "true" ]; then \
echo "Bypassing flake update in CI/Docker/automated update"; \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

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.

@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: 0

🧹 Nitpick comments (1)
Makefile (1)

288-289: Consider documenting the AUTOMATED_UPDATE environment variable.

The AUTOMATED_UPDATE variable is now used in multiple targets (nix-connect at line 176 and nix-flake-update at 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 CI and IN_DOCKER contexts

Consider 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.

📥 Commits

Reviewing files that changed from the base of the PR and between 490d9c6 and 9dc4f2b.

📒 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_UPDATE check properly skips the flake update during automated runs, which aligns with keeping the git status clean.


288-289: Ensure nix-build and nix-switch targets respect AUTOMATED_UPDATE for consistency.

When the dotfiles-updater service runs, it sets AUTOMATED_UPDATE=true and executes ./install.sh, which calls make install. This chains nix-flake-updatenix-buildnix-switch. Currently:

  • nix-flake-update respects AUTOMATED_UPDATE and bypasses the lock file update ✓
  • nix-build checks only CI and IN_DOCKER, not AUTOMATED_UPDATE
  • nix-switch checks only CI and IN_DOCKER, not AUTOMATED_UPDATE

Since nix-connect already uses AUTOMATED_UPDATE to skip daemon management in automated contexts, the targets should consistently handle this variable. Consider adding AUTOMATED_UPDATE checks to nix-build and nix-switch to match the behavior in nix-flake-update and nix-connect.

@shunkakinoki
shunkakinoki merged commit 13e161a into main Dec 29, 2025
32 checks passed
@shunkakinoki
shunkakinoki deleted the fix/skip-flake-update-automated branch December 29, 2025 10:45
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