Skip to content

ci: disable setup-node npm cache + add job timeouts#1035

Merged
zajck merged 4 commits into
mainfrom
ci/harden-npm-ci-with-timeouts
May 28, 2026
Merged

ci: disable setup-node npm cache + add job timeouts#1035
zajck merged 4 commits into
mainfrom
ci/harden-npm-ci-with-timeouts

Conversation

@zajck

@zajck zajck commented May 28, 2026

Copy link
Copy Markdown
Member

Summary

Workflows have been hanging indefinitely on the step labeled `npm ci`. Root cause: `actions/setup-node@v3` with `cache: "npm"` deadlocks on this monorepo's lockfile (same symptom as actions/setup-node#516).

Evidence: the workflows that already skip the npm cache — chromatic, and the `e2e-tests` job in `ci.yaml` (which has `# cache: "npm"` commented out with a comment referencing this exact issue) — never hang. Only the workflows with `cache: "npm"` enabled get stuck.

Changes

  • Remove `cache: "npm"` from every `actions/setup-node` usage: `lint-build-test`, `publish-alpha` `publish` + `publish_latest_release`, `pin-to-pinata`.
  • Add `timeout-minutes` to every job (30 min for build/publish, 60 min for e2e/pin-to-pinata) so a future hang fails fast instead of burning 6 h.
  • Switch `npm ci` → `npm ci --no-audit --no-fund` to skip non-essential network calls. (Dropped `--prefer-offline` since there's no GH-managed cache to prefer anymore.)

Trade-off

Without the npm cache, `npm ci` will redownload tarballs from the registry on every run instead of pulling them from GHA cache. In practice this is fine — npm registry CDN is fast, and "slow" beats "hanging for 6 h".

Test plan

  • After merge, observe `Publish alpha/latest release` on next push to `main` — should complete in ~5-10 min instead of hanging.
  • Reopen this PR / push a no-op commit — CI should pass.
  • Confirm `pin-to-pinata` cron run no longer accumulates stuck instances.

🤖 Generated with Claude Code

zajck and others added 2 commits May 28, 2026 17:20
Workflows have been hanging indefinitely on `npm ci`, burning 6h of runner
time before failing. Two changes:

- Add timeout-minutes to every job (30 min for build/publish, 60 min for
  e2e and pin-to-pinata) so a stuck step fails fast and can be rerun.
- Switch `npm ci` to `npm ci --prefer-offline --no-audit --no-fund` to
  prefer the actions/setup-node npm cache, skip the audit endpoint, and
  skip funding metadata. These flags only affect non-essential network
  calls — installation correctness is unchanged.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The actual hang root cause: actions/setup-node@v3's npm cache restore
(cache: \"npm\") deadlocks on this monorepo — same issue tracked in
actions/setup-node#516. The chromatic workflow
and the e2e-tests job both already skip this cache and never hang.

Remove cache: \"npm\" from every setup-node usage (lint-build-test,
publish-alpha publish + publish_latest_release, pin-to-pinata). Also drop
--prefer-offline since there's no GH-managed cache to prefer; keep
--no-audit and --no-fund.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@zajck zajck changed the title ci: harden npm ci with timeouts and offline-preferring flags ci: disable setup-node npm cache + add job timeouts May 28, 2026
zajck and others added 2 commits May 28, 2026 17:41
v3 of these actions uses the deprecated Node 16 runtime, which may be
contributing to the npm ci hangs. The chromatic workflow — which doesn't
hang — already uses actions/checkout@v4. Bring the other hot-path
workflows in line.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Hypothesis for the npm ci hangs: Node 24 ships npm 11, which interacts
poorly with this monorepo's lockfile. Evidence:

- The chromatic workflow doesn't use actions/setup-node, so it picks up
  the ubuntu-latest runner's default Node (currently 22). It never hangs.
- All workflows that explicitly set node-version: \"24\" hang on npm ci.
- The project's volta config already pins node 22.18.0 + npm 10.9.0,
  i.e. devs run on Node 22 locally — which matches \"works locally\".

Bring the hot-path CI/publish/pin workflows back to Node 22 to match.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@codecov

codecov Bot commented May 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.73%. Comparing base (f0cee5b) to head (b6ffb2e).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1035   +/-   ##
=======================================
  Coverage   91.73%   91.73%           
=======================================
  Files         182      182           
  Lines        7764     7766    +2     
  Branches     1514     1514           
=======================================
+ Hits         7122     7124    +2     
  Misses        642      642           
Flag Coverage Δ
common 92.73% <ø> (ø)
core-sdk 67.24% <ø> (+<0.01%) ⬆️
e2e 85.10% <ø> (-0.01%) ⬇️
eth-connect-sdk 95.06% <ø> (ø)
ethers-sdk 74.33% <ø> (ø)
ipfs-storage 91.75% <ø> (ø)
metadata 94.70% <ø> (ø)
unittests 69.84% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@zajck
zajck merged commit 1f8bca7 into main May 28, 2026
11 of 14 checks passed
@zajck
zajck deleted the ci/harden-npm-ci-with-timeouts branch May 28, 2026 16:28
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