Skip to content

fix(release): check out submodules in publish-crates.sh's worktree - #2390

Merged
thiras merged 1 commit into
mainfrom
fix/publish-crates-submodules
Oct 9, 2026
Merged

thiras merged 1 commit into
mainfrom
fix/publish-crates-submodules

Conversation

@thiras

@thiras thiras commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Summary

publish-crates.sh v0.0.1 failed in its dry run with a bare error: No such file or directory (os error 2). Nothing was uploaded.

Cause: the script packages from a new git worktree at the tag. There, the contracts/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; strace shows the failing openat on that path. CI's cargo publish --dry-run never hits this, because its checkout has no submodules.

Fix: run git submodule update --init --recursive in 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=1 has pushed it over the burst. It now says plainly that it is over the limit.

Test plan

  • Reproduced the failure: cargo package --workspace --locked --no-verify in a new worktree at v0.0.1 exits 101 with the same error.
  • In the same worktree, after git submodule update --init --recursive (~14 s, local objects only), cargo package succeeds.
  • bash -n, shellcheck, pre-commit
  • Next publish-crates.sh v0.0.1 run gets past the dry run.

🤖 Generated with Claude Code

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]>
Copilot AI balanced review requested due to automatic review settings October 9, 2026 11:35
@thiras thiras self-assigned this Oct 9, 2026

Copilot AI 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.

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

@thiras
thiras merged commit e7eee84 into main Oct 9, 2026
30 checks passed
@thiras
thiras deleted the fix/publish-crates-submodules branch October 9, 2026 11:44
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