Skip to content

ci: pin subgraph deploy workflows to Node 22 - #1038

Merged
levalleux-ludo merged 1 commit into
mainfrom
fix-subgraph-deploy-node-version
Aug 26, 2026
Merged

levalleux-ludo merged 1 commit into
mainfrom
fix-subgraph-deploy-node-version

Conversation

@levalleux-ludo

Copy link
Copy Markdown
Member

Fixes the npm ci failure in run 32975075125, where the subgraph deploy job failed immediately after #1037 merged:

npm error Invalid: lock file's typescript@5.8.3 does not satisfy typescript@5.9.3

It isn't the release commit

The obvious suspect was a63c3cc0 (chore(release): publish alpha), pushed by the publish job moments before the deploy job ran. It isn't. I extracted the manifests from both commits and ran npm ci --dry-run against each:

commit npm 10.9.3 npm 11
e56d4582 — the #1037 merge, before the release commit Invalid: lock file's typescript@5.8.3 does not satisfy typescript@5.9.3
a63c3cc0 — the release commit added 4049 packages ❌ same error

The commit before the release commit fails identically. The variable is the npm version, not the tree.

Root cause

deploy-{testing,staging,prod}-subgraph.yaml were on node-version: "24"; ci.yaml, publish-alpha.yaml, pin-to-pinata.yaml and the root package.json volta config (node 22.18.0 / npm 10.9.0) are all on 22. Node 24 ships npm 11.

The root package.json declares overrides: { "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 why publish-alpha.yaml installed the very same lock cleanly minutes earlier. No package.json in 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 24 npm ci against this lock since typescript 5.9.3 was published.

Why not regenerate the lock

The two npm majors want mutually incompatible locks:

lock generated by npm 10 npm 11
npm 10 (current) Invalid: lock file's typescript@5.8.3 does not satisfy typescript@5.9.3
npm 11 Missing: typescript@4.9.5 from lock file

They disagree over whether the root overrides.typescript: "^5.1.6" 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. No single lock satisfies both, so regenerating just moves the breakage onto ci.yaml and publish-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-cli declares engines.node >= 20.18.1 and @goldskycom/cli declares 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-run passes under npm 10.9.3 against the current main tree — that is exactly what these workflows will now run
  • workflows: YAML parses, prettier --check clean, actionlint reports only pre-existing findings

Follow-ups, not in this PR

  • Move the repo to npm 11 deliberately — resolve the override / e2e/opensea-api-mock conflict, regenerate the lock, and bump every workflow together. Worth doing before Node 22 goes EOL.
  • actionlint flags actions/{checkout,setup-node,cache}@v3 in all three of these workflows as too old to run. The rest of the repo is on v4; these are the only holdouts.
  • The deploy job checks out refs/remotes/origin/main — the moving branch tip — rather than github.sha, so it installed a63c3cc0 while the publish job installed e56d4582. Not the cause here, but a called workflow silently building a newer main than the one that triggered it is a hazard for a release pipeline.

🤖 Generated with Claude Code

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>
Copilot AI lite review requested due to automatic review settings August 26, 2026 15:30
@levalleux-ludo
levalleux-ludo merged commit b09e9f8 into main Aug 26, 2026
3 of 6 checks passed
@levalleux-ludo
levalleux-ludo deleted the fix-subgraph-deploy-node-version branch August 26, 2026 15:49
@levalleux-ludo
levalleux-ludo removed the request for review from Copilot August 26, 2026 16:50
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.

1 participant