Skip to content

CI: Test Node 20.x, 22.x (Active LTS), 24.x (Current); gate coverage to 22.x#18

Merged
cloudbring merged 3 commits intomasterfrom
chore/ci-node-matrix
Aug 9, 2025
Merged

CI: Test Node 20.x, 22.x (Active LTS), 24.x (Current); gate coverage to 22.x#18
cloudbring merged 3 commits intomasterfrom
chore/ci-node-matrix

Conversation

@cloudbring
Copy link
Copy Markdown
Owner

@cloudbring cloudbring commented Aug 9, 2025

  • Expand matrix to Node 20.x, 22.x, and 24.x
  • Run tests and coverage in one step; enable integration via USE_REAL_ENV
  • Upload coverage/artifacts and append job summary only on 22.x to avoid duplicates

Rationale: Aligns with Node release policy (22.x Active LTS, 24.x Current, 20.x Maintenance LTS) and keeps CI efficient.

Summary by CodeRabbit

  • Chores
    • Updated CI workflow to test on Node.js versions 20.x, 22.x, and 24.x.
    • Adjusted coverage report uploads and artifact steps to run only on Node.js 22.x.
    • Upgraded Codecov integration to the latest version for improved coverage reporting.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Aug 9, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

The CI workflow configuration was updated to test against Node.js versions 20.x, 22.x, and 24.x. Coverage upload and artifact steps were restricted to only execute on Node.js 22.x, instead of previously running on 20.x or unconditionally.

Changes

Cohort / File(s) Change Summary
CI Workflow Node.js Matrix & Coverage Logic
.github/workflows/ci.yml
Expanded Node.js test matrix to include 22.x and 24.x; restricted coverage upload and artifact steps to only run on 22.x; updated Codecov action to v4 and corrected coverage upload parameter from file to files; split test execution by Node.js version; updated job permissions and build-and-publish Node.js version.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~7 minutes

Possibly related PRs

Poem

Hopping through CI fields so wide,
Now on Node 20, 22, and 24 we ride!
Coverage hops just on twenty-two,
Artifacts and reports, streamlined too.
With every version in the warren’s sight,
The workflow’s future is looking bright! 🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f62e43a and f7cc34d.

📒 Files selected for processing (1)
  • .github/workflows/ci.yml (3 hunks)
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/ci-node-matrix

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@cloudbring
Copy link
Copy Markdown
Owner Author

@CodeRabbit ignore

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Aug 9, 2025

Tip

For best results, initiate chat on the files or code changes.

@cloudbring, could you please clarify what you'd like me to ignore? Here are some options:

  • Specific review comments: Reply to the comment you want ignored with "@CodeRabbit ignore"
  • Files or paths: Configure path filters in your .coderabbit.yaml file
  • Types of issues: Add custom review instructions in your configuration

Let me know what you'd like to exclude from the review, and I'll help you with the appropriate approach.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🔭 Outside diff range comments (1)
.github/workflows/ci.yml (1)

37-43: Limit integration runs to a single Node version

The integration step will already skip when NEW_RELIC_API_KEY is unset, so we only need to guard against running it on every matrix entry (and thus duplicating external calls). In .github/workflows/ci.yml (around lines 37–43), update the step to:

       - name: Run tests with coverage (and integration)
+        if: |
+          matrix.node-version == '22.x' &&
+          secrets.NEW_RELIC_API_KEY != '' &&
+          vars.NEW_RELIC_ACCOUNT_ID != ''
         env:
           USE_REAL_ENV: true
           NEW_RELIC_API_KEY: ${{ secrets.NEW_RELIC_API_KEY }}
           NEW_RELIC_ACCOUNT_ID: ${{ vars.NEW_RELIC_ACCOUNT_ID }}
         run: npm run ai:test:coverage

If you still want pure unit/coverage runs on other Node versions, add a separate step (without USE_REAL_ENV) for those matrix entries.

🧹 Nitpick comments (3)
.github/workflows/ci.yml (3)

14-14: Prevent cascade cancellations across the expanded matrix.

Consider disabling fail-fast so a failure on one Node version doesn’t cancel the others.

 strategy:
+  fail-fast: false
   matrix:
     node-version: [20.x, 22.x, 24.x]

54-59: Artifact upload scoped to 22.x makes sense.

Consider explicitly handling missing files to avoid noisy warnings if earlier steps fail.

       - name: Upload HTML coverage as artifact
-        if: always() && matrix.node-version == '22.x'
+        if: always() && matrix.node-version == '22.x'
         uses: actions/upload-artifact@v4
         with:
           name: coverage-html
           path: coverage
+          if-no-files-found: warn
           retention-days: 7

82-85: Publish with Node 22.x to match the tested LTS baseline.

You test and upload coverage on 22.x (Active LTS) but publish with 20.x. Aligning the publish environment with 22.x reduces drift risk.

       - uses: actions/setup-node@v4
         with:
-          node-version: '20.x'
+          node-version: '22.x'
           registry-url: 'https://registry.npmjs.org'
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 98dffc2 and bfc8c3d.

📒 Files selected for processing (1)
  • .github/workflows/ci.yml (3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: test (24.x)
🔇 Additional comments (2)
.github/workflows/ci.yml (2)

14-14: Matrix update aligns with Node release policy — looks good.

20.x (Maintenance), 22.x (Active LTS), 24.x (Current) coverage is appropriate.


62-69: Appending coverage summary only on 22.x is appropriate.

This keeps the job summary clean and non-duplicative.

Comment thread .github/workflows/ci.yml Outdated
…ation to 22.x, Codecov v4 with OIDC, artifact warn, publish on 22.x)
@cloudbring cloudbring merged commit 5342450 into master Aug 9, 2025
3 checks passed
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.

1 participant