ci: pin subgraph deploy workflows to Node 22 - #1038
Merged
Merged
Conversation
The three subgraph deploy workflows ran on Node 24 while the rest of the repo
is on Node 22 - ci.yaml, publish-alpha.yaml, pin-to-pinata.yaml and the root
package.json volta config. Node 24 ships npm 11, which resolves the root
package.json override "typescript": "^5.1.6" to a concrete version and then
rejects the lock file's pinned 5.8.3:
npm error Invalid: lock file's typescript@5.8.3 does not satisfy typescript@5.9.3
No package.json in the repo declares 5.9.3; that is npm 11 re-resolving the
override against a registry where 5.9.3 is the newest 5.x. npm 10 does not
perform that check, which is why the same lock installs cleanly in
publish-alpha.yaml moments earlier.
Regenerating the lock does not fix it. The two npm majors disagree over
whether the root override applies inside e2e/opensea-api-mock, which asks for
typescript ^4.8.3: npm 10 keeps a nested typescript 4.9.5 for it, npm 11
applies the override and drops it. A lock built by npm 11 fails under npm 10
with "Missing: typescript@4.9.5 from lock file", and one built by npm 10
fails under npm 11 as above. No single lock satisfies both, so the workflows
have to agree on one npm.
Nothing in the deploy path needs Node 24: @graphprotocol/graph-cli declares
engines.node >= 20.18.1 and @goldskycom/cli declares none.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Fixes the
npm cifailure in run 32975075125, where the subgraph deploy job failed immediately after #1037 merged:It isn't the release commit
The obvious suspect was
a63c3cc0(chore(release): publish alpha), pushed by thepublishjob moments before the deploy job ran. It isn't. I extracted the manifests from both commits and rannpm ci --dry-runagainst each:e56d4582— the #1037 merge, before the release commitInvalid: lock file's typescript@5.8.3 does not satisfy typescript@5.9.3a63c3cc0— the release commitadded 4049 packagesThe commit before the release commit fails identically. The variable is the npm version, not the tree.
Root cause
deploy-{testing,staging,prod}-subgraph.yamlwere onnode-version: "24";ci.yaml,publish-alpha.yaml,pin-to-pinata.yamland the rootpackage.jsonvoltaconfig (node 22.18.0/npm 10.9.0) are all on 22. Node 24 ships npm 11.The root
package.jsondeclaresoverrides: { "typescript": "^5.1.6", … }and the lock pins typescript 5.8.3. npm 11 resolves that override to a concrete version — 5.9.3, the newest 5.x, published 2025-09-30 — and rejects the lock. npm 10 never performs that check, which is whypublish-alpha.yamlinstalled the very same lock cleanly minutes earlier. Nopackage.jsonin the tree declares 5.9.3; I grepped it.Why it surfaced now: the deploy job only runs when
packages/subgraph/**changes (SUBGRAPH_CHANGES == 'true'), so #1037 was the first Node 24npm ciagainst this lock since typescript 5.9.3 was published.Why not regenerate the lock
The two npm majors want mutually incompatible locks:
Invalid: lock file's typescript@5.8.3 does not satisfy typescript@5.9.3Missing: typescript@4.9.5 from lock fileThey disagree over whether the root
overrides.typescript: "^5.1.6"applies insidee2e/opensea-api-mock, which asks fortypescript: "^4.8.3". npm 10 keeps a nested typescript 4.9.5 for it; npm 11 applies the override and drops it. No single lock satisfies both, so regenerating just moves the breakage ontoci.yamlandpublish-alpha.yaml.The change
node-version: "24"→"22"in the three subgraph deploy workflows, plus a comment so this doesn't drift again. Nothing in the deploy path needs 24 —@graphprotocol/graph-clideclaresengines.node >= 20.18.1and@goldskycom/clideclares none. The 24 came in incidentally via #997 (npm trusted-publishing work), which left the publish and CI workflows on 22.Staging and prod were carrying the identical latent failure, so all three are fixed together.
Verification
npm ci --dry-runpasses under npm 10.9.3 against the currentmaintree — that is exactly what these workflows will now runprettier --checkclean,actionlintreports only pre-existing findingsFollow-ups, not in this PR
e2e/opensea-api-mockconflict, regenerate the lock, and bump every workflow together. Worth doing before Node 22 goes EOL.actionlintflagsactions/{checkout,setup-node,cache}@v3in all three of these workflows as too old to run. The rest of the repo is on v4; these are the only holdouts.refs/remotes/origin/main— the moving branch tip — rather thangithub.sha, so it installeda63c3cc0while the publish job installede56d4582. Not the cause here, but a called workflow silently building a newermainthan the one that triggered it is a hazard for a release pipeline.🤖 Generated with Claude Code