Skip to content

ci: derive Node versions in a prepare-environment job - #11229

Merged
Mrtenz merged 6 commits into
mainfrom
mrtenz/dynamic-node-versions
Nov 3, 2026
Merged

Mrtenz merged 6 commits into
mainfrom
mrtenz/dynamic-node-versions

Conversation

@Mrtenz

@Mrtenz Mrtenz commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

Explanation

The Lint, Build, and Test workflow hardcoded its Node versions in several places: [22.x, 24.x, 26.x] for prepare, 26.x for most other jobs, and 24.x in the conditions on the merge base and changed package steps.

This adds a prepare-environment job that lists the supported versions once and outputs:

  • node-versions: all supported versions on main and release branches, otherwise only the latest.
  • latest-version: the newest supported version.

The prepare matrix reads node-versions, and the other jobs use latest-version instead of a hardcoded 26.x. The merge base and changed package steps in prepare now run on the latest version instead of 24.x, so they still run when the matrix only contains the latest version.

References

None.

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

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-environment job instead of scattering 22.x / 24.x / 26.x across lint-build-test.yml.

That job outputs node-versions (all supported versions on main and release/*, otherwise only the latest) and latest-version. The prepare matrix now uses node-versions, and lint, build, test-scripts, and related jobs use latest-version instead of a fixed 26.x matrix entry.

Merge-base and changed-package steps in prepare now run on latest-version rather than 24.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.

@Mrtenz
Mrtenz added this pull request to stack #11234 November 2, 2026 10:58
@Mrtenz
Mrtenz force-pushed the mrtenz/dynamic-node-versions branch from e0f3d5e to 0ee3aeb Compare November 2, 2026 13:43
@Mrtenz
Mrtenz removed this pull request from stack #11234 November 2, 2026 13:45
@Mrtenz
Mrtenz changed the base branch from main to mrtenz/auto-changelog-all November 2, 2026 13:45
@Mrtenz
Mrtenz added this pull request to stack #11236 November 2, 2026 13:45
@Mrtenz
Mrtenz force-pushed the mrtenz/dynamic-node-versions branch from 0ee3aeb to d4fdb7e Compare November 2, 2026 13:47
@Mrtenz
Mrtenz force-pushed the mrtenz/dynamic-node-versions branch from d4fdb7e to 78cd9c9 Compare November 2, 2026 14:23
Base automatically changed from mrtenz/auto-changelog-all to main November 2, 2026 20:20
@Mrtenz
Mrtenz force-pushed the mrtenz/dynamic-node-versions branch from 78cd9c9 to d9ee8af Compare November 2, 2026 20:20
@Mrtenz Mrtenz changed the title ci: derive Node versions in a get-node-versions job ci: derive Node versions in a prepare-environment job Nov 3, 2026
contents: read

jobs:
prepare-environment:

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Mrtenz force-pushed the mrtenz/dynamic-node-versions branch from 47827e5 to 4f7ee41 Compare November 3, 2026 09:55
@Mrtenz
Mrtenz marked this pull request as ready for review November 3, 2026 09:59
@Mrtenz
Mrtenz requested a review from a team as a code owner November 3, 2026 09:59
@Mrtenz
Mrtenz deployed to default-branch November 3, 2026 09:59 — with GitHub Actions Active
Comment thread .github/workflows/lint-build-test.yml Resolved
- 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 != '')

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this outdated?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@Mrtenz
Mrtenz enabled stacked auto-merge November 3, 2026 10:07
@Mrtenz
Mrtenz added this pull request to the merge queue Nov 3, 2026
Merged via the queue into main with commit 87bbb5c Nov 3, 2026
154 checks passed
@Mrtenz
Mrtenz deleted the mrtenz/dynamic-node-versions branch November 3, 2026 10:15
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.

2 participants