update scripts - #1372
Conversation
- Bumped worktrunk version from 0.33.0 to 0.34.1 in Cargo.toml. - Added a new Makefile target 'cargo-update' to update Cargo dependencies to the latest version.
|
You do not have enough credits to review this pull request. Please purchase more credits to continue. |
📝 WalkthroughWalkthroughUpdated dependencies across the project: Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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 |
Mesa DescriptionTL;DRAdds Makefile targets to streamline dependency and lock file updates across Rust, Nix, Bun, and What changed?
Description generated by Mesa. Update settings |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@Makefile`:
- Around line 286-300: The uv-update target uses macOS-only sed syntax (sed -i
'') which breaks on GNU sed and also claims "reinstalled" without actually
reinstalling; change the sed invocation to a portable pattern (e.g., use sed
-i.bak ... then rm the .bak, or detect OS and use sed -i '' on Darwin and sed -i
on Linux) when editing pyproject.toml in the uv-update recipe, and after
updating the file invoke the project’s installation command to reinstall the
updated global tools (for example run the same installer used elsewhere such as
poetry install or the repo's tool-install script) so the "reinstalled" echo is
accurate; update references in the uv-update target and ensure you remove any
temporary backup file created.
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: fbba0a82-1407-40e5-b02b-6f371ae6d6e6
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (3)
Cargo.tomlMakefilepyproject.toml
| .PHONY: uv-update | ||
| uv-update: ## Update uv global tool versions in pyproject.toml to latest and reinstall. | ||
| @echo "📦 Updating uv global tool versions in pyproject.toml..." | ||
| @tomlq -r '.["dependency-groups"].tools[]' pyproject.toml | while read -r dep; do \ | ||
| pkg=$$(echo "$$dep" | sed 's/>=.*//'); \ | ||
| latest=$$(curl -sfL "https://pypi.org/pypi/$$pkg/json" | jq -r '.info.version'); \ | ||
| if [ -n "$$latest" ] && [ "$$latest" != "null" ]; then \ | ||
| echo "$$pkg: $$dep -> $$pkg>=$$latest"; \ | ||
| sed -i '' "s|\"$$dep\"|\"$$pkg>=$$latest\"|" pyproject.toml; \ | ||
| else \ | ||
| echo "$$pkg: failed to fetch latest version, skipping..."; \ | ||
| fi; \ | ||
| done | ||
| @echo "✅ uv global tools updated in pyproject.toml and reinstalled" | ||
|
|
There was a problem hiding this comment.
sed -i '' is macOS-specific; breaks on Linux.
The sed -i '' syntax (with a space before the empty string) works on macOS but fails on GNU/Linux sed, which requires sed -i (no argument) or sed -i'' (no space). Since this Makefile runs on both Darwin and Linux (per the OS detection logic), use a portable approach.
Additionally, line 299 says "reinstalled" but no reinstallation occurs—only the file is updated.
Proposed fix for cross-platform compatibility
.PHONY: uv-update
uv-update: ## Update uv global tool versions in pyproject.toml to latest and reinstall.
`@echo` "📦 Updating uv global tool versions in pyproject.toml..."
`@tomlq` -r '.["dependency-groups"].tools[]' pyproject.toml | while read -r dep; do \
pkg=$$(echo "$$dep" | sed 's/>=.*//'); \
latest=$$(curl -sfL "https://pypi.org/pypi/$$pkg/json" | jq -r '.info.version'); \
if [ -n "$$latest" ] && [ "$$latest" != "null" ]; then \
echo "$$pkg: $$dep -> $$pkg>=$$latest"; \
- sed -i '' "s|\"$$dep\"|\"$$pkg>=$$latest\"|" pyproject.toml; \
+ if [ "$$(uname -s)" = "Darwin" ]; then \
+ sed -i '' "s|\"$$dep\"|\"$$pkg>=$$latest\"|" pyproject.toml; \
+ else \
+ sed -i "s|\"$$dep\"|\"$$pkg>=$$latest\"|" pyproject.toml; \
+ fi; \
else \
echo "$$pkg: failed to fetch latest version, skipping..."; \
fi; \
done
- `@echo` "✅ uv global tools updated in pyproject.toml and reinstalled"
+ `@echo` "✅ uv global tools updated in pyproject.toml"📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| .PHONY: uv-update | |
| uv-update: ## Update uv global tool versions in pyproject.toml to latest and reinstall. | |
| @echo "📦 Updating uv global tool versions in pyproject.toml..." | |
| @tomlq -r '.["dependency-groups"].tools[]' pyproject.toml | while read -r dep; do \ | |
| pkg=$$(echo "$$dep" | sed 's/>=.*//'); \ | |
| latest=$$(curl -sfL "https://pypi.org/pypi/$$pkg/json" | jq -r '.info.version'); \ | |
| if [ -n "$$latest" ] && [ "$$latest" != "null" ]; then \ | |
| echo "$$pkg: $$dep -> $$pkg>=$$latest"; \ | |
| sed -i '' "s|\"$$dep\"|\"$$pkg>=$$latest\"|" pyproject.toml; \ | |
| else \ | |
| echo "$$pkg: failed to fetch latest version, skipping..."; \ | |
| fi; \ | |
| done | |
| @echo "✅ uv global tools updated in pyproject.toml and reinstalled" | |
| .PHONY: uv-update | |
| uv-update: ## Update uv global tool versions in pyproject.toml to latest and reinstall. | |
| `@echo` "📦 Updating uv global tool versions in pyproject.toml..." | |
| `@tomlq` -r '.["dependency-groups"].tools[]' pyproject.toml | while read -r dep; do \ | |
| pkg=$$(echo "$$dep" | sed 's/>=.*//'); \ | |
| latest=$$(curl -sfL "https://pypi.org/pypi/$$pkg/json" | jq -r '.info.version'); \ | |
| if [ -n "$$latest" ] && [ "$$latest" != "null" ]; then \ | |
| echo "$$pkg: $$dep -> $$pkg>=$$latest"; \ | |
| if [ "$$(uname -s)" = "Darwin" ]; then \ | |
| sed -i '' "s|\"$$dep\"|\"$$pkg>=$$latest\"|" pyproject.toml; \ | |
| else \ | |
| sed -i "s|\"$$dep\"|\"$$pkg>=$$latest\"|" pyproject.toml; \ | |
| fi; \ | |
| else \ | |
| echo "$$pkg: failed to fetch latest version, skipping..."; \ | |
| fi; \ | |
| done | |
| `@echo` "✅ uv global tools updated in pyproject.toml" |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@Makefile` around lines 286 - 300, The uv-update target uses macOS-only sed
syntax (sed -i '') which breaks on GNU sed and also claims "reinstalled" without
actually reinstalling; change the sed invocation to a portable pattern (e.g.,
use sed -i.bak ... then rm the .bak, or detect OS and use sed -i '' on Darwin
and sed -i on Linux) when editing pyproject.toml in the uv-update recipe, and
after updating the file invoke the project’s installation command to reinstall
the updated global tools (for example run the same installer used elsewhere such
as poetry install or the repo's tool-install script) so the "reinstalled" echo
is accurate; update references in the uv-update target and ensure you remove any
temporary backup file created.
There was a problem hiding this comment.
Code Review
This pull request performs a significant update of the project's dependency tree, including version bumps in Cargo.toml and pyproject.toml, and extensive changes to Cargo.lock. It also introduces new Makefile targets: update-lock, cargo-update, and uv-update to automate dependency management. Review feedback highlights that the uv-update target's documentation is misleading as it lacks a reinstallation step, and the implementation uses a non-portable sed command that will fail on non-macOS systems.
| uv-update: ## Update uv global tool versions in pyproject.toml to latest and reinstall. | ||
| @echo "📦 Updating uv global tool versions in pyproject.toml..." | ||
| @tomlq -r '.["dependency-groups"].tools[]' pyproject.toml | while read -r dep; do \ | ||
| pkg=$$(echo "$$dep" | sed 's/>=.*//'); \ | ||
| latest=$$(curl -sfL "https://pypi.org/pypi/$$pkg/json" | jq -r '.info.version'); \ | ||
| if [ -n "$$latest" ] && [ "$$latest" != "null" ]; then \ | ||
| echo "$$pkg: $$dep -> $$pkg>=$$latest"; \ | ||
| sed -i '' "s|\"$$dep\"|\"$$pkg>=$$latest\"|" pyproject.toml; \ | ||
| else \ | ||
| echo "$$pkg: failed to fetch latest version, skipping..."; \ | ||
| fi; \ | ||
| done | ||
| @echo "✅ uv global tools updated in pyproject.toml and reinstalled" |
There was a problem hiding this comment.
The help text for the uv-update target (line 287) and the final echo message (line 299) state that the tools are "reinstalled". However, the script only updates the versions in pyproject.toml and does not perform any reinstallation step.
This is misleading. You should either:
- Add the reinstallation command to the target to match the description.
- Update the help text and the echo message to accurately reflect that the target only updates the
pyproject.tomlfile.
For example, you could change the help text to "Update uv global tool versions in pyproject.toml to latest." and the final echo to "✅ uv global tools updated in pyproject.toml".
| @tomlq -r '.["dependency-groups"].tools[]' pyproject.toml | while read -r dep; do \ | ||
| pkg=$$(echo "$$dep" | sed 's/>=.*//'); \ | ||
| latest=$$(curl -sfL "https://pypi.org/pypi/$$pkg/json" | jq -r '.info.version'); \ | ||
| if [ -n "$$latest" ] && [ "$$latest" != "null" ]; then \ | ||
| echo "$$pkg: $$dep -> $$pkg>=$$latest"; \ | ||
| sed -i '' "s|\"$$dep\"|\"$$pkg>=$$latest\"|" pyproject.toml; \ | ||
| else \ | ||
| echo "$$pkg: failed to fetch latest version, skipping..."; \ | ||
| fi; \ | ||
| done |
There was a problem hiding this comment.
The sed -i '' command for in-place editing is specific to BSD/macOS sed and will fail on GNU/Linux systems, which expect sed -i without an argument. To ensure portability across different operating systems, you should handle both cases.
The Makefile already defines the OS variable, which you can use to conditionally execute the correct sed command.
@tomlq -r '.["dependency-groups"].tools[]' pyproject.toml | while read -r dep; do \
pkg=$$(echo "$$dep" | sed 's/>=.*//'); \
latest=$$(curl -sfL "https://pypi.org/pypi/$$pkg/json" | jq -r '.info.version'); \
if [ -n "$$latest" ] && [ "$$latest" != "null" ]; then \
echo "$$pkg: $$dep -> $$pkg>=$$latest"; \
if [ "$(OS)" = "Darwin" ]; then \
sed -i '' "s|\"$$dep\"|\"$$pkg>=$$latest\"|" pyproject.toml; \
else \
sed -i "s|\"$$dep\"|\"$$pkg>=$$latest\"|" pyproject.toml; \
fi; \
else \
echo "$$pkg: failed to fetch latest version, skipping..."; \
fi; \
done
There was a problem hiding this comment.
Pull request overview
Adds automation for updating various tool/dependency lockfiles and bumps a few tracked tool versions.
Changes:
- Bump uv “global tools” versions in
pyproject.toml. - Add
update-lock,cargo-update, anduv-updatetargets to theMakefile. - Upgrade
worktrunkand refreshCargo.lockaccordingly.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
pyproject.toml |
Updates tracked uv global tool minimum versions. |
Makefile |
Introduces new update targets for lockfiles/tools (bun/Cargo/uv/Nix flake). |
Cargo.toml |
Bumps worktrunk dependency version. |
Cargo.lock |
Regenerates the Rust dependency lockfile after updates. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| cargo-update: ## Update Cargo dependencies to latest and regenerate lock file. | ||
| @echo "📦 Updating Cargo dependencies..." |
There was a problem hiding this comment.
cargo-update relies on nightly-only flags (+nightly, --breaking, -Z unstable-options). This will fail for contributors without a nightly toolchain installed and makes make update-lock unexpectedly depend on nightly. Consider switching to stable cargo update (or gating the nightly path behind a toolchain check / separate target) so the update flow works in the standard toolchain setup.
| cargo-update: ## Update Cargo dependencies to latest and regenerate lock file. | |
| @echo "📦 Updating Cargo dependencies..." | |
| cargo-update: ## Update Cargo lock file using the stable toolchain. | |
| @echo "📦 Updating Cargo dependencies..." | |
| @cargo update | |
| @echo "✅ Cargo dependencies updated" | |
| .PHONY: cargo-update-breaking | |
| cargo-update-breaking: ## Update Cargo dependencies with nightly-only breaking upgrades. | |
| @echo "📦 Updating Cargo dependencies with nightly breaking upgrades..." |
| latest=$$(curl -sfL "https://pypi.org/pypi/$$pkg/json" | jq -r '.info.version'); \ | ||
| if [ -n "$$latest" ] && [ "$$latest" != "null" ]; then \ | ||
| echo "$$pkg: $$dep -> $$pkg>=$$latest"; \ | ||
| sed -i '' "s|\"$$dep\"|\"$$pkg>=$$latest\"|" pyproject.toml; \ |
There was a problem hiding this comment.
uv-update rewrites pyproject.toml via sed using the raw dependency string ($$dep) as a regex search pattern and uses sed -i '' for in-place edits. This can break or mis-edit when dependency specs contain regex metacharacters, and the -i form is not consistently portable across environments. Consider escaping the search string (or using a TOML-aware edit via tomlq/Python), and handling in-place edits in an OS-portable way.
| sed -i '' "s|\"$$dep\"|\"$$pkg>=$$latest\"|" pyproject.toml; \ | |
| python3 - "$$dep" "$$pkg" "$$latest" <<'PY'; \ | |
| import pathlib, sys; \ | |
| dep, pkg, latest = sys.argv[1:4]; \ | |
| path = pathlib.Path("pyproject.toml"); \ | |
| old = f'"{dep}"'; \ | |
| new = f'"{pkg}>={latest}"'; \ | |
| content = path.read_text(encoding="utf-8"); \ | |
| if old not in content: \ | |
| raise SystemExit(f"dependency entry not found: {dep}"); \ | |
| path.write_text(content.replace(old, new, 1), encoding="utf-8"); \ | |
| PY \ |
| .PHONY: uv-update | ||
| uv-update: ## Update uv global tool versions in pyproject.toml to latest and reinstall. | ||
| @echo "📦 Updating uv global tool versions in pyproject.toml..." |
There was a problem hiding this comment.
The uv-update help text says it will update tool versions "...and reinstall", but the recipe currently only rewrites pyproject.toml and doesn't invoke any uv tool install/upgrade step. Either add the reinstall step (e.g., reuse home-manager/modules/uv-globals/install-uv-globals.sh) or adjust the help text so it matches behavior.
| echo "$$pkg: failed to fetch latest version, skipping..."; \ | ||
| fi; \ | ||
| done | ||
| @echo "✅ uv global tools updated in pyproject.toml and reinstalled" |
There was a problem hiding this comment.
This success message says the tools were "updated ... and reinstalled", but the target doesn't currently run any reinstall command. Consider updating the message to reflect what actually happened, or add the missing reinstall step so the output is accurate.
| @echo "✅ uv global tools updated in pyproject.toml and reinstalled" | |
| @echo "✅ uv global tool versions updated in pyproject.toml" |
| [dependencies] | ||
| git-ai = { git = "https://github.com/git-ai-project/git-ai", branch = "main" } | ||
| rtk = { git = "https://github.com/rtk-ai/rtk", branch = "master" } | ||
| worktrunk = "0.33.0" | ||
| worktrunk = "0.34.1" |
There was a problem hiding this comment.
Cargo.lock includes additional updates to git dependencies (e.g., git-ai, rtk) beyond the worktrunk bump shown here. If those lockfile changes are intentional, please call them out in the PR description; otherwise consider regenerating the lockfile in a way that only reflects the intended worktrunk upgrade to keep the diff scoped.
| update: nix-update neovim-update gitalias-update llm-update overlays-update ## Update Nix flake, overlays, Neovim plugins, LLM configs, gitalias, and bun deps | ||
|
|
||
| .PHONY: update-lock | ||
| update-lock: nix-flake-update bun-update cargo-update uv-update ## Update lock files for Nix flake, bun, Cargo, and uv global tools. |
There was a problem hiding this comment.
update-lock is described as updating lock files, but uv-update currently edits pyproject.toml (a manifest), not a lockfile. Consider either renaming the target/description to reflect that it updates manifests too, or adjusting the uv step to update an actual uv lock artifact if one exists in this repo.
| update-lock: nix-flake-update bun-update cargo-update uv-update ## Update lock files for Nix flake, bun, Cargo, and uv global tools. | |
| update-lock: nix-flake-update bun-update cargo-update uv-update ## Update lock files for Nix flake, bun, and Cargo, and refresh uv global tool manifests/dependencies. |
There was a problem hiding this comment.
2 issues found across 4 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="Makefile">
<violation number="1" location="Makefile:294">
P2: `sed -i ''` is macOS/BSD-specific and will fail on GNU/Linux, which expects `sed -i` (no argument) or `sed -i''` (no space). Since this Makefile already detects the OS, use a conditional to pick the correct invocation.</violation>
<violation number="2" location="Makefile:299">
P3: The message says "reinstalled" but the target only updates `pyproject.toml` — no reinstallation step is performed. Change to "✅ uv global tools updated in pyproject.toml".</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| latest=$$(curl -sfL "https://pypi.org/pypi/$$pkg/json" | jq -r '.info.version'); \ | ||
| if [ -n "$$latest" ] && [ "$$latest" != "null" ]; then \ | ||
| echo "$$pkg: $$dep -> $$pkg>=$$latest"; \ | ||
| sed -i '' "s|\"$$dep\"|\"$$pkg>=$$latest\"|" pyproject.toml; \ |
There was a problem hiding this comment.
P2: sed -i '' is macOS/BSD-specific and will fail on GNU/Linux, which expects sed -i (no argument) or sed -i'' (no space). Since this Makefile already detects the OS, use a conditional to pick the correct invocation.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At Makefile, line 294:
<comment>`sed -i ''` is macOS/BSD-specific and will fail on GNU/Linux, which expects `sed -i` (no argument) or `sed -i''` (no space). Since this Makefile already detects the OS, use a conditional to pick the correct invocation.</comment>
<file context>
@@ -274,6 +283,21 @@ overlays-update: ## Upgrade all custom overlays to latest versions.
+ latest=$$(curl -sfL "https://pypi.org/pypi/$$pkg/json" | jq -r '.info.version'); \
+ if [ -n "$$latest" ] && [ "$$latest" != "null" ]; then \
+ echo "$$pkg: $$dep -> $$pkg>=$$latest"; \
+ sed -i '' "s|\"$$dep\"|\"$$pkg>=$$latest\"|" pyproject.toml; \
+ else \
+ echo "$$pkg: failed to fetch latest version, skipping..."; \
</file context>
| sed -i '' "s|\"$$dep\"|\"$$pkg>=$$latest\"|" pyproject.toml; \ | |
| if [ "$(OS)" = "Darwin" ]; then \ | |
| sed -i '' "s|\"$$dep\"|\"$$pkg>=$$latest\"|" pyproject.toml; \ | |
| else \ | |
| sed -i "s|\"$$dep\"|\"$$pkg>=$$latest\"|" pyproject.toml; \ | |
| fi; \ |
| echo "$$pkg: failed to fetch latest version, skipping..."; \ | ||
| fi; \ | ||
| done | ||
| @echo "✅ uv global tools updated in pyproject.toml and reinstalled" |
There was a problem hiding this comment.
P3: The message says "reinstalled" but the target only updates pyproject.toml — no reinstallation step is performed. Change to "✅ uv global tools updated in pyproject.toml".
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At Makefile, line 299:
<comment>The message says "reinstalled" but the target only updates `pyproject.toml` — no reinstallation step is performed. Change to "✅ uv global tools updated in pyproject.toml".</comment>
<file context>
@@ -274,6 +283,21 @@ overlays-update: ## Upgrade all custom overlays to latest versions.
+ echo "$$pkg: failed to fetch latest version, skipping..."; \
+ fi; \
+ done
+ @echo "✅ uv global tools updated in pyproject.toml and reinstalled"
+
##@ Nix Setup
</file context>
| @echo "✅ uv global tools updated in pyproject.toml and reinstalled" | |
| @echo "✅ uv global tools updated in pyproject.toml" |
* fix: resolve upgrade CI failure from dotagents sync target collision Closes #1372 * fix: batch bun global installs to prevent resolution hang bun hangs when resolving too many packages at once in a single bun add --global call. Install in batches of 10 instead.
Summary by cubic
Add Makefile targets to update dependencies and lock files across Rust, Nix, Bun, and
uv, bumpworktrunk, and refresh thedotagentssubmodule. This streamlines keeping the toolchain current and regenerates lock files.New Features
update-lock: Updates Nix flake, Bun deps, Cargo deps, anduvtool versions; refreshes lock files.cargo-update: Updates Cargo dependencies to latest and regeneratesCargo.lock.uv-update: Updatespyproject.tomlglobal tool versions to the latest from PyPI.Dependencies
worktrunkto0.34.1; regeneratedCargo.lockwith broad transitive updates.pyproject.toml:mistral-vibe>=2.7.3,ruff>=0.15.9.dotagentssubmodule to the latest commit.Written for commit 2c40108. Summary will update on new commits.