From ba6bf71df4c6c7c0cc734fb8dff6219b81246126 Mon Sep 17 00:00:00 2001 From: JPeer264 Date: Fri, 30 Oct 2026 11:21:18 -0600 Subject: [PATCH] ci(node): Add optional Node 27 alpha tests Co-Authored-By: Claude Opus 5.5 --- .github/workflows/build.yml | 22 +++++++++++++++++++--- docs/supporting-a-new-node-version.md | 3 +++ 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0d470f273e39..dbe9d51609c4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -571,10 +571,12 @@ jobs: runs-on: namespace-profile-sentry-javascript-large;overrides.cache-tag=sentry-javascript${{ github.event_name == 'pull_request' && '-pr' || '' }} + # Node 27 is an alpha: its ABI and APIs can change, so its failures must not fail the required checks. + continue-on-error: ${{ matrix.node == '^27.0.0-0' }} strategy: fail-fast: false matrix: - node: [20.19, 22, 24, 26] + node: [20.19, 22, 24, 26, '^27.0.0-0'] steps: - name: Check out base commit (${{ github.event.pull_request.base.sha }}) uses: actions/checkout@v7 @@ -591,6 +593,11 @@ jobs: node-version: ${{ matrix.node }} - name: Restore caches uses: ./.github/actions/restore-cache + # The native modules have no prebuilt binaries for the Node 27 alpha, so compile them like an install on a + # user's machine does. + - name: Compile native modules + if: matrix.node == '^27.0.0-0' + run: pnpm rebuild @sentry/node-cpu-profiler @sentry/node-native-stacktrace - name: Run affected tests run: pnpm run test:pr:node --base=${{ github.event.pull_request.base.sha }} @@ -772,10 +779,12 @@ jobs: namespace-profile-sentry-javascript-large;overrides.cache-tag=sentry-javascript${{ github.event_name == 'pull_request' && '-pr' || '' }} timeout-minutes: 20 + # Node 27 is an alpha: its ABI and APIs can change, so its failures must not fail the required checks. + continue-on-error: ${{ matrix.node == '^27.0.0-0' }} strategy: fail-fast: false matrix: - node: [20.19, 22, 24, 26] + node: [20.19, 22, 24, 26, '^27.0.0-0'] shard: [1, 2, 3] steps: - name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }}) @@ -801,6 +810,11 @@ jobs: node-version: ${{ matrix.node }} - name: Restore caches uses: ./.github/actions/restore-cache + # The native modules have no prebuilt binaries for the Node 27 alpha, so compile them like an install on a + # user's machine does. + - name: Compile native modules + if: matrix.node == '^27.0.0-0' + run: pnpm rebuild @sentry/node-cpu-profiler @sentry/node-native-stacktrace - name: Run integration tests working-directory: dev-packages/node-integration-tests @@ -873,10 +887,12 @@ jobs: namespace-profile-sentry-javascript-large;overrides.cache-tag=sentry-javascript${{ github.event_name == 'pull_request' && '-pr' || '' }} timeout-minutes: 15 + # Node 27 is an alpha: its ABI and APIs can change, so its failures must not fail the required checks. + continue-on-error: ${{ matrix.node == '^27.0.0-0' }} strategy: fail-fast: false matrix: - node: [20.19, 22, 24, 26] + node: [20.19, 22, 24, 26, '^27.0.0-0'] steps: - name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }}) uses: actions/checkout@v7 diff --git a/docs/supporting-a-new-node-version.md b/docs/supporting-a-new-node-version.md index d952742d7503..4720570d1866 100644 --- a/docs/supporting-a-new-node-version.md +++ b/docs/supporting-a-new-node-version.md @@ -87,6 +87,9 @@ Repo: [sentry-javascript](https://github.com/getsentry/sentry-javascript) Reference: [#20710](https://github.com/getsentry/sentry-javascript/pull/20710) 1. Add the version to the CI test matrix in `.github/workflows/build.yml` to every `node: [20.19, 22, 24, 26]` entry. + While the new major is an alpha, the matrix has it as a range (e.g. `'^27.0.0-0'`) with `continue-on-error`, and a + `Compile native modules` step compiles the native modules from source for it. When the major is released, replace + the range with the major and remove `continue-on-error` and that step. 2. Bump the native module dependencies to the versions released in Steps 1 and 2: - [ ] `@sentry-internal/node-cpu-profiler` in `packages/profiling-node`