Repository navigation
ci: Harden setup-nodejs against silent Node-version fall-through (no-changelog) - #30849
Merged
shortstacked merged 4 commits intoMay 21, 2026
Conversation
…changelog) Cache the Node toolcache, fail fast when setup-node activates the wrong Node version, and drop verbose Safe-chain logging that buries real install errors. Closes DEVP-169. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Contributor
Recommended reviewersBased on ownership of the 3 changed files in this PR:
|
Contributor
Performance ComparisonComparing current → latest master → 14-day baseline Idle baseline with Agents module loaded
Memory consumption baseline with starter plan resources
docker-stats
Idle baseline with Instance AI module loaded
How to read this table
|
Adversarial review of the prior commit surfaced two issues: - The new Verify Node.js Version step does strict equality against inputs.node-version, but ci-master.yml's unit-test matrix passes the semver wildcard 22.x. Pin to 22.22.3 (current latest Node 22 LTS) to match the 24.15.0 convention, get reproducibility, and let the verify step work as intended on both matrix rows. - The Restore Node.js Toolcache step hardcodes /x64 in the path but docker-build-push.yml runs this composite action on blacksmith-4vcpu-ubuntu-2204-arm via the linux/arm64 matrix entry in docker-config.mjs. Tighten the gate to runner.arch == 'X64' so the cache step no-ops cleanly on ARM instead of saving to a path setup-node never reads. Closes DEVP-169. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
…elog) - Remove the "Node v… active as expected." success echo from the new Verify Node.js Version step. A green check on the step name is the standard CI signal; the echo just adds noise on every job. - Tiny grammar fix in packages/testing/playwright/README.md. The .github/ changes alone leave ci-filter's `ci` and `e2e` flags false, so build, unit, and E2E shards skip — touching a playwright file flips both flags on so the composite-action changes get exercised end-to-end. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
…ion-against-silent-node
shortstacked
marked this pull request as ready for review
May 20, 2026 22:35
shortstacked
enabled auto-merge
May 20, 2026 22:38
Contributor
There was a problem hiding this comment.
No issues found across 3 files
Architecture diagram
sequenceDiagram
participant Runner as GitHub Runner
participant Cache as actions/cache
participant SetupNode as actions/setup-node
participant NodeTool as Node.js Toolcache
participant Verify as Verify Node.js Version
participant SetupPNPM as pnpm/action-setup
participant Install as Install Dependencies
participant nodejs_org as nodejs.org
Note over Runner,Install: ENHANCED: Node.js provisioning with cache & verification
Runner->>SetupPNPM: Setup pnpm
opt runner.os == 'Linux' && runner.arch == 'X64'
Runner->>Cache: Restore Node.js Toolcache
Note over Cache: key: node-toolcache-<os>-<arch>-<version>
Cache-->>Runner: cache hit/miss result
end
Runner->>SetupNode: Setup Node.js
SetupNode->>NodeTool: Check if version exists in toolcache
alt Cache Hit (toolcache populated)
NodeTool-->>SetupNode: Found @ /opt/hostedtoolcache/node/<version>/x64
SetupNode-->>Runner: Skip download, use cached node
else Cache Miss (first run or new version)
SetupNode->>nodejs_org: Download Node.js (33s)
nodejs_org-->>SetupNode: Downloaded
SetupNode->>NodeTool: Install to toolcache
SetupNode-->>Runner: Node ready
Note over Runner,Cache: Cache will save for subsequent jobs
end
Runner->>SetupNode: Provide node-version input
SetupNode-->>Runner: Node active in PATH
Runner->>Verify: Verify Node.js Version
Verify->>Verify: Compare actual vs expected version
alt Version matches
Verify-->>Runner: Node v<version> active as expected.
else Version mismatch (silent fall-through detection)
Verify-->>Runner: ::error:: setup-node did not activate Node <expected>
Runner->>Verify: exit 1 (immediate failure)
end
Runner->>Install: Run install command
Note over Install: SAFE_CHAIN_LOGGING removed (no verbose proxy logs)
Install->>Install: timeout 300s INSTALL_COMMAND --reporter=append-only
Install-->>Runner: Dependencies installed
Matsuuu
approved these changes
May 21, 2026
Matsuuu
left a comment
Member
There was a problem hiding this comment.
Thank you for this! This was also on my pet peeve list and just hadn't had time to explore it. Let's hope we find the actual issues more easily now!
shortstacked
deleted the
devp-169-harden-setup-nodejs-composite-action-against-silent-node
branch
May 21, 2026 06:27
2 of 4 tasks
shortstacked
added a commit
that referenced
this pull request
May 21, 2026
…e (no-changelog) The Restore Node.js Toolcache step cached `/opt/hostedtoolcache/node/<v>/x64` but not the sibling `x64.complete` marker file. Without the marker, actions/setup-node treats the restored toolchain as invalid and re-downloads from nodejs.org on every job — paying both the cache restore cost AND the download cost. The re-download path also opens the silent fall-through window tracked in actions/setup-node#1137, which the verify-node-version step added in #30849 has been catching. Cache the parent version directory so both `x64/` and `x64.complete` are captured. Bump the cache key to v2 to invalidate stale marker-less entries. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Contributor
|
Got released with |
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.
Summary
Three additive defences to
.github/actions/setup-nodejs/action.ymlso intermittentactions/setup-nodefailures become loud and immediate instead of surfacing 45s later as a confusingpnpm ELIFECYCLE:actions/[email protected]step keyed onnode-toolcache-<os>-<arch>-<version>, gatedif: runner.os == 'Linux'. First fresh runner pays the ~33s nodejs.org download; subsequent jobs (including parallel E2E shards) get a ~1s cache hit.setup-nodefinds the toolcache populated and skips the download entirely. Blacksmith transparently routes this through its S3 backend.Verify Node.js Versionstep immediately afterSetup Node.jsassertsnode --versionmatchesinputs.node-version. On mismatch, emits::error::and exits 1. Converts the silent fall-through into an immediate, obvious failure. Mirrors the existingVerify PNPM Cache Directorydefensive pattern that already references actions/setup-node#1137.SAFE_CHAIN_LOGGING: verbosefrom theInstall Dependenciesstep. The verbose MITM proxy log dump (~3000 lines ofSet up MITM tunnel/Package X is clean) flushed after the ELIFECYCLE line, burying the actual error.Linear: https://linear.app/n8n/issue/DEVP-169
Motivation
Eliminates an intermittent CI flake that costs wall-clock and runner minutes across 16 parallel E2E shards on retry. Converts a silent, confusing failure mode (looks like Safe-chain breakage, is actually Node provisioning) into a clear, debuggable one. Reuses existing patterns in the same file (
Verify PNPM Cache Directoryworkaround,retry.mjsprecedent) — no new dependencies or unfamiliar surface area.Failing job that surfaced this: https://github.com/n8n-io/n8n/actions/runs/26100630929/job/76752083283
Test plan
actions/cachelogsCache not found for input keys: node-toolcache-Linux-X64-24.15.0.Cache restored from key: node-toolcache-Linux-X64-24.15.0andsetup-nodereportsFound in cache @ /opt/hostedtoolcache/node/24.15.0/x64.Unsupported enginewarnings in install logs.Verify Node.js Versionstep printsNode v24.15.0 active as expected.and exits 0.🤖 Generated with Claude Code