Skip to content
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

Upgrade Node.js from v18.19 to LTS v20.18 #586 #587

Merged
merged 1 commit into from
Oct 25, 2024

Conversation

Reterics
Copy link
Contributor

@Reterics Reterics commented Oct 15, 2024

Updated:

  • package.json: Engine upgraded to 20.18 and removed deprecated package: @okp4/eslint-config
  • yarn.lock: Regenerated after engine update
  • .prettierrc.js: Applied rules according to the removed @okp4/eslint-config
  • Github Workflow files updated:
    • build.yml
    • capture-website.yml
    • lint.yml
    • update-versioned-docs.yml

After the above, i made sure that the build and local environment is running.

This PR is connected to the #586

Summary by CodeRabbit

  • New Features

    • Introduced a new linting job to enforce branch naming conventions during pull requests.
  • Improvements

    • Updated Node.js version across multiple workflows to enhance compatibility and performance.
    • Enhanced JSON file validation in the linting process.
  • Configuration Changes

    • Explicit Prettier configuration options defined for improved code formatting.
    • Updated Node.js version in the project’s package configuration.

Copy link

vercel bot commented Oct 15, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 24, 2024 10:21am

Copy link
Contributor

coderabbitai bot commented Oct 15, 2024

Note

Reviews paused

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Walkthrough

The pull request includes updates to several GitHub Actions workflow files to change the Node.js version from various earlier versions to 20.18. Additionally, the .prettierrc.js file has been modified to explicitly define Prettier configuration options without using a spread operator from another configuration file. The package.json file reflects the updated Node.js version in the engines section and removes a specific development dependency.

Changes

File Path Change Summary
.github/workflows/build.yml Node.js version updated from 18.19 to 20.18 for build-yarn job.
.github/workflows/capture-website.yml Node.js version updated from 18.12 to 20.18 in Setup node environment step.
.github/workflows/lint.yml Node.js version updated from 18.19 to 20.18 for lint-web and lint-scss jobs; added lint-branch-name job; enhanced lint-json job.
.github/workflows/update-versioned-docs.yml Node.js version updated from 18.19 to 20.18 in Setup node environment step.
.prettierrc.js Removed spread operator for Prettier config; defined explicit Prettier options including overrides for .scss.
package.json Node.js version updated from ^18.0 to ^20.18; removed @okp4/eslint-config from devDependencies.

Possibly related issues

Poem

🐰 In the garden of code, we hop with glee,
Upgrading Node, as happy as can be!
With workflows refreshed and settings anew,
Our projects will flourish, and bugs bid adieu!
So let's dance through the branches, in harmony we sing,
For every new version, joy it will bring! 🌼✨


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?

❤️ 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.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • 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 generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @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 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.

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.

Copy link
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: 3

🧹 Outside diff range and nitpick comments (4)
.prettierrc.js (1)

8-8: Consider updating to bracketSameLine for future compatibility.

The jsxBracketSameLine: false setting is correct and places the closing bracket of a multi-line JSX element on a new line, which can improve readability. However, this option has been deprecated in newer Prettier versions.

For future compatibility, consider updating to the newer option name:

-  jsxBracketSameLine: false,
+  bracketSameLine: false,
.github/workflows/capture-website.yml (1)

Line range hint 38-39: Consider implementing a version update strategy for capture-website-cli.

While using a specific version (4.0.0) of capture-website-cli ensures consistency, it may miss out on newer features or bug fixes. Consider implementing a strategy to periodically review and update this dependency.

You could:

  1. Set up a dependabot configuration to automatically update this package.
  2. Add a TODO comment to remind the team to check for updates periodically.
  3. Use a version range (e.g., ^4.0.0) to automatically get non-breaking updates.

Example of adding a TODO comment:

 - name: Install global dependencies
   run: |
+    # TODO: Periodically check for updates to capture-website-cli
     npm install --global [email protected]
.github/workflows/lint.yml (2)

Line range hint 151-201: New branch name linting job is a valuable addition.

The lint-branch-name job effectively enforces branch naming conventions, which is crucial for maintaining a clean and organized Git history. The implementation looks solid and aligns with common Git workflow practices.

A minor suggestion for improvement:

Consider adding a release/** pattern to the branch naming convention. This can be useful for branches dedicated to release preparation. Here's the suggested change:

- branch_pattern: "feat|fix|build|ci|docs|style|refactor|perf|test|chore"
+ branch_pattern: "feat|fix|build|ci|docs|style|refactor|perf|test|chore|release"

Also, update the comment to include this new pattern:

+            `release/**`            | Preparing for a new release

This addition would make the branch naming convention more comprehensive and accommodate release-specific workflows.


Line range hint 44-63: Improved JSON linting process.

The changes to the lint-json job enhance the JSON validation process by using jsonlint-php and providing more detailed feedback. This is a valuable improvement to the overall linting workflow.

A minor suggestion for improvement:

Consider adding a step to install jsonlint-php explicitly in the job, rather than relying on it being pre-installed. This would make the job more self-contained and portable. Here's a suggested addition:

      - name: Install jsonlint-php
        run: |
          sudo apt-get update
          sudo apt-get install -y jsonlint

Add this step before the "Lint json files" step to ensure jsonlint-php is always available.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between c9c1d7f and 6588a14.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (6)
  • .github/workflows/build.yml (1 hunks)
  • .github/workflows/capture-website.yml (1 hunks)
  • .github/workflows/lint.yml (2 hunks)
  • .github/workflows/update-versioned-docs.yml (1 hunks)
  • .prettierrc.js (1 hunks)
  • package.json (1 hunks)
🧰 Additional context used
🔇 Additional comments (19)
.prettierrc.js (11)

2-2: LGTM: Appropriate print width setting.

The printWidth of 100 is a good balance between readability and efficient use of screen space. It's a common choice in modern development practices.


3-3: LGTM: Standard tab width setting.

The tabWidth of 2 spaces is a widely adopted standard in JavaScript and TypeScript projects. It provides a good balance between code compactness and readability.


5-5: LGTM: Consistent quote style.

The singleQuote: true setting enforces the use of single quotes for string literals, which is a common preference in JavaScript projects. This promotes consistency across the codebase.


7-7: LGTM: Improved object literal readability.

The bracketSpacing: true setting adds spaces between brackets in object literals, which enhances readability. This is a widely adopted practice in JavaScript development.


10-10: LGTM: Appropriate prose wrapping setting.

The proseWrap: 'preserve' setting maintains the original wrapping of prose content. This is beneficial for preserving intended formatting in comments and other prose sections within the code.


11-11: LGTM: Consistent JSX attribute quoting.

The jsxSingleQuote: false setting uses double quotes for JSX attributes. This aligns with HTML conventions and improves readability when JSX attributes contain string literals with single quotes.


12-12: LGTM: Consistent indentation using spaces.

The useTabs: false setting ensures that spaces are used for indentation instead of tabs. This is consistent with the tabWidth setting and promotes uniform rendering across different editors and platforms.


13-13: LGTM: Appropriate HTML whitespace handling.

The htmlWhitespaceSensitivity: 'css' setting respects the default white space sensitivity as defined by CSS display properties. This provides a good balance between consistent formatting and respecting intentional white space in HTML-like syntaxes.


15-15: LGTM: Appropriate object property quoting.

The quoteProps: 'as-needed' setting only adds quotes around object properties when necessary. This provides a good balance between readability and conciseness in object literals.


Line range hint 16-23: LGTM: Appropriate SCSS-specific override.

The overrides section for SCSS files, which sets singleQuote: false, is maintained. This ensures consistency with SCSS conventions, which typically use double quotes. Keeping this unchanged maintains consistency with existing SCSS files in the project.


4-4: Consider team alignment on semicolon usage.

The semi: false setting omits semicolons at the end of statements. While this is a valid stylistic choice, it's crucial to ensure all team members are familiar with JavaScript's Automatic Semicolon Insertion (ASI) rules to prevent potential issues.

To ensure consistent usage across the project, run the following script:

If the script returns results, consider discussing whether to enforce the no-semicolon rule more strictly or to revert to using semicolons.

✅ Verification successful

Refine semicolon usage check to target source code only.

To avoid false positives from third-party scripts and configuration files, please run the following script to check for explicit semicolon usage solely within the project's source code:


Semicolon usage conforms to the configuration.

The semi: false setting is properly enforced across the project. Only intentional semicolons are present, ensuring consistency with the project's style guidelines.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any explicit semicolon usage in JavaScript/TypeScript files

# Test: Search for lines ending with semicolons in JS/TS files
rg --type-add 'js:*.{js,jsx,ts,tsx}' --type js '[^)];$' -g '!*.{json,lock}'

Length of output: 843


Script:

#!/bin/bash
# Description: Check for explicit semicolon usage in project source files excluding specific directories and file types

rg --type-add 'js:*.{js,jsx,ts,tsx}' --type js '[^)];$' \
  -g '!*.{json,lock}' \
  -g '!static/**' \
  -g '!babel.config.js'

Length of output: 553

.github/workflows/build.yml (2)

Line range hint 1-35: Verify dependency compatibility and yarn.lock updates.

While the workflow update looks good, please ensure that:

  1. All project dependencies are compatible with Node.js 20.18.
  2. The yarn.lock file has been regenerated to reflect any necessary dependency updates.

These steps will help maintain project stability with the new Node.js version.

To verify the yarn.lock update:

#!/bin/bash
# Description: Check if yarn.lock has been updated in this PR

# Test: Check for changes in yarn.lock
git diff --name-only origin/main... | grep -q 'yarn.lock' && echo "yarn.lock has been updated" || echo "yarn.lock has not been updated"

26-26: Node.js version successfully updated to 20.18.

The Node.js version has been correctly updated from 18.19 to 20.18, which aligns with the PR objectives to upgrade to the latest LTS version. This change should ensure that the build process uses the desired Node.js version.

To ensure consistency across the project, let's verify if other workflow files have been updated similarly:

✅ Verification successful

Node.js version successfully updated in .github/workflows/build.yml only.

The Node.js version has been correctly updated to 20.18 in .github/workflows/build.yml. No other workflow files were found with different Node.js version specifications. This ensures that the build process utilizes the desired Node.js version consistently.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check if other workflow files use the same Node.js version

# Test: Search for Node.js version specifications in other workflow files
rg --type yaml 'node-version:' .github/workflows/*.yml

Length of output: 120

.github/workflows/capture-website.yml (1)

34-34: LGTM! Verify compatibility with capture-website-cli.

The Node.js version upgrade to 20.18 is consistent with the PR objectives. This change should improve the workflow's performance and security.

To ensure compatibility, please verify that [email protected] works correctly with Node.js 20.18. Run the following script to check the capture-website-cli package's engines field:

If the output shows compatibility with Node.js 20.x, no further action is needed. Otherwise, consider updating capture-website-cli to a version that supports Node.js 20.18.

✅ Verification successful

Compatibility Verified

The [email protected] supports Node.js versions >=18, including 20.18. The upgrade to Node.js v20.18 is compatible and should not cause issues with the capture-website-cli.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check capture-website-cli compatibility with Node.js 20.18

# Test: Retrieve the engines field from capture-website-cli package.json
npm view [email protected] engines --json

Length of output: 122


Script:

#!/bin/bash
# Description: Check capture-website-cli compatibility with Node.js 20.18 using curl and jq

# Fetch the package information from the npm registry
curl -s https://registry.npmjs.org/capture-website-cli/4.0.0 | jq '.engines'

Length of output: 97

package.json (1)

14-14: Approved: Node.js version upgrade to v20.18 LTS

The update to Node.js v20.18 LTS is a positive change that aligns with the PR objectives. This upgrade ensures long-term support and security updates for the project.

To ensure project compatibility with the new Node.js version, please run the following verification script:

✅ Verification successful

Verified: Node.js version upgrade to v20.18 LTS

The verification scripts did not identify any compatibility issues with the new Node.js v20.18. The project should be compatible with this upgrade.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify project compatibility with Node.js v20.18

# Test: Check if any scripts in package.json use Node.js version-specific features
echo "Checking package.json scripts for potential compatibility issues:"
jq -r '.scripts | to_entries[] | .key + ": " + .value' package.json

# Test: Scan for potential compatibility issues in JavaScript files
echo "Scanning JavaScript files for potential compatibility issues:"
rg -t js -n 'Buffer\.|\butil\.|\bfs\.' --glob '!node_modules'

# Note: This script provides a starting point for verification. Manual testing and review of the results are recommended.

Length of output: 873

.github/workflows/update-versioned-docs.yml (1)

67-67: Approved: Node.js version update to 20.18

The update to Node.js 20.18 aligns with the PR objective to upgrade to the latest LTS version. This change should improve performance and provide access to newer features.

To ensure consistency across the project, please run the following script to check the Node.js version specified in other workflow files and the package.json:

This will help ensure that the Node.js version is consistently updated across all relevant files in the project.

✅ Verification successful

Verified: Node.js version is consistent across workflows and package.json

The Node.js version has been consistently updated to 20.18 across all workflow files and is correctly specified in package.json. This ensures uniformity and aligns with the project's requirements.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify Node.js version consistency across workflow files and package.json

# Check workflow files
echo "Checking workflow files:"
rg --type yaml 'node-version:' .github/workflows/

# Check package.json
echo "\nChecking package.json:"
jq '.engines.node' package.json

Length of output: 522

.github/workflows/lint.yml (3)

203-203: Node.js version update for SCSS linting is consistent.

The update to Node.js v20.18 for SCSS linting is consistent with the change in the lint-web job and aligns with the PR objective.


Line range hint 1-215: Overall, the changes to the lint workflow are well-implemented and valuable.

The updates to Node.js versions, the addition of branch name linting, and the improvements to JSON linting all contribute to a more robust and comprehensive linting process. These changes align well with the PR objectives and modern development practices.

To ensure everything works as expected after these changes:

  1. Run the entire lint workflow locally or in a test environment.
  2. Verify that all linting jobs, especially the new and modified ones, complete successfully.
  3. Test with various scenarios (e.g., valid and invalid branch names, different JSON files) to ensure the new linting rules are enforced correctly.

108-108: Node.js version update looks good.

The update to Node.js v20.18 aligns with the PR objective and ensures the linting process uses the latest LTS version.

To ensure compatibility, please run the following script to check for any deprecation warnings or new features that might affect the linting process:

.prettierrc.js Show resolved Hide resolved
.prettierrc.js Show resolved Hide resolved
.prettierrc.js Show resolved Hide resolved
@ccamel ccamel requested review from ccamel and amimart October 16, 2024 07:37
@ccamel ccamel self-assigned this Oct 16, 2024
Copy link
Member

@ccamel ccamel left a comment

Choose a reason for hiding this comment

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

Wonderful. Thanks so much! ❤️

@ccamel ccamel linked an issue Oct 17, 2024 that may be closed by this pull request
2 tasks
@Reterics
Copy link
Contributor Author

Reterics commented Oct 17, 2024

Should we apply the suggestions from coderabbitai from above to .prettierrc.js file or we should keep the defaults? (I am not sure whether to Resolve the threads or Apply the changes)

@ccamel
Copy link
Member

ccamel commented Oct 24, 2024

@coderabbitai pause

Copy link
Contributor

coderabbitai bot commented Oct 24, 2024

✅ Actions performed

Reviews paused.

@ccamel ccamel force-pushed the develop/package-upgrade branch from 6588a14 to e60020d Compare October 24, 2024 10:13
@ccamel
Copy link
Member

ccamel commented Oct 24, 2024

Should we apply the suggestions from coderabbitai from above to .prettierrc.js file or we should keep the defaults? (I am not sure whether to Resolve the threads or Apply the changes)

It’s fine as it is. I’ve just rebased your branch to resolve conflicts—hope you don’t mind!
It’s now ready to be merged. Thanks so much for your contribution! 🙏

@Reterics
Copy link
Contributor Author

Should we apply the suggestions from coderabbitai from above to .prettierrc.js file or we should keep the defaults? (I am not sure whether to Resolve the threads or Apply the changes)

It’s fine as it is. I’ve just rebased your branch to resolve conflicts—hope you don’t mind! It’s now ready to be merged. Thanks so much for your contribution! 🙏

Thank you, I'm glad it works! 🚀

@ccamel ccamel merged commit ec29cea into axone-protocol:main Oct 25, 2024
14 of 15 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.

⬆️ Upgrade Node.js from v18.19 to LTS v20.18
2 participants