Skip to content

ci: try TARGET_CC env instead for new napi-rs#182

Merged
JounQin merged 1 commit intomainfrom
chore/bump_napi
Jul 9, 2025
Merged

ci: try TARGET_CC env instead for new napi-rs#182
JounQin merged 1 commit intomainfrom
chore/bump_napi

Conversation

@JounQin
Copy link
Member

@JounQin JounQin commented Jul 7, 2025

Important

Switch to TARGET_CC for compiler specification and update dependencies for improved build stability and worker thread handling.

  • Build Configuration:
    • Switch from CC to TARGET_CC in .github/workflows/release-napi.yml for specifying the compiler.
    • Update Cargo.lock to use napi version 3.0.0-beta.12 and napi-derive version 3.0.0-beta.12.
  • Dependencies:
    • Update @napi-rs/cli to 3.0.0-alpha.92 and emnapi to 1.4.4 in package.json.
  • Worker Threads:
    • Modify resolver.wasi.cjs to improve worker thread handling, preventing process hangs by unreferencing workers.

This description was created by Ellipsis for b3e9434. You can customize this summary. It will automatically update as commits are pushed.


Summary by CodeRabbit

  • Chores
    • Updated internal dependencies to newer versions for improved compatibility and stability.
    • Adjusted workflow environment variables for build steps.
    • Improved worker thread handling to prevent process hang by allowing clean exit of background tasks.

@JounQin JounQin requested a review from Copilot July 7, 2025 07:56
@JounQin JounQin self-assigned this Jul 7, 2025
@JounQin JounQin added the dependencies Pull requests that update a dependency file label Jul 7, 2025
@coderabbitai
Copy link

coderabbitai bot commented Jul 7, 2025

Walkthrough

This update modifies the GitHub Actions release workflow by renaming an environment variable related to the C compiler and adjusting build steps. It updates dependency versions in Rust and JavaScript configuration files. Additionally, it changes the napi/resolver.wasi.cjs to unreference worker threads in Node.js, allowing the process to exit without waiting for Rust threads.

Changes

File(s) Change Summary
.github/workflows/release-napi.yml Renamed environment variable from CC to TARGET_CC in riscv64-linux-gnu toolchain and mimalloc build steps.
napi/Cargo.toml Updated napi and napi-derive versions from 3.0.0-beta.11 to 3.0.0-beta.12; added optional tracing-subscriber dependency with selective features enabled.
package.json Updated dev dependencies: @napi-rs/cli from 3.0.0-alpha.91 to 3.0.0-alpha.92, and emnapi from ^1.4.3 to ^1.4.4.
napi/resolver.wasi.cjs Added code in onCreateWorker callback to override internal worker handles' ref methods and call worker.unref() to prevent Node.js from blocking process exit due to active workers.

Possibly related PRs

Suggested labels

internal

Poem

🐇
A tweak in the build, a version anew,
Workers unbound, letting processes through.
Dependencies fresh, the workflow refined,
Quiet threads now, no more to bind.
In code’s gentle garden, changes take flight,
A rabbit’s small hop toward the light!
🥕✨


📜 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 d9c2778 and b3e9434.

⛔ Files ignored due to path filters (2)
  • Cargo.lock is excluded by !**/*.lock
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (4)
  • .github/workflows/release-napi.yml (2 hunks)
  • napi/Cargo.toml (1 hunks)
  • napi/resolver.wasi.cjs (1 hunks)
  • package.json (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • .github/workflows/release-napi.yml
🚧 Files skipped from review as they are similar to previous changes (3)
  • package.json
  • napi/Cargo.toml
  • napi/resolver.wasi.cjs
⏰ 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). (2)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: Benchmark
✨ Finishing Touches
  • 📝 Generate Docstrings

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.
    • @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 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.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

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

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 generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in 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.

@socket-security
Copy link

socket-security bot commented Jul 7, 2025

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updated@​napi-rs/​cli@​3.0.0-alpha.91 ⏵ 3.0.0-alpha.9297 -21008497100
Updatedemnapi@​1.4.3 ⏵ 1.4.410010010088 +7100

View full report

@codecov
Copy link

codecov bot commented Jul 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.10%. Comparing base (6b0d705) to head (b3e9434).
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #182   +/-   ##
=======================================
  Coverage   95.10%   95.10%           
=======================================
  Files          12       12           
  Lines        2818     2818           
=======================================
  Hits         2680     2680           
  Misses        138      138           

☔ 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

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adjusts CI logic for N-API builds and bumps related package versions:

  • Updates @napi-rs/cli and Rust napi crates to their latest alpha/beta releases.
  • Switches the compiler environment variable from CC to TARGET_CC.
  • Comments out version-check gating on build jobs and moves the publish job’s if condition.

Reviewed Changes

Copilot reviewed 3 out of 5 changed files in this pull request and generated 2 comments.

File Description
package.json Bumped @napi-rs/cli version to 3.0.0-alpha.92
napi/Cargo.toml Updated napi and napi-derive crate versions to 3.0.0-beta.12
.github/workflows/release-napi.yml Replaced CC with TARGET_CC, commented out build if checks, and adjusted publish job gating
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (4)

.github/workflows/release-napi.yml:200

  • Misaligned indentation for the if key could cause the condition to be ignored; align it with sibling keys (e.g., add two more spaces) to match the needs indentation level.
    if: needs.check.outputs.version_changed == 'true'

.github/workflows/release-napi.yml:45

  • [nitpick] Consider removing or documenting the reason for commenting out this conditional, to avoid confusion and keep the workflow file clean.
    # if: needs.check.outputs.version_changed == 'true'

.github/workflows/release-napi.yml:147

  • [nitpick] Provide a rationale or remove this commented-out if statement to reduce clutter and clarify CI intent.
    # if: needs.check.outputs.version_changed == 'true'

.github/workflows/release-napi.yml:134

  • Ensure that downstream build steps and scripts are updated to respect TARGET_CC instead of the standard CC variable; otherwise, the intended compiler override may not take effect.
          TARGET_CC: clang # for mimalloc

Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Important

Looks good to me! 👍

Reviewed everything up to 124ca0c in 1 minute and 33 seconds. Click for details.
  • Reviewed 119 lines of code in 4 files
  • Skipped 1 files when reviewing.
  • Skipped posting 6 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. .github/workflows/release-napi.yml:43
  • Draft comment:
    Commenting out the version check condition may lead to unintended unguarded builds. Confirm this change is intentional.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 10% vs. threshold = 50% The change appears intentional and well-thought-out. The version check is still present in the publish step, which is the critical control point. Running builds unconditionally could be useful for testing/verification purposes. The comment is asking for confirmation rather than pointing out a clear issue. I might be missing security implications of running builds without version checks. There could be resource usage concerns I haven't considered. The build step is just creating artifacts - any security or resource concerns are mitigated by the version check still being present in the publish step, which controls actual releases. The comment should be deleted as it's asking for confirmation rather than pointing out a clear issue, and the change appears to be an intentional restructuring of the workflow controls.
2. .github/workflows/release-napi.yml:134
  • Draft comment:
    Switching from 'CC' to 'TARGET_CC: clang' aligns with the new napi‑rs expectations. Verify that no other toolchain conflicts arise.
  • Reason this comment was not posted:
    Confidence changes required: 30% <= threshold 50% None
3. Cargo.lock:556
  • Draft comment:
    The dependency 'windows-targets' was downgraded from 0.53.2 to 0.52.6. Ensure compatibility with the rest of the toolchain.
  • Reason this comment was not posted:
    Confidence changes required: 50% <= threshold 50% None
4. Cargo.lock:623
  • Draft comment:
    Bumping 'napi', 'napi-derive', and 'napi-derive-backend' to beta.12 appears consistent. Check that all dependent crates are updated accordingly.
  • Reason this comment was not posted:
    Confidence changes required: 40% <= threshold 50% None
5. napi/Cargo.toml:25
  • Draft comment:
    Updated the 'napi' and 'napi-derive' versions to beta.12. Ensure these changes are in sync with Cargo.lock and downstream consumers.
  • Reason this comment was not posted:
    Confidence changes required: 30% <= threshold 50% None
6. package.json:31
  • Draft comment:
    The '@napi-rs/cli' package is updated to 3.0.0-alpha.92; verify compatibility with the changes in napi‑rs.
  • Reason this comment was not posted:
    Confidence changes required: 30% <= threshold 50% None

Workflow ID: wflow_S36nAuShh838Dq5F

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

@codspeed-hq
Copy link

codspeed-hq bot commented Jul 7, 2025

CodSpeed Performance Report

Merging #182 will not alter performance

Comparing chore/bump_napi (b3e9434) with main (6b0d705)

Summary

✅ 3 untouched benchmarks

Copy link

@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

🔭 Outside diff range comments (1)
.github/workflows/release-napi.yml (1)

90-96: TARGET_CC is set, but the RISC-V sub-script still exports CC – build will pick the wrong compiler.

mimalloc (and the new napi-rs build system) look for TARGET_CC.
Inside the RISC-V build command we still export the legacy vars:

export CC=riscv64-linux-gnu-gcc
export CXX=riscv64-linux-gnu-g++

These no longer have any effect; the step-level env leaves TARGET_CC=clang, so the cross build will use the host compiler and fail.

Diff fix:

-              export CC=riscv64-linux-gnu-gcc &&
-              export CXX=riscv64-linux-gnu-g++ &&
+              export TARGET_CC=riscv64-linux-gnu-gcc &&
+              export TARGET_CXX=riscv64-linux-gnu-g++ &&

Also applies to: 134-135

🧹 Nitpick comments (2)
.github/workflows/release-napi.yml (2)

45-46: Un-scoping the build job increases CI load.

Removing the if: guard means every push to main now triggers the full, very heavy, cross-platform N-API matrix.
If that is intentional – ignore. If not, please restore the condition or switch to a reusable workflow that can be called only when the version changes.


147-148: Same unconditional run for FreeBSD job.

The guard is merely commented out, not removed. This reads as dead code and is easy to forget.
Either drop the commented line or re-enable it for clarity.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between f10dee5 and 124ca0c.

⛔ Files ignored due to path filters (2)
  • Cargo.lock is excluded by !**/*.lock
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (3)
  • .github/workflows/release-napi.yml (4 hunks)
  • napi/Cargo.toml (1 hunks)
  • package.json (1 hunks)
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: JounQin
PR: unrs/unrs-resolver#144
File: napi/patch.mjs:5-5
Timestamp: 2025-06-10T13:53:02.983Z
Learning: Build-time scripts in napi/patch.mjs and similar build pipeline contexts don't require error handling for reading expected files like index.js, as these files are guaranteed to be present during the build process.
napi/Cargo.toml (6)
Learnt from: JounQin
PR: unrs/unrs-resolver#136
File: src/tests/extension_alias.rs:36-46
Timestamp: 2025-06-05T18:52:30.363Z
Learning: The fixtures/yarn directory in the unrs-resolver project requires running `yarn install` to install TypeScript dependencies before tests can run, similar to other fixture directories like fixtures/pnp. The test in src/tests/extension_alias.rs depends on the installed TypeScript package providing lib/typescript.d.ts and related files.
Learnt from: JounQin
PR: unrs/unrs-resolver#136
File: src/tests/extension_alias.rs:36-46
Timestamp: 2025-06-05T18:52:30.363Z
Learning: The fixtures/yarn directory in the unrs-resolver project requires running `yarn install` to install TypeScript dependencies before tests can run, similar to other fixture directories like fixtures/pnp. The test in src/tests/extension_alias.rs depends on the installed TypeScript package providing lib/typescript.d.ts and related files.
Learnt from: JounQin
PR: unrs/unrs-resolver#129
File: src/tests/pnp.rs:6-6
Timestamp: 2025-06-02T15:57:50.888Z
Learning: In the unrs-resolver project, std::env is acceptable for test cases even when deprecated, as the user prefers simpler approaches in test code compared to production code standards.
Learnt from: JounQin
PR: unrs/unrs-resolver#75
File: src/tests/pnp.rs:116-133
Timestamp: 2025-04-21T08:17:34.175Z
Learning: Test cases in unrs-resolver that intentionally document failing behavior should make the intent clear by either: 1) asserting on the expected error condition rather than the desired behavior, 2) using #[should_panic] for tests expected to panic, or 3) using #[ignore] with a reason to skip known failing tests in CI.
Learnt from: JounQin
PR: unrs/unrs-resolver#40
File: src/tests/resolve.rs:121-136
Timestamp: 2025-03-29T04:14:03.715Z
Learning: For tests involving npm/yarn package resolution in the unrs-resolver project, dependencies must be installed first using the appropriate package manager commands (pnpm i, yarn) in both the root directory and fixture directories like fixtures/pnp and fixtures/misc/nested-package-json.
Learnt from: JounQin
PR: unrs/unrs-resolver#75
File: src/tests/pnp.rs:116-133
Timestamp: 2025-04-21T08:13:59.358Z
Learning: In the unrs-resolver project, tests that intentionally document failing behavior (regression tests) should either use #[should_panic], assert on the expected error, or include clear documentation indicating they are intentional failing test cases.
package.json (6)
Learnt from: JounQin
PR: unrs/unrs-resolver#144
File: napi/patch.mjs:5-5
Timestamp: 2025-06-10T13:53:02.983Z
Learning: Build-time scripts in napi/patch.mjs and similar build pipeline contexts don't require error handling for reading expected files like index.js, as these files are guaranteed to be present during the build process.
Learnt from: JounQin
PR: unrs/unrs-resolver#136
File: src/tests/extension_alias.rs:36-46
Timestamp: 2025-06-05T18:52:30.363Z
Learning: The fixtures/yarn directory in the unrs-resolver project requires running `yarn install` to install TypeScript dependencies before tests can run, similar to other fixture directories like fixtures/pnp. The test in src/tests/extension_alias.rs depends on the installed TypeScript package providing lib/typescript.d.ts and related files.
Learnt from: JounQin
PR: unrs/unrs-resolver#136
File: src/tests/extension_alias.rs:36-46
Timestamp: 2025-06-05T18:52:30.363Z
Learning: The fixtures/yarn directory in the unrs-resolver project requires running `yarn install` to install TypeScript dependencies before tests can run, similar to other fixture directories like fixtures/pnp. The test in src/tests/extension_alias.rs depends on the installed TypeScript package providing lib/typescript.d.ts and related files.
Learnt from: JounQin
PR: unrs/unrs-resolver#75
File: fixtures/pnp/package.json:11-14
Timestamp: 2025-04-21T08:11:41.469Z
Learning: The project uses a justfile with an `install` task that includes running yarn in the fixtures/pnp directory to install dependencies with the command: `cd fixtures/pnp && yarn`.
Learnt from: JounQin
PR: unrs/unrs-resolver#40
File: src/tests/resolve.rs:121-136
Timestamp: 2025-03-29T04:14:03.715Z
Learning: For tests involving npm/yarn package resolution in the unrs-resolver project, dependencies must be installed first using the appropriate package manager commands (pnpm i, yarn) in both the root directory and fixture directories like fixtures/pnp and fixtures/misc/nested-package-json.
Learnt from: JounQin
PR: unrs/unrs-resolver#115
File: tests/resolve_test.rs:251-263
Timestamp: 2025-05-28T02:21:41.547Z
Learning: In pnpm workspaces, `pnpm install` must be run first to initialize dependencies and create the proper node_modules/.pnpm structure before tests can pass. Tests that rely on resolving packages will fail if dependencies haven't been installed yet.
.github/workflows/release-napi.yml (1)
Learnt from: JounQin
PR: unrs/unrs-resolver#144
File: napi/patch.mjs:5-5
Timestamp: 2025-06-10T13:53:02.983Z
Learning: Build-time scripts in napi/patch.mjs and similar build pipeline contexts don't require error handling for reading expected files like index.js, as these files are guaranteed to be present during the build process.
⏰ 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: Benchmark
🔇 Additional comments (3)
napi/Cargo.toml (1)

25-26: Dependency bump looks good but remember to update the lock-file.

The direct version bump from beta.11beta.12 is fine, however cargo update -p napi --workspace (or a full cargo update) must be run so that Cargo.lock captures the new versions; otherwise CI may still restore beta.11 from the lock-file layer.

package.json (1)

31-31: Consistent tool-chain bump – LGTM.

Nothing else in the JS tool-chain depends on @napi-rs/cli pre-release APIs, so this minor alpha bump is safe.

.github/workflows/release-napi.yml (1)

197-200: publish now depends on check – good catch.

Adding check to needs prevents publishing when the version didn’t change; behaviour matches the if: guard. ✔️

@JounQin JounQin force-pushed the chore/bump_napi branch from 124ca0c to ffaaef1 Compare July 7, 2025 08:00
Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Caution

Changes requested ❌

Reviewed ffaaef1 in 1 minute and 48 seconds. Click for details.
  • Reviewed 153 lines of code in 5 files
  • Skipped 1 files when reviewing.
  • Skipped posting 4 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. .github/workflows/release-napi.yml:134
  • Draft comment:
    Changed env variable from 'CC' to 'TARGET_CC' for mimalloc. Ensure that all build scripts and downstream tooling expect this update.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% The comment is asking the PR author to ensure that all build scripts and downstream tooling expect the update, which violates the rule against asking the author to ensure behavior is intended or tested. It doesn't provide a specific suggestion or ask for a specific test to be written.
2. napi/Cargo.toml:25
  • Draft comment:
    Updated napi and napi-derive versions to 3.0.0-beta.12. Confirm that these version bumps are compatible with any changes in the upstream napi‑rs API.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% This comment is asking the PR author to confirm compatibility with upstream changes, which violates the rule against asking for confirmation or verification. It does not provide a specific code suggestion or point out a specific issue with the code.
3. package.json:23
  • Draft comment:
    Verify that the 'postinstall' script version (1.11.0) matches the package version to avoid publish discrepancies.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.
4. napi/resolver.wasi.cjs:73
  • Draft comment:
    Typo in comment: "a worker is consist of two handles: kPublicPort and kHandle." should be corrected to "a worker consists of two handles: kPublicPort and kHandle."
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 10% vs. threshold = 50% While the grammar correction is technically correct, it's a very minor issue in a comment that doesn't affect code functionality. The meaning of the comment is still clear despite the grammatical error. The rules state we should not make purely informative comments or comments that are obvious/unimportant. The grammar error could potentially confuse non-native English speakers. Also, maintaining high quality documentation is important for code maintainability. While documentation quality is important, this is such a minor grammatical issue that it doesn't significantly impact understanding. The technical content of the comment is clear regardless. Delete this comment as it's purely informative and doesn't affect code functionality or understanding.

Workflow ID: wflow_v8rQCDd5Dxu1DQQI

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

Copy link

@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: 2

♻️ Duplicate comments (1)
napi/Cargo.toml (1)

25-26: Remember to update the Cargo.lock file

Ensure that the Cargo.lock file is updated alongside these Cargo.toml changes so that the new crate versions are locked and reproducible.

🧹 Nitpick comments (1)
napi/resolver.wasi.cjs (1)

75-90: Add defensive programming for symbol lookup

The current implementation assumes the symbols will always be found, but this may not be guaranteed across all Node.js versions.

Consider adding defensive checks:

     {
       const kPublicPort = Object.getOwnPropertySymbols(worker).find(s =>
         s.toString().includes("kPublicPort")
       );
       if (kPublicPort) {
         worker[kPublicPort].ref = () => {};
+      } else {
+        console.warn('Warning: kPublicPort symbol not found. Worker may prevent process exit.');
       }

       const kHandle = Object.getOwnPropertySymbols(worker).find(s =>
         s.toString().includes("kHandle")
       );
-      if (kPublicPort) {
+      if (kHandle) {
         worker[kHandle].ref = () => {};
+      } else {
+        console.warn('Warning: kHandle symbol not found. Worker may prevent process exit.');
       }

       worker.unref();
     }
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 124ca0c and ffaaef1.

⛔ Files ignored due to path filters (2)
  • Cargo.lock is excluded by !**/*.lock
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (4)
  • .github/workflows/release-napi.yml (4 hunks)
  • napi/Cargo.toml (1 hunks)
  • napi/resolver.wasi.cjs (1 hunks)
  • package.json (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • package.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/release-napi.yml
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: JounQin
PR: unrs/unrs-resolver#72
File: fixtures/tsconfig/cases/dot-alias/tsconfigs/tsconfig.base.json:0-0
Timestamp: 2025-04-21T06:11:46.964Z
Learning: JounQin's fix for the dot alias issue in PR #72 addresses the problem by correctly normalizing paths in the `extend_tsconfig` method, ensuring that base URLs are properly resolved as absolute paths when extending tsconfigs, rather than adding special case handling for dot aliases in the resolver.
Learnt from: JounQin
PR: unrs/unrs-resolver#136
File: src/tests/extension_alias.rs:36-46
Timestamp: 2025-06-05T18:52:30.363Z
Learning: The fixtures/yarn directory in the unrs-resolver project requires running `yarn install` to install TypeScript dependencies before tests can run, similar to other fixture directories like fixtures/pnp. The test in src/tests/extension_alias.rs depends on the installed TypeScript package providing lib/typescript.d.ts and related files.
Learnt from: JounQin
PR: unrs/unrs-resolver#136
File: src/tests/extension_alias.rs:36-46
Timestamp: 2025-06-05T18:52:30.363Z
Learning: The fixtures/yarn directory in the unrs-resolver project requires running `yarn install` to install TypeScript dependencies before tests can run, similar to other fixture directories like fixtures/pnp. The test in src/tests/extension_alias.rs depends on the installed TypeScript package providing lib/typescript.d.ts and related files.
Learnt from: JounQin
PR: unrs/unrs-resolver#144
File: napi/patch.mjs:5-5
Timestamp: 2025-06-10T13:53:02.983Z
Learning: Build-time scripts in napi/patch.mjs and similar build pipeline contexts don't require error handling for reading expected files like index.js, as these files are guaranteed to be present during the build process.
napi/Cargo.toml (6)
Learnt from: JounQin
PR: unrs/unrs-resolver#136
File: src/tests/extension_alias.rs:36-46
Timestamp: 2025-06-05T18:52:30.363Z
Learning: The fixtures/yarn directory in the unrs-resolver project requires running `yarn install` to install TypeScript dependencies before tests can run, similar to other fixture directories like fixtures/pnp. The test in src/tests/extension_alias.rs depends on the installed TypeScript package providing lib/typescript.d.ts and related files.
Learnt from: JounQin
PR: unrs/unrs-resolver#136
File: src/tests/extension_alias.rs:36-46
Timestamp: 2025-06-05T18:52:30.363Z
Learning: The fixtures/yarn directory in the unrs-resolver project requires running `yarn install` to install TypeScript dependencies before tests can run, similar to other fixture directories like fixtures/pnp. The test in src/tests/extension_alias.rs depends on the installed TypeScript package providing lib/typescript.d.ts and related files.
Learnt from: JounQin
PR: unrs/unrs-resolver#129
File: src/tests/pnp.rs:6-6
Timestamp: 2025-06-02T15:57:50.888Z
Learning: In the unrs-resolver project, std::env is acceptable for test cases even when deprecated, as the user prefers simpler approaches in test code compared to production code standards.
Learnt from: JounQin
PR: unrs/unrs-resolver#75
File: src/tests/pnp.rs:116-133
Timestamp: 2025-04-21T08:17:34.175Z
Learning: Test cases in unrs-resolver that intentionally document failing behavior should make the intent clear by either: 1) asserting on the expected error condition rather than the desired behavior, 2) using #[should_panic] for tests expected to panic, or 3) using #[ignore] with a reason to skip known failing tests in CI.
Learnt from: JounQin
PR: unrs/unrs-resolver#40
File: src/tests/resolve.rs:121-136
Timestamp: 2025-03-29T04:14:03.715Z
Learning: For tests involving npm/yarn package resolution in the unrs-resolver project, dependencies must be installed first using the appropriate package manager commands (pnpm i, yarn) in both the root directory and fixture directories like fixtures/pnp and fixtures/misc/nested-package-json.
Learnt from: JounQin
PR: unrs/unrs-resolver#75
File: src/tests/pnp.rs:116-133
Timestamp: 2025-04-21T08:13:59.358Z
Learning: In the unrs-resolver project, tests that intentionally document failing behavior (regression tests) should either use #[should_panic], assert on the expected error, or include clear documentation indicating they are intentional failing test cases.
⏰ 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). (2)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: Benchmark
🔇 Additional comments (1)
napi/Cargo.toml (1)

25-27: Dependency updates look good

The updates to napi and napi-derive to version 3.0.0-beta.12 are properly aligned, and the new optional tracing-subscriber dependency is correctly configured with minimal features to reduce binary size.

@JounQin JounQin force-pushed the chore/bump_napi branch from ffaaef1 to d9c2778 Compare July 7, 2025 08:12
Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Caution

Changes requested ❌

Reviewed d9c2778 in 1 minute and 57 seconds. Click for details.
  • Reviewed 162 lines of code in 5 files
  • Skipped 1 files when reviewing.
  • Skipped posting 8 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. .github/workflows/release-napi.yml:92
  • Draft comment:
    Switch from CC to TARGET_CC for the riscv build; ensure the build tools honor TARGET_CC.
  • Reason this comment was not posted:
    Comment looked like it was already resolved.
2. .github/workflows/release-napi.yml:134
  • Draft comment:
    Use TARGET_CC (not CC) for mimalloc; verify that dependent builds expect TARGET_CC consistently.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 50% <= threshold 50% The comment suggests using TARGET_CC instead of CC for mimalloc, which is a specific code suggestion. However, it also asks to verify that dependent builds expect TARGET_CC consistently, which is against the rules as it asks for verification. The first part of the comment is useful, but the second part is not allowed.
3. .github/workflows/release-napi.yml:44
  • Draft comment:
    Disabled version check condition may trigger builds on every commit; confirm this is intentional.
  • Reason this comment was not posted:
    Comment looked like it was already resolved.
4. Cargo.lock:556
  • Draft comment:
    Downgrade of windows-targets from 0.53.2 to 0.52.6; verify that this change is compatible with other dependencies.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% This comment is asking the PR author to verify compatibility with other dependencies, which is against the rules. It does not provide a specific suggestion or ask for a specific test to be written. It also comments on a dependency change, which is not allowed unless it provides a specific actionable insight.
5. Cargo.lock:625
  • Draft comment:
    Bump of NAPI-related crates to beta.12; ensure API changes are compatible with existing consumers.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% This comment is related to dependency changes, specifically bumping NAPI-related crates to a new version. The comment suggests ensuring API changes are compatible with existing consumers, which falls under the rule of not asking the PR author to ensure compatibility or test changes. Therefore, this comment should be removed.
6. napi/Cargo.toml:25
  • Draft comment:
    NAPI dependencies updated to beta.12; confirm this aligns with Cargo.lock and the overall API.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% The comment is asking the PR author to confirm alignment with Cargo.lock and the overall API, which violates the rule against asking for confirmation or verification. It does not provide a specific suggestion or point out a specific issue.
7. package.json:31
  • Draft comment:
    Updated @napi-rs/cli to version 3.0.0-alpha.92; verify the CLI changes don't adversely affect the build process.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50% This comment is asking the PR author to verify that the CLI changes don't adversely affect the build process, which is against the rules. It is not making a specific code suggestion or asking for a specific test to be written. Therefore, it should be removed.
8. napi/resolver.wasi.cjs:73
  • Draft comment:
    Typo in comment: "a worker is consist of two handles: kPublicPort and kHandle." should be "a worker consists of two handles: kPublicPort and kHandle."
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 10% vs. threshold = 50% While the comment is technically correct about the grammar, it's a very minor issue in a comment that doesn't affect code functionality. The existing comment is still perfectly understandable despite the grammatical error. Comments about pure documentation/grammar issues that don't affect code understanding should generally be avoided unless they significantly impact clarity. The grammar error could potentially confuse non-native English speakers. Also, maintaining high quality even in comments shows attention to detail. The meaning is still clear despite the minor grammatical error, and we should focus review comments on substantive code issues rather than minor documentation fixes. Delete this comment as it addresses a trivial grammatical issue that doesn't impact code understanding or functionality.

Workflow ID: wflow_QbxxZuTpJy5RnPFV

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

@JounQin JounQin force-pushed the chore/bump_napi branch from d9c2778 to b3e9434 Compare July 8, 2025 03:13
@sonarqubecloud
Copy link

sonarqubecloud bot commented Jul 8, 2025

Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Caution

Changes requested ❌

Reviewed b3e9434 in 1 minute and 22 seconds. Click for details.
  • Reviewed 138 lines of code in 5 files
  • Skipped 1 files when reviewing.
  • Skipped posting 1 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. napi/resolver.wasi.cjs:73
  • Draft comment:
    Typographical error: In the comment "a worker is consist of two handles", it should read "a worker consists of two handles".
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 30% <= threshold 50% This comment is pointing out a typographical error in a comment within the code. While it is not directly related to the functionality of the code, correcting typographical errors can improve code readability and maintainability. However, it does not suggest a change in the code logic or functionality, nor does it ask for tests or confirmation of intent. It is more of an informative comment about a typo.

Workflow ID: wflow_wg5WyHxJDUrDLN4C

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

@JounQin JounQin enabled auto-merge (squash) July 9, 2025 14:40
@JounQin JounQin merged commit 450dab4 into main Jul 9, 2025
25 checks passed
@JounQin JounQin deleted the chore/bump_napi branch July 9, 2025 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants