Repository navigation
Conversation
UlisesGascon
left a comment
There was a problem hiding this comment.
I think that might want to make a specific step for alpha versions as we do for the legacy (https://github.com/expressjs/express/blob/master/.github/workflows/legacy.yml)?
Also seems like we need to wait a bit until this is solved: actions/setup-node#1657
Yes! We can have new workflow
We can use |
| # Workaround for actions/setup-node#1657: `27`, `27.0.0` and `27.0.0-alpha` | ||
| # are not recognized yet, but `latest` currently resolves to the newest Alpha. | ||
| # Once setup-node adds `allow-prereleases: true`, switch to `node-version: 27`. | ||
| node-version: [latest] |
There was a problem hiding this comment.
Warning · ci
node-version: [latest] is a floating alias, not Node 27, yet this workflow exists to test Node 27 (PR title: 'build with node v27'). Nothing in the job checks which version was installed: the 'Output Node and NPM versions' step only echoes node -v. setup-node's latest normally resolves to the newest stable release, and only the comment on lines 33-36 says it currently picks the Alpha. If latest resolves to stable, this job repeats the Node 26 run already in ci.yml (line 49) and still passes. It reports nothing about 27, and with continue-on-error: true nobody would notice. It will also drift to 27.0.0 stable and then 28 with no change to this file, and the job label will just read 'latest'. Note that the reviewers' suggested pins (27.0.0-alpha) are the very values the comment says setup-node does not accept yet, so add a version guard instead. Also confirm from a run log that v27.x is installed. The PR description itself suggests waiting for setup-node support.
| node-version: [latest] | |
| - name: Assert Node.js 27 | |
| shell: bash | |
| run: node -e "if (process.versions.node.split('.')[0] !== '27') { console.error('Expected Node 27, got ' + process.version); process.exit(1) }" |
code-check · architect, pragmatist, skeptic
There was a problem hiding this comment.
Thanks for the review. You're right that latest is a floating alias and nothing in the job verifies that Node 27 was actually installed so this could silently run on stable and still pass.
suggestion replaces line 37 node-version: [latest] which sits inside the matrix: block. That would put a step into the matrix and remove matrix.node-version which the job name and the setup-node step both use. I've kept the matrix as it is and added the same assertion as a separate step right after setup-node so the job fails if the installed major version isn't 27.
I'm keeping latest for now because 27, 27.0.0 and 27.0.0-alpha aren't accepted by setup-node actions/setup-node#1657 so pinning isn't an option. The comment in the matrix explains this and I'll switch to node-version: 27 and drop the guard once that's supported.
let's wait for stable release- https://github.com/nodejs/node/releases