Skip to content

Conversation

@justin808
Copy link
Member

@justin808 justin808 commented Sep 23, 2025

Summary

  • Update CI workflow to use Node 22 instead of Node 20 to match local development environment
  • Add .nvmrc file to pin Node version for consistent development across team

Problem

CI Prettier checks were failing while local checks passed due to Node version differences:

  • Local: Node v22.12.0
  • CI: Node v20.x

Different Node versions can cause Prettier to process files differently, leading to inconsistent formatting checks.

Solution

  1. Updated CI workflow: Changed node-version: 20 to node-version: 22 in .github/workflows/lint-js-and-ruby.yml
  2. Added .nvmrc: Pin Node version to 22.12.0 for consistent local development

Benefits

  • ✅ Consistent Prettier behavior between CI and local environments
  • ✅ Prevents false positive formatting failures in CI
  • ✅ Ensures all developers use the same Node version locally
  • ✅ Reduces "works on my machine" issues

Testing

  • Pre-commit hooks pass with new configuration
  • CI workflow updated to match local environment
  • Will verify CI passes with Node 22

🤖 Generated with Claude Code


This change is Reviewable

Summary by CodeRabbit

  • Chores
    • Updated continuous integration to use Node.js 22 for consistency with current runtime standards.
    • Introduced a repository-level Node.js version configuration to standardize local development on Node.js 22.12.0.
    • No user-facing functionality changes.

- Update CI workflow to use Node 22 instead of Node 20 to match local development environment
- Add .nvmrc file to pin Node version for consistent development across team

This resolves the issue where CI Prettier checks fail while local checks pass,
caused by different Node versions processing files differently.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 23, 2025

Walkthrough

Updates Node.js version references: GitHub Actions workflow now uses Node 22, and a new .nvmrc pins Node.js to 22.12.0.

Changes

Cohort / File(s) Summary of Changes
CI workflow
.github/workflows/lint-js-and-ruby.yml
Set Setup Node step to use Node 22 instead of 20; no other workflow steps altered.
Node version management
.nvmrc
Added file specifying Node.js version 22.12.0.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Suggested reviewers

  • AbanoubGhadban

Poem

Hop hop! New Node on the lane,
22 in Actions, lockstep we remain.
.nvmrc whispers, “22.12, please!”
Pipelines purr, with effortless ease.
Carrot commits and green checks gleam—
another swift sprint for the burrowed team! 🥕✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title succinctly and accurately describes the primary change: aligning CI and local Node versions to resolve Prettier inconsistencies. The changeset (updating the GitHub Actions node-version to 22 and adding a .nvmrc pinned to 22.12.0) directly implements that intent. It is specific, concise, and meaningful for teammates scanning history.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch investigate/ci-local-configuration-differences

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@claude
Copy link

claude bot commented Sep 23, 2025

Code Review

Thank you for this PR addressing the Node version inconsistencies. Here's my review:

Strengths

  1. Clear problem identification - The PR accurately identifies Prettier formatting differences between CI and local environments
  2. Good solution approach - Adding .nvmrc is a best practice for Node projects
  3. Minimal, focused changes - Only necessary changes to fix the issue

Potential Issues

  1. Incomplete CI workflow updates - While you updated lint-js-and-ruby.yml, another workflow still uses Node 20:

    • .github/workflows/examples.yml (line 26) still specifies node-version: 20
      For full consistency, this should also be updated to Node 22
  2. Test matrix considerations - The project tests against both Node 20 and 22 in other workflows. Verify that dropping Node 20 from linting won't miss Node 20-specific issues

Recommendations

  1. Update all workflows consistently - Consider updating .github/workflows/examples.yml to use Node 22
  2. Document minimum Node version - Consider adding engines field to package.json to declare minimum Node version
  3. Update documentation - Ensure any development setup docs mention the Node 22 requirement

Testing and Security

  • No security concerns identified
  • Changes are safe and non-breaking
  • The .nvmrc file correctly specifies patch version 22.12.0

Summary

Good fix addressing a real problem. With suggested update to examples workflow, this ensures uniform Node versions across non-matrix CI jobs. The .nvmrc addition is valuable for team development.

Verdict: Approve with minor suggestions

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: 0

🧹 Nitpick comments (4)
.github/workflows/lint-js-and-ruby.yml (3)

26-26: Pin CI to .nvmrc for exact version parity.

Using node-version: 22 may drift from .nvmrc (22.12.0) as new 22.x are released, reintroducing inconsistencies. Prefer node-version-file: .nvmrc or pin node-version: 22.12.0.

Apply one of these diffs:

Option A (preferred):

-          node-version: 22
+          node-version-file: .nvmrc

Option B (explicit pin):

-          node-version: 22
+          node-version: 22.12.0

90-124: Optional: align Node pinning to 22 across workflows

Found remaining Node 20 usages/matrix entries; .nvmrc is 22.12.0 and lint-js-and-ruby.yml already uses 22. Update if you want consistent pinning:

  • .github/workflows/examples.yml:59 — node-version: 20
  • .github/workflows/package-js-tests.yml:13 — node-version: ['20', '22']
  • .github/workflows/main.yml — matrix includes both '20' and '22' (multiple entries)
  • .github/workflows/lint-js-and-ruby.yml:26 — node-version: 22
  • .nvmrc — 22.12.0

Remove or adjust '20' in matrices/explicit node-version keys if you want all workflows pinned to 22.


24-36: Optional: enable Corepack so runners use the pinned Yarn version

package.json already declares "packageManager": "yarn@1.22.22+sha512.a6b2f79... " (package.json: line 126). Add a workflow step immediately after actions/setup-node to run corepack enable; explicit corepack prepare yarn@1.22.22 --activate is optional because Corepack will honor the packageManager declaration.

.nvmrc (1)

1-1: Good pin.

.nvmrc set to 22.12.0 aligns with the objective. Pair this with node-version-file: .nvmrc in CI for exact parity.

Optionally add an engines field to package.json to enforce Node at install time:

"engines": { "node": "22.12.x" }

If you want strict enforcement with Yarn:

  • Yarn v1: set --engine-strict in .yarnrc
  • Yarn Berry: set enableStrictPackageManager: true and rely on engines
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f77bd54 and 1bf897a.

📒 Files selected for processing (2)
  • .github/workflows/lint-js-and-ruby.yml (1 hunks)
  • .nvmrc (1 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). (8)
  • GitHub Check: dummy-app-integration-tests (3.4, 22)
  • GitHub Check: dummy-app-integration-tests (3.2, 20)
  • GitHub Check: claude-review
  • GitHub Check: rspec-package-tests (3.4, latest)
  • GitHub Check: build
  • GitHub Check: rspec-package-tests (3.2, latest)
  • GitHub Check: rspec-package-tests (3.4, minimum)
  • GitHub Check: rspec-package-tests (3.2, minimum)
🔇 Additional comments (1)
.github/workflows/lint-js-and-ruby.yml (1)

29-37: Nice: printing versions will quickly surface drift.

The version printouts help validate the CI environment after the Node bump.

If you switch to node-version-file: .nvmrc, confirm these lines show v22.12.0 for Node and an expected Yarn version.

@justin808 justin808 merged commit 7ef65c1 into master Sep 24, 2025
17 checks passed
@justin808 justin808 deleted the investigate/ci-local-configuration-differences branch September 24, 2025 00:04
@claude claude bot mentioned this pull request Sep 24, 2025
3 tasks
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.

2 participants