Skip to content

fix(ci): handle Node 25 incompatibility with c8 11.0.0 / yargs 17.x#2783

Merged
brendandburns merged 4 commits intodependabot/npm_and_yarn/main/c8-11.0.0from
copilot/sub-pr-2779
Mar 3, 2026
Merged

fix(ci): handle Node 25 incompatibility with c8 11.0.0 / yargs 17.x#2783
brendandburns merged 4 commits intodependabot/npm_and_yarn/main/c8-11.0.0from
copilot/sub-pr-2779

Conversation

Copy link
Contributor

Copilot AI commented Feb 28, 2026

c8 11.0.0 (bumped to fix CVE-2026-26996 in minimatch) fails on Node 25 with ReferenceError: require is not defined in ES module scope. Node 25 changed how extension-less files in "type": "module" packages are loaded—they're now treated as ESM. c8 11.0.0's updated test-exclude (v7→v8) switched glob v10→v13, which eliminated the node_modules/yargs/node_modules/ nested directory. Without it, yargs/yargs (extension-less, in a "type": "module" package) is now loaded as ESM by Node 25, where require() is not defined.

Changes

  • package.json

    • Add test-no-coverage script — identical to test but without c8, for use on Node 25 where c8 cannot start
  • .github/workflows/test.yml

    • On Node 25, run npm run test-no-coverage instead of npm test to skip c8 coverage and fall back to plain unit tests

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 28, 2026
@k8s-ci-robot k8s-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Feb 28, 2026
Co-authored-by: brendandburns <5751682+brendandburns@users.noreply.github.com>
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Copilot
Once this PR has been reviewed and has the lgtm label, please ask for approval from brendandburns. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copilot AI changed the title [WIP] Update c8 dependency from 10.1.3 to 11.0.0 fix(ci): handle Node 25 incompatibility with c8 11.0.0 / yargs 17.x Feb 28, 2026
@brendandburns
Copy link
Contributor

@copilot as an alternative can you disable coverage via c8 for node25 and fall back to just plain unit tests?

Co-authored-by: brendandburns <5751682+brendandburns@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Mar 3, 2026

@copilot as an alternative can you disable coverage via c8 for node25 and fall back to just plain unit tests?

Done in commit 528c983. Added a test-no-coverage script to package.json that runs node --test --test-reporter=spec --import tsx src/*_test.ts (identical to test but without the c8 prefix). The workflow now uses npm test for all nodes except 25, and npm run test-no-coverage for Node 25, with continue-on-error removed.

@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Mar 3, 2026
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove this line as it is now unrelated.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed in commit 228e04a.

@brendandburns
Copy link
Contributor

@copilot please address comments

Co-authored-by: brendandburns <5751682+brendandburns@users.noreply.github.com>
@k8s-ci-robot k8s-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Mar 3, 2026
Copy link
Contributor Author

Copilot AI commented Mar 3, 2026

@copilot please address comments

All review comments have been addressed — the fail-fast: false line was removed in commit 228e04a.

@brendandburns brendandburns marked this pull request as ready for review March 3, 2026 04:27
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 3, 2026
@brendandburns brendandburns merged commit 91c2bae into dependabot/npm_and_yarn/main/c8-11.0.0 Mar 3, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants