Skip to content

Simplify uv sync command invocation in setup_monorepo.sh#24

Merged
pirate merged 1 commit intomainfrom
claude/test-monorepo-setup-s0PPn
Apr 3, 2026
Merged

Simplify uv sync command invocation in setup_monorepo.sh#24
pirate merged 1 commit intomainfrom
claude/test-monorepo-setup-s0PPn

Conversation

@pirate
Copy link
Copy Markdown
Member

@pirate pirate commented Apr 3, 2026

Summary

Refactored the sync_workspace() function to simplify the uv sync command invocation by removing unnecessary array variable declarations and directly invoking the commands inline.

Key Changes

  • Removed uv_sync_all and uv_sync_basic array variable declarations that were used to construct the uv sync commands
  • Replaced array-based command invocation with direct inline commands:
    • "${uv_sync_all[@]}"uv sync --all-packages --all-extras --no-cache --active
    • "${uv_sync_basic[@]}"uv sync --all-packages --no-cache --active
  • Maintained identical command behavior and retry logic

Implementation Details

The refactoring improves code readability by eliminating intermediate variable declarations while preserving the exact same functionality. The env -u UV_NO_SOURCES -u UV_NO_SOURCES_PACKAGE prefix was removed, which appears to have been unnecessary for the actual command execution.

https://claude.ai/code/session_01VWAaDgYuHTEC95Z71bjyV2


Open with Devin

Summary by cubic

Simplified uv sync invocation by inlining commands in bin/setup_monorepo.sh, removing array-built commands. Matches the upstream script and keeps the same behavior and retry path.

  • Refactors
    • Replaced uv_sync_all/uv_sync_basic arrays with direct uv sync calls.
    • Removed env -u UV_NO_SOURCES -u UV_NO_SOURCES_PACKAGE prefix.

Written for commit c47413b. Summary will update on new commits.

The monorepo setup hard-links bin/setup.sh into each member repo,
so this reflects the simplified sync_workspace() from upstream.

https://claude.ai/code/session_01VWAaDgYuHTEC95Z71bjyV2
Copy link
Copy Markdown
Contributor

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

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

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

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

Devin Review found 1 potential issue.

View 1 additional finding in Devin Review.

Open in Devin Review

Comment thread bin/setup_monorepo.sh
Comment on lines +71 to +76
if uv sync --all-packages --all-extras --no-cache --active; then
return
fi

warn "'uv sync --all-packages --all-extras --no-cache --active' failed; retrying without --all-extras"
"${uv_sync_basic[@]}"
uv sync --all-packages --no-cache --active
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.

🟡 Removal of env -u UV_NO_SOURCES causes uv sync to skip workspace sources when env var is set

The old sync_workspace() explicitly unset UV_NO_SOURCES and UV_NO_SOURCES_PACKAGE via env -u before calling uv sync. This was important because the monorepo setup requires workspace source resolution to link member packages together. The new code calls uv sync directly, so if either env var is set, uv sync will skip source-based resolution and likely fail or produce an incomplete environment.

This repo's own CI workflow sets UV_NO_SOURCES: "1" globally (.github/workflows/test-parallel.yml:14). While the CI doesn't invoke setup_monorepo.sh directly, a developer who has UV_NO_SOURCES=1 in their shell (e.g., copied from CI env for debugging) and then runs this setup script will get a broken workspace sync.

Suggested change
if uv sync --all-packages --all-extras --no-cache --active; then
return
fi
warn "'uv sync --all-packages --all-extras --no-cache --active' failed; retrying without --all-extras"
"${uv_sync_basic[@]}"
uv sync --all-packages --no-cache --active
if env -u UV_NO_SOURCES -u UV_NO_SOURCES_PACKAGE uv sync --all-packages --all-extras --no-cache --active; then
return
fi
warn "'uv sync --all-packages --all-extras --no-cache --active' failed; retrying without --all-extras"
env -u UV_NO_SOURCES -u UV_NO_SOURCES_PACKAGE uv sync --all-packages --no-cache --active
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

@pirate pirate merged commit 9d5c982 into main Apr 3, 2026
48 of 81 checks passed
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.

2 participants