Skip to content

Conversation

@Anurag8484
Copy link

@Anurag8484 Anurag8484 commented Oct 24, 2025

Closes #3690

Updated jest.config.js to include transformIgnorePatterns so babel-jest transpiles @octokit and its ESM deps. This fixes Jest "import/export" parse errors when upgrading Octokit.

Summary by CodeRabbit

  • Chores

    • Updated core dependencies and development tooling for improved compatibility and build/test support
  • New Features

    • Added internationalization support for multi-language functionality
  • Tests

    • Adjusted test configuration to refine module resolution and transformation behavior

@netlify
Copy link

netlify bot commented Oct 24, 2025

Deploy Preview for asyncapi-website failed.

Built without sensitive environment variables

Name Link
🔨 Latest commit ae9d9af
🔍 Latest deploy log https://app.netlify.com/projects/asyncapi-website/deploys/68fb40f403fbf300086f6d43

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 24, 2025

Walkthrough

Updates to Jest configuration and package dependencies: added transformIgnorePatterns in jest.config.js and upgraded/added several runtime and dev dependencies (notably @octokit/graphql → 8.x, added @octokit/request v9, i18next/react-i18next, Babel toolchain and babel-jest).

Changes

Cohort / File(s) Summary
Jest Configuration
jest.config.js
Added transformIgnorePatterns to exclude @octokit, octokit, and universal-user-agent from Jest transforms; formatting changed to multi-line arrays (no behavior-altering changes besides the new ignore patterns).
Dependencies & Build Configuration
package.json
Updated @octokit/graphql ^7.0.2 → 8.2.1; added @octokit/request 9.2.2; updated i18next ^23.12.2 → 25.5.2 and added react-i18next 16.1.6; devDeps changed to include @babel/core 7.28.4, @babel/preset-env 7.28.4, @babel/preset-typescript 7.28.4 (replaced prior block), and added babel-jest 29.7.0.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested labels

ready-to-merge

Suggested reviewers

  • derberg
  • akshatnema
  • devilkiller-ag
  • sambhavgupta0705

Poem

🐰 I hopped through configs, tidy and spry,
Jest learned to skip modules passing by,
Octokit grew, Babel stretched its ears,
Transforms adjusted, no more test tears. ✨

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings, 1 inconclusive)
Check name Status Explanation Resolution
Out of Scope Changes Check ⚠️ Warning The PR includes out-of-scope dependency updates that are unrelated to the Octokit upgrade objective. While jest configuration changes, Octokit package updates, and babel-related dependency updates directly support the issue requirements, the updates to i18next (from ^23.12.2 to 25.5.2) and the addition of react-i18next (16.1.6) are not mentioned in issue #3690 or the PR objectives and appear unrelated to supporting the Octokit v8/v9 upgrade. Remove or justify the i18next (v25.5.2) and react-i18next (v16.1.6) dependency changes. If these updates are necessary for reasons beyond the Octokit upgrade, consider moving them to a separate PR or document why they are required as part of this change.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Linked Issues Check ❓ Inconclusive The PR addresses the immediate test infrastructure issue by updating jest.config.js to properly handle ESM dependencies and updating @octokit/graphql to v8.2.1 and adding @octokit/request at v9.2.2 as required by issue #3690. However, the issue description states "The fix might require changes to the actual code rather than tests to accommodate breaking changes in the new versions," and the raw_summary shows only jest.config.js and package.json modifications without evidence of application code changes to support breaking API changes. While the PR fixes Jest module resolution errors, it's unclear if breaking changes in the Octokit API itself have been addressed in the application code. To conclusively verify compliance, clarify whether breaking changes in the Octokit v8/v9 API required any modifications to application code (beyond configuration), and confirm that the updated tests pass with these dependency versions. If application code changes are necessary to handle API breaking changes, ensure those changes are included in this PR or are being addressed separately.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The PR title clearly and specifically describes the main changes: enabling Jest to transform @octokit and ESM dependencies through configuration updates, and updating dependencies to support the Octokit upgrade. The title accurately reflects both the jest.config.js modifications (transformIgnorePatterns) and the package.json dependency updates shown in the changeset, making it informative for someone reviewing the git history.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Welcome to AsyncAPI. Thanks a lot for creating your first pull request. Please check out our contributors guide useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.

@asyncapi-bot
Copy link
Contributor

asyncapi-bot commented Oct 24, 2025

⚡️ Lighthouse report for the changes in this PR:

Category Score
🔴 Performance 37
🟢 Accessibility 98
🟢 Best practices 92
🟢 SEO 100
🔴 PWA 33

Lighthouse ran on https://deploy-preview-4503--asyncapi-website.netlify.app/

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

🧹 Nitpick comments (1)
package.json (1)

58-59: Consider using semver ranges for consistency.

The octokit packages are pinned to exact versions (no caret), while most other dependencies in the project use semver ranges (e.g., ^7.0.2). This inconsistency can lead to issues with peer dependency resolution and makes it harder to receive patch updates automatically.

Apply this diff to use semver ranges:

-    "@octokit/graphql": "8.2.1",
-    "@octokit/request": "9.2.2",
+    "@octokit/graphql": "^8.2.1",
+    "@octokit/request": "^9.2.2",
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a57da1f and cc8b6d8.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (2)
  • jest.config.js (1 hunks)
  • package.json (5 hunks)
🧰 Additional context used
🪛 GitHub Actions: PR testing - if Node project
package.json

[warning] 1-1: EBADENGINE Unsupported engine: package '@tisoap/[email protected]' requires node '>=16' and npm '^8.0.0'; current: node 'v20.11.0', npm '10.2.4'.

⏰ Context from checks skipped due to timeout of 180000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Redirect rules - asyncapi-website
  • GitHub Check: Header rules - asyncapi-website
  • GitHub Check: Pages changed - asyncapi-website
  • GitHub Check: Lighthouse CI
🔇 Additional comments (6)
jest.config.js (4)

13-17: LGTM!

The multi-line formatting improves readability without changing behavior.


22-22: LGTM!

The multi-line formatting is consistent with the rest of the configuration.


3-6: LGTM! The babel config file exists at the specified path.

The multi-line formatting improves readability, and the file reference to ./tests/babel.test.config.cts has been verified.


19-21: Configuration fix is correct; verify tests pass in CI environment.

The negative lookahead pattern correctly exempts @octokit, octokit, and universal-user-agent (confirmed as transitive dependency) from Jest's node_modules ignore, allowing babel-jest to transpile them. Babel is properly configured with babel-plugin-transform-import-meta for ESM support.

Confirm that the test suite passes with the upgraded octokit versions in your CI environment, as actual test execution cannot be performed in this sandbox.

package.json (2)

1-1: Pre-existing pipeline warning (not caused by this PR).

The pipeline failure for @tisoap/react-flow-smart-edge is not related to your changes. However, this dependency requires npm ^8.0.0 but the CI is running npm 10.2.4, which doesn't match the semver range. This should be addressed separately, either by updating the dependency or its engine requirements.

Note: This is informational and doesn't block the current PR, but the team should track this separately.


82-82: ****

The i18next upgrade is directly related to the PR objective. The commit message explicitly states: "update deps to reproduce octokit upgrade," indicating the dependency updates (including i18next v25.5.2 and new react-i18next v16.1.6) are intentional and necessary for addressing the octokit issue. This is not unrelated scope creep. The codebase actively uses i18next across multiple files, and the upgrades are part of the stated testing and reproduction strategy.

Likely an incorrect or invalid review comment.

"react-dom": "^18",
"react-ga": "^3.3.1",
"react-gtm-module": "^2.0.11",
"react-i18next": "16.1.6",
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Unrelated dependency addition increases PR risk.

Similar to the i18next upgrade at line 82, adding react-i18next appears unrelated to fixing octokit tests. This further compounds the scope creep concern.

Consider moving i18n-related changes to a separate PR focused on internationalization updates.

🤖 Prompt for AI Agents
In package.json around line 105, the addition of "react-i18next": "16.1.6" is
unrelated to the octokit test fixes and broadens this PR's scope; remove this
dependency change from the current branch (restore package.json to the version
without react-i18next) and open a separate PR that contains i18n-related
dependency upgrades (including react-i18next and any paired i18next updates),
ensuring package-lock/yarn.lock is updated only in that dedicated PR.

@codecov
Copy link

codecov bot commented Oct 24, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (a57da1f) to head (ae9d9af).

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #4503   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           22        22           
  Lines          778       778           
  Branches       144       144           
=========================================
  Hits           778       778           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

♻️ Duplicate comments (1)
package.json (1)

82-82: Scope creep: i18n updates unrelated to octokit test fixes.

The i18next (line 82) and react-i18next (line 105) updates appear unrelated to the PR's stated objective of fixing Jest ESM transpilation for @octokit. These changes expand scope unnecessarily.

Are these i18n dependency updates required for the octokit upgrade, or can they be moved to a separate PR? If unrelated, restore package.json to exclude react-i18next and revert i18next to its prior version, ensuring package-lock.json changes reflect only octokit and Babel-related updates.

Also applies to: 105-105

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cc8b6d8 and ae9d9af.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (1)
  • package.json (5 hunks)
⏰ Context from checks skipped due to timeout of 180000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Test NodeJS PR - windows-latest
  • GitHub Check: Test NodeJS PR - macos-13
🔇 Additional comments (1)
package.json (1)

128-130: Good: Babel and babel-jest versions corrected and aligned.

The Babel packages (@babel/core, @babel/preset-env, @babel/preset-typescript) are now correctly pinned to ^7.28.4 (valid version), and babel-jest is aligned to ^29.7.0 to match Jest ^29.7.0. These corrections support the ESM transpilation strategy in jest.config.js.

Also applies to: 155-155, 171-171

Comment on lines +58 to +59
"@octokit/graphql": "8.2.1",
"@octokit/request": "9.2.2",
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Verify octokit versions are valid and stable.

Both @octokit/graphql and @octokit/request are pinned to exact versions (no caret). Ensure these versions exist on npm and are stable releases.


🌐 Web query:

What is the latest version of @octokit/graphql and @octokit/request packages?

💡 Result:

As of October 24, 2025:

  • @octokit/graphql — 9.0.1. [1]
  • @octokit/request — 10.0.5. [2]

Sources:
[1] npm package page for @octokit/graphql.
[2] Yarn/npm registry listing (package versions) for @octokit/request.


Octokit versions verified; flag i18next/react-i18next as scope creep.

The @octokit/graphql 8.2.1 and @octokit/request 9.2.2 versions are valid and exist on npm. However, the changes to i18next (line 82) and the addition of react-i18next (line 105) appear unrelated to the octokit ESM transpilation support objective—these belong in a separate PR and should be reverted to keep scope focused.

🤖 Prompt for AI Agents
In package.json around lines 58-59, the @octokit/graphql and @octokit/request
version changes are fine but unrelated edits to i18next (around line 82) and the
new react-i18next entry (around line 105) are scope creep; revert the i18next
change to its prior version and remove the react-i18next addition so only the
octokit dependency updates remain, then run npm/yarn install to regenerate the
lockfile.

@Anurag8484
Copy link
Author

The build is failing on Netlify due to a missing @docsearch/react/dist/esm/types import in AlgoliaSearch.tsx.
I didn’t modify this part in my PR, but it seems the clean install or dependency refresh caused this issue.
Should I open a separate PR to fix the import path, or would you prefer handling it separately?

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.

fix: Update code to support @octokit/request v9 and @octokit/graphql v8

2 participants