From 87949511957cba5fc19e4f8b8689ed3c43652b8c Mon Sep 17 00:00:00 2001 From: Gokul Krishnaa Devaraju Date: Mon, 31 Aug 2026 14:23:23 -0700 Subject: [PATCH] ci: add non-blocking Node Current (26.x) leg to unit-test matrix Runs unit tests against Node's Current release line alongside the required Active/Maintenance LTS versions. Failures on 26.x don't block merge (continue-on-error) but post/update a PR comment so the incompatibility isn't silently missed, and clear it once fixed. Ticket: WCN-2441 --- .github/workflows/ci.yml | 65 ++++++++++++++++++++++++++++++++++++++++ README.md | 7 +++-- 2 files changed, 70 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0dcaefb196..692cb19460 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -55,11 +55,20 @@ jobs: runs-on: ubuntu-latest needs: [changes] if: always() && (needs.changes.result == 'skipped' || needs.changes.outputs.source == 'true') + permissions: + contents: read + pull-requests: write strategy: fail-fast: false matrix: node-version: [22.x, 24.x] + experimental: [false] + include: + # Node's Current release line — not yet an LTS. Failures here are + # surfaced via PR comment but do not block merge (see all-checks). + - node-version: 26.x + experimental: true steps: - uses: socketdev/action@937f824ec476dfd164d4a4d9995751427b0be143 # v1.3.0 @@ -112,10 +121,66 @@ jobs: run: yarn run postinstall - name: Unit Test + id: unit-test + continue-on-error: ${{ matrix.experimental }} run: yarn run unit-test-changed env: BITGOJS_TEST_PASSWORD: ${{ secrets.BITGOJS_TEST_PASSWORD }} + - name: Comment on Node Current failure + if: matrix.experimental && steps.unit-test.outcome == 'failure' && github.event_name == 'pull_request' + uses: actions/github-script@v7 + with: + script: | + const marker = ''; + const body = `${marker}\n⚠️ Unit tests are failing on Node ${{ matrix.node-version }} (Current release line, non-blocking). ` + + `This is not an LTS version yet, so it does not block merge, but it signals an incompatibility to fix before Node ${{ matrix.node-version }} becomes LTS.\n\n` + + `[View run](${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId})`; + + const { data: comments } = await github.rest.issues.listComments({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.payload.pull_request.number, + }); + const existing = comments.find((c) => c.body.includes(marker)); + + if (existing) { + await github.rest.issues.updateComment({ + owner: context.repo.owner, + repo: context.repo.repo, + comment_id: existing.id, + body, + }); + } else { + await github.rest.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.payload.pull_request.number, + body, + }); + } + + - name: Resolve Node Current failure comment + if: matrix.experimental && steps.unit-test.outcome == 'success' && github.event_name == 'pull_request' + uses: actions/github-script@v7 + with: + script: | + const marker = ''; + const { data: comments } = await github.rest.issues.listComments({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.payload.pull_request.number, + }); + const existing = comments.find((c) => c.body.includes(marker)); + if (existing) { + await github.rest.issues.updateComment({ + owner: context.repo.owner, + repo: context.repo.repo, + comment_id: existing.id, + body: `${marker}\n✅ Unit tests now pass on Node ${{ matrix.node-version }} (Current release line).`, + }); + } + # - name: Upload Code Coverage # run: | # yarn run gen-coverage-changed diff --git a/README.md b/README.md index 4bc2604c89..c3e9b423b7 100644 --- a/README.md +++ b/README.md @@ -60,8 +60,11 @@ We specifically limit our support to these versions of Node, not because this pa As each Node LTS version reaches its end-of-life we will exclude that version from the node engines property of our package's package.json file. Removing a Node version is considered a breaking change and will entail the publishing of a new major version of this package. We will not accept any requests to support an end-of-life version of Node, and any pull requests or issues regarding support for an end-of-life version of Node will be closed. We will accept code that allows this package to run on newer, non-LTS, versions of Node. Furthermore, we will attempt to ensure our own changes work on the latest version of Node. To help in that commitment, our continuous integration setup runs the full test suite on the latest release of the following versions of node: -- `22` -- `24` +- `22` (Maintenance LTS) — required to pass +- `24` (Active LTS) — required to pass +- `26` (Current) — run non-blocking; a failure posts a warning comment on the PR instead of blocking merge + +When a new Node major becomes Active LTS, update the `node-version` matrix in `.github/workflows/ci.yml` (moving the outgoing Current version into the required set and adding the new Current release), and bump the `engines.node` range across all `modules/*/package.json` files accordingly. JavaScript package managers should allow you to install this package with any version of Node, with, at most, a warning if your version of Node does not fall within the range specified by our node engines property. If you encounter issues installing this package on a supported version of Node, please report the issue to us.