Repository navigation
fix(release): check out submodules in publish-crates.sh's worktree - #2390
Merged
Merged
Conversation
publish-crates.sh packages from a new worktree at the tag, where the contracts/lib submodules are empty directories. When the parent checkout has them initialized, their repositories sit in the shared .git/modules; cargo's libgit2 status check opens them, descends into a nested submodule whose directory does not exist, and the dry run dies with a bare "No such file or directory (os error 2)". CI never hits it: its checkout has no submodules. The script now runs `git submodule update --init --recursive` in the worktree. The new-crate summary also stops claiming "within the burst" when DECDN_ALLOW_RATE_LIMIT pushed it over. Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
🟢 Approval recommended
The focused release-script changes correctly address the reproduced failure and preserve pre-upload safety.
0 open findings
What changed in this PR
Ensures crate publishing succeeds from tagged worktrees by initializing required submodules before packaging.
Changes:
- Initializes submodules recursively in the release worktree.
- Corrects rate-limit summary output when the override exceeds the burst limit.
| File | Description |
|---|---|
.github/scripts/publish-crates.sh |
Prepares worktree submodules and improves publish-limit reporting. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
publish-crates.sh v0.0.1failed in its dry run with a bareerror: No such file or directory (os error 2). Nothing was uploaded.Cause: the script packages from a new
git worktreeat the tag. There, thecontracts/lib/*submodules are empty directories, but their repositories live in the shared.git/modules. When the parent checkout has them initialized, cargo's git status check (libgit2) opens those repositories. It then descends into a nested submodule (openzeppelin-contracts/lib/forge-std) whose directory doesn't exist, and fails;straceshows the failingopenaton that path. CI'scargo publish --dry-runnever hits this, because its checkout has no submodules.Fix: run
git submodule update --init --recursivein the worktree right after creating it. If that fails, the script dies before anything is uploaded.The new-crate summary also stops printing "(within the burst of 5)" when
DECDN_ALLOW_RATE_LIMIT=1has pushed it over the burst. It now says plainly that it is over the limit.Test plan
cargo package --workspace --locked --no-verifyin a new worktree atv0.0.1exits 101 with the same error.git submodule update --init --recursive(~14 s, local objects only),cargo packagesucceeds.bash -n,shellcheck, pre-commitpublish-crates.sh v0.0.1run gets past the dry run.🤖 Generated with Claude Code