Skip to content

Migrate to Webpack logger and improve test coverage - #740

Open
ronakmaheshwari wants to merge 6 commits into
webpack:mainfrom
ronakmaheshwari:main
Open

ronakmaheshwari wants to merge 6 commits into
webpack:mainfrom
ronakmaheshwari:main

Conversation

@ronakmaheshwari

@ronakmaheshwari ronakmaheshwari commented Sep 17, 2026

Copy link
Copy Markdown
Contributor
**Summary**

Fixes #727

Adds missing test coverage for `analyzerMode: "server"` in `test/plugin.js`:
- Tests starting the analyzer server with `openAnalyzer: false` and `analyzerPort: "auto"`, verifying that the server starts listening and invokes `analyzerUrl` with the bound host and port.
- Tests reusing the plugin instance across multiple compiler configurations in `server` mode, verifying that `updateChartData` is called with the subsequent compiler's bundle directory (covering the logic introduced in #725).
- Ensures proper resource cleanup of HTTP and WebSocket servers across test runs.

**What kind of change does this PR introduce?**

test

**Did you add tests for your changes?**

Yes, this PR adds test coverage in `test/plugin.js`.

**Does this PR introduce a breaking change?**

No

**If relevant, what needs to be documented once your changes are merged or what have you already documented?**

N/A (test additions only)

**Use of AI**
No 

Summary by CodeRabbit

  • New Features

    • Webpack Bundle Analyzer now integrates with Webpack’s native infrastructure logging when available.
    • Server-mode URL callbacks now receive the analyzer server’s bound address.
  • Bug Fixes

    • Reusing the analyzer plugin across compilations now correctly refreshes chart data for the latest build.
  • Deprecations

    • The logLevel option is deprecated. Use Webpack’s infrastructureLogging configuration instead.

@changeset-bot

changeset-bot Bot commented Sep 17, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 6da2211

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
webpack-bundle-analyzer Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@ronakmaheshwari

Copy link
Copy Markdown
Contributor Author

@valscion I have added the tests which can help you close:- 727. Can you please review it

@coderabbitai

coderabbitai Bot commented Sep 17, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 293299cb-5bd1-46e8-b316-eed5a0e744ff

📥 Commits

Reviewing files that changed from the base of the PR and between 6d1ae28 and 6da2211.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (2)
  • .changeset/use-webpack-infrastructure-logger.md
  • test/plugin.js

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


Walkthrough

The changes add server-mode test coverage. The tests verify that analyzerUrl receives the server address and that reused plugin instances update chart data for the second compilation. A changeset announces a minor release and documents use of Webpack’s infrastructure logger and deprecation of logLevel.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 6da22

The server-mode coverage verifies the reused-plugin update path, with no concrete merge-blocking risk identified.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The PR also migrates the plugin to Webpack's infrastructure logger and adds a changeset that deprecates logLevel in favor of infrastructureLogging. This logger migration is not connected to the te… Remove the infrastructure logger migration and its changeset from this pull request, or link the migration to a separate issue and submit it separately.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes both primary changes: migration to Webpack's infrastructure logger and expanded test coverage.
Linked Issues check ✅ Passed Issue #727 requires automated coverage for analyzerMode: "server". The PR adds tests for server startup with openAnalyzer: false and analyzerPort: "auto", verifies the analyzerUrl callback rec…
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Full details: Out of Scope Changes check

Explanation

The PR also migrates the plugin to Webpack's infrastructure logger and adds a changeset that deprecates logLevel in favor of infrastructureLogging. This logger migration is not connected to the test-coverage objective in issue #727.

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

Warning

Some tools did not complete. Review the errors below.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

test/plugin.js

ESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox.


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.

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.

1 participant