Repository navigation
ci: derive Node versions in a prepare-environment job - #11229
Merged
Merged
Conversation
Mrtenz
force-pushed
the
mrtenz/dynamic-node-versions
branch
from
November 2, 2026 13:43
e0f3d5e to
0ee3aeb
Compare
Mrtenz
force-pushed
the
mrtenz/dynamic-node-versions
branch
from
November 2, 2026 13:47
0ee3aeb to
d4fdb7e
Compare
Mrtenz
force-pushed
the
mrtenz/dynamic-node-versions
branch
from
November 2, 2026 14:23
d4fdb7e to
78cd9c9
Compare
Mrtenz
force-pushed
the
mrtenz/dynamic-node-versions
branch
from
November 2, 2026 20:20
78cd9c9 to
d9ee8af
Compare
get-node-versions jobprepare-environment job
Mrtenz
commented
Nov 3, 2026
| contents: read | ||
|
|
||
| jobs: | ||
| prepare-environment: |
Member
Author
There was a problem hiding this comment.
Initially named this get-node-versions, but in the next PR in this stack (#11233), I added logic to this step to get the shard matrix for Vitest to use, so this made more sense.
Add a `get-node-versions` job that lists the supported Node versions once and outputs `node-versions` (all versions on `main` and release branches, otherwise only the latest) and `latest-version`. The `prepare` matrix now reads `node-versions`, and the other jobs use `latest-version` instead of hardcoding `26.x`. The merge base and changed package steps now run on the latest version rather than `24.x`, so they still run when the matrix contains only the latest version.
Re-indent the multi-line `ALL` expression in `get-node-versions` (in `lint-build-test.yml`) to match the formatter output, so `yarn lint:misc` passes.
Mrtenz
force-pushed
the
mrtenz/dynamic-node-versions
branch
from
November 3, 2026 09:55
47827e5 to
4f7ee41
Compare
Mrtenz
marked this pull request as ready for review
November 3, 2026 09:59
| - name: Fetch merge base | ||
| id: fetch-merge-base | ||
| if: matrix.node-version == '24.x' && (github.base_ref != '' || github.event.merge_group.base_ref != '') | ||
| if: matrix.node-version == needs.prepare-environment.outputs.latest-version && (github.base_ref != '' || github.event.merge_group.base_ref != '') |
Member
Author
There was a problem hiding this comment.
I didn't change it when I added Node.js 26, yeah. Didn't really matter in practice because we ran all prepare jobs regardless, but that's not the case anymore after this change.
FrederikBolding
approved these changes
Nov 3, 2026
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.
Explanation
The
Lint, Build, and Testworkflow hardcoded its Node versions in several places:[22.x, 24.x, 26.x]forprepare,26.xfor most other jobs, and24.xin the conditions on the merge base and changed package steps.This adds a
prepare-environmentjob that lists the supported versions once and outputs:node-versions: all supported versions onmainand release branches, otherwise only the latest.latest-version: the newest supported version.The
preparematrix readsnode-versions, and the other jobs uselatest-versioninstead of a hardcoded26.x. The merge base and changed package steps inpreparenow run on the latest version instead of24.x, so they still run when the matrix only contains the latest version.References
None.
Checklist
Note
Medium Risk
Changes CI matrix and branch gating for Node versions and which matrix cell runs merge-base/change detection, which could affect coverage on non-main PRs if misconfigured.
Overview
Centralizes supported Node versions in a new
prepare-environmentjob instead of scattering22.x/24.x/26.xacrosslint-build-test.yml.That job outputs
node-versions(all supported versions onmainandrelease/*, otherwise only the latest) andlatest-version. Thepreparematrix now usesnode-versions, and lint, build, test-scripts, and related jobs uselatest-versioninstead of a fixed26.xmatrix entry.Merge-base and changed-package steps in
preparenow run onlatest-versionrather than24.x, so change detection still runs when PR workflows only matrix the latest Node version.Reviewed by Cursor Bugbot for commit 47e14bf. Bugbot is set up for automated code reviews on this repo. Configure here.