fix(ci): stop pinning submodules to tags via branch - #175
Merged
Conversation
`.gitmodules` declared `branch = v1.5.0` for lib/forge-std and `branch = v0.1.3` for lib/create2-helpers. Both values are tags, not branches. With no foundry.lock committed, `forge install` treats every submodule as out of sync and checks it out at its recorded identifier; a `branch` line makes that identifier the literal string, so forge runs `git checkout v1.5.0` against the depth-1 submodule clone that actions/checkout produces, which carries no tags. Every Forge job died there before compiling anything. Dropping both lines leaves the recorded commits as the only pin, which is what the repo already built against. All ten resolved gitlinks are unchanged. Also pin foundry-toolchain to v1.5.1 rather than tracking nightly, since toolchain drift is what broke the step. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Coverage Report for CI Build 32604609308Coverage increased (+11.3%) to 64.702%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
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.
Motivation
Both Forge jobs in Test CI fail on the "Install forge dependencies" step, before any contract compiles:
.gitmodulesdeclaredbranch = v1.5.0forlib/forge-stdandbranch = v0.1.3forlib/create2-helpers. Neither value is a branch. Both are tags, and both still exist upstream, so no ref was deleted.forge installreads.gitmodulesto build afoundry.lock. No lockfile is committed here, so every submodule is treated as out of sync and forge checks each one out at its recorded identifier. A submodule carrying abranchline becomesDepIdentifier::Branch { name }, andcheckout_id()returns that literal string, so forge runsgit checkout v1.5.0.actions/checkoutclones submodules at depth 1 and fetches no tags, so the pathspec does not resolve and the step exits 1. Without abranchline the submodule becomesDepIdentifier::Rev { rev }, and forge checks out the recorded commit, which is present in the shallow clone.The two jobs reported different pathspecs,
v0.1.3in Forge Coverage andv1.5.0in Forge Tests, because the out-of-sync set is a hash map with no fixed iteration order. Either entry can surface first, so both had to go.The forge-std pin was stale in content as well as wrong in kind. The recorded gitlink is
726a6ee, which is v1.9.5 plus two commits from January 2025, nowhere near v1.5.0. Nothing was resolving that label; it was only breaking the install.Solution
Two changes, both confined to CI and dependency pinning. No contract source is touched.
Drop the two
branchlines so the recorded submodule commits are the only pin. That is what the repo was already building against, so this changes which ref forge asks git for, not which code lands inlib/. All ten resolved commits are byte for byte identical to the gitlinks onmain.Pin the Foundry toolchain to v1.5.1 instead of tracking
nightly. Toolchain drift is what broke the install step, and the same nightly introduces a second failure: it probes the fork RPC withanvil_nodeInfo, and Alchemy answers that unknown method with HTTP 400 rather than a JSON-RPC error, which abortsvm.createSelectForkinERC721SeaDropCloneFactory.t.sol. Providers that return HTTP 200 with an error body are unaffected. I cannot read theETHEREUM_RPC_URLsecret, so I do not know whether CI would hit this, but v1.5.1 avoids it either way. v1.5.1 is what the toolchain action'sstablechannel currently resolves to.Verification
Reproduced against forge 1.8.0-nightly (
e469863), the exact build CI installed on 2026-08-22, using a clone that replicatesactions/checkout(--depth=1plusgit submodule update --init --force --depth=1 --recursive).forge installpathspec 'v0.1.3' did not matchforge buildforge testforge coverageThe test and coverage runs above are on v1.5.1 with a real mainnet RPC, so the forking test in
ERC721SeaDropCloneFactory.t.solran rather than being skipped. Under 1.8.0-nightly the same suite is 55 passed / 1 failed, the one failure being the Alchemy probe described above; v1.7.1 also passes 56/56.Dependency resolution is unchanged. Recorded gitlinks before and after the edit:
Notes
forge installwrites afoundry.lockthat is neither committed nor ignored, so it shows up as untracked after a local run. Committing it would pin dependencies explicitly and is the direction Foundry recommends, but it adds a file that has to be kept in step with.gitmodules, so I left it out of this change.