-
Notifications
You must be signed in to change notification settings - Fork 512
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add node v22 and npm v10 support #2695
base: main
Are you sure you want to change the base?
Conversation
This works locally, and in a Linux docker container, but not in CI for some reason..... |
This is likely related: nodejs/node#52797 |
@CodeRabbit full review |
@coderabbitai full review |
Actions performedFull review triggered. |
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (1)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including You can disable this status message by setting the WalkthroughThe changes involve updates to the CI/CD workflow configuration and package definitions. The Node.js and npm versions in the CI/CD pipeline have been upgraded, expanding the Node.js version matrix and updating the npm version. Additionally, the Changes
Suggested reviewers
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
@coderabbitai full review |
Actions performedFull review triggered. |
Update: this problem has been fixed, and seems to have been fixed in every minor version of Node 22 (I didn't check all the patch versions). So anyone running into this issue should just upgrade their Node 22 version. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (5)
package.json (1)
68-68
: Approved, but consider a more controlled version range.The removal of the upper limit for the npm version (
>=7.10.0
) allows for greater flexibility and easier adoption of newer npm versions. This change aligns with the PR objective of adding Node 22 support.However, to maintain better control over the development environment and reduce the risk of compatibility issues, consider using a more specific version range. For example:
"npm": ">=7.10.0 <11.0.0"This approach would allow for a wider range of npm versions while still providing an upper bound to prevent potential breaking changes from future major releases.
.github/workflows/nodejs.yml (4)
62-62
: LGTM: Adding Node.js 22.x to the test matrixThe addition of Node.js 22.x to the test matrix aligns perfectly with the PR objective to add Node 22 support. This ensures that unit tests are run across all supported Node.js versions, including the latest LTS versions and the newest release.
Consider adding a comment explaining the Node.js version selection strategy, e.g.:
node-version: [18.x, 20.x, 22.x] # Latest LTS versions and current releaseThis will help future maintainers understand the reasoning behind the version selection.
71-73
: LGTM: Consistent npm version updateThe addition of npm version 10 setup in the "unit" job is consistent with the previous update in the "build-and-lint" job. This ensures that all jobs use the same npm version, which is a good practice for maintaining consistency across the workflow.
Consider creating a reusable workflow step for setting up npm version 10, as this setup is repeated across multiple jobs. This would improve maintainability and reduce duplication. For example:
jobs: setup-npm: runs-on: ubuntu-latest steps: - name: Setup npm version 10 run: | npm i -g npm@10 --registry=https://registry.npmjs.org outputs: npm-path: ${{ steps.npm-path.outputs.path }} unit: needs: setup-npm steps: - uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} - name: Use npm 10 run: echo "${{ needs.setup-npm.outputs.npm-path }}" >> $GITHUB_PATHThis approach would allow you to reuse the npm setup across all jobs that require it.
204-204
: LGTM: Comprehensive updates across all jobsThe changes in the "snippets" job complete the set of updates across all jobs in the workflow:
- Adding Node.js 22.x to the test matrix ensures that code snippets are tested on the latest Node.js version.
- Setting up npm version 10 maintains consistency with the npm version used in other jobs.
These final changes ensure that all aspects of the project (build, lint, unit tests, integration tests, and code snippets) are tested and run using the latest Node.js and npm versions.
With these changes, the workflow now comprehensively covers Node.js 22 support across all jobs. This update significantly improves the robustness of your CI process by ensuring compatibility with the latest Node.js version.
To further enhance the workflow:
- Consider adding a job to test with the minimum supported Node.js version to ensure backward compatibility.
- Implement the suggestions from previous comments to improve code reuse and documentation.
- Regularly review and update the Node.js version matrix to stay current with the latest LTS releases.
Also applies to: 213-215
Line range hint
1-240
: Summary: Successful implementation of Node.js 22 supportThis PR successfully achieves its primary objective of adding CI support for Node.js version 22. The changes made to the
.github/workflows/nodejs.yml
file are comprehensive and consistent, updating all relevant jobs to include Node.js 22.x in their test matrices and upgrading npm to version 10 throughout the workflow.Key improvements:
- All jobs (build-and-lint, unit, integration, and snippets) now support Node.js 22.x.
- npm has been updated to version 10 across all jobs, ensuring consistency.
- The CI process now covers a wider range of Node.js versions (18.x, 20.x, and 22.x), improving the robustness of the testing suite.
These changes significantly enhance the CI/CD pipeline by ensuring compatibility with the latest Node.js version while maintaining support for previous LTS versions.
To further improve the workflow:
- Implement the suggested reusable workflow step for npm setup to reduce code duplication.
- Add comments explaining the Node.js version selection strategy for better maintainability.
- Consider adding a job to test with the minimum supported Node.js version for backward compatibility checks.
- Regularly review and update the Node.js version matrix to stay current with the latest LTS releases.
Overall, this PR successfully addresses the stated objectives and improves the project's CI process.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
⛔ Files ignored due to path filters (1)
package-lock.json
is excluded by!**/package-lock.json
📒 Files selected for processing (2)
- .github/workflows/nodejs.yml (8 hunks)
- package.json (1 hunks)
🧰 Additional context used
📓 Learnings (1)
.github/workflows/nodejs.yml (1)
Learnt from: mvadari PR: XRPLF/xrpl.js#2788 File: .github/workflows/nodejs.yml:25-25 Timestamp: 2024-09-26T21:14:56.813Z Learning: In `.github/workflows/nodejs.yml`, the `build-and-lint` job's actions `actions/setup-node` and `actions/cache` are updated to `@v4`.
🔇 Additional comments (3)
package.json (1)
67-68
: Verify Node 22 compatibility.While the npm version constraint has been updated, there's no explicit mention of Node 22 support in the
engines
section. To ensure full compatibility with Node 22, consider updating thenode
version constraint as well.Run the following script to check the current Node.js version support:
.github/workflows/nodejs.yml (2)
31-33
: LGTM: Updating to npm version 10The addition of npm version 10 setup is consistent with the PR objective to update to the latest versions. This change is appropriate for Node.js 18.x and above, and it uses the official npm registry, which is a good practice.
102-102
: LGTM: Consistent updates for integration testsThe changes in the "integration" job are consistent with the updates made in previous jobs:
- Adding Node.js 22.x to the test matrix ensures that integration tests are run on the latest Node.js version.
- Setting up npm version 10 maintains consistency with the npm version used in other jobs.
These changes align well with the PR objective and ensure that integration tests are run with the latest Node.js and npm versions.
Please refer to the previous comments regarding:
- Adding a comment to explain the Node.js version selection strategy.
- Considering a reusable workflow step for setting up npm version 10 to reduce duplication across jobs.
Also applies to: 116-118
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (1)
README.md (1)
28-28
: LGTM! Consider a minor clarification.The update to include Node.js v22 support aligns well with the PR objective. The information is clear and consistent with the rest of the document.
For slightly improved readability, you might consider adding "LTS" (Long Term Support) to v18 and v20, as these are the current LTS versions. This could help users understand which versions are recommended for production use. For example:
- + **[Node.js v18](https://nodejs.org/)** is recommended. We also support v20 and v22. Other versions may work but are not frequently tested. + + **[Node.js v18 LTS](https://nodejs.org/)** is recommended. We also support v20 LTS and v22. Other versions may work but are not frequently tested.🧰 Tools
🪛 LanguageTool
[uncategorized] ~28-~28: Possible missing comma found.
Context: ...ort v20 and v22. Other versions may work but are not frequently tested. ### Install...(AI_HYDRA_LEO_MISSING_COMMA)
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (1)
- README.md (1 hunks)
🧰 Additional context used
🪛 LanguageTool
README.md
[uncategorized] ~28-~28: Possible missing comma found.
Context: ...ort v20 and v22. Other versions may work but are not frequently tested. ### Install...(AI_HYDRA_LEO_MISSING_COMMA)
@@ -65,6 +65,6 @@ | |||
], | |||
"engines": { | |||
"node": ">=18.0.0", | |||
"npm": ">=7.10.0 < 10.0.0" | |||
"npm": ">=7.10.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't the CI adhere to the minimum supported version of npm
? If users who use npm@v7
experience any problems with xrpl.js, we won't detect it since we are upgrading to npm@v10
.
High Level Overview of Change
This PR adds CI for Node 22 and updates all the actions to the latest versions. It also adds support for npm v10.
Context of Change
node v22 was just released
Type of Change
Test Plan
CI should pass with node 22.