Conversation
Co-authored-by: PavelVanecek <1100170+PavelVanecek@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7039 +/- ##
=======================================
Coverage 90.12% 90.13%
=======================================
Files 526 526
Lines 39242 39253 +11
Branches 5438 5438
=======================================
+ Hits 35368 35379 +11
Misses 3865 3865
Partials 9 9 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Bundle ReportBundle size has no change ✅ |
Co-authored-by: PavelVanecek <1100170+PavelVanecek@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
Staging Deployment Details
These deployments will remain available for 30 days. To update snapshots: Comment |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
WalkthroughThis PR adds BundleWatch integration to monitor bundle sizes across CI/CD pipelines. It includes configuration files, a new CI workflow step, package updates with the bundlewatch dependency and script, and modifications to the bundle upload script to output treeshaking bundles for size tracking. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
.github/workflows/ci.yml (2)
175-183: BundleWatch step is not guarded — transient failures will block Chromatic publishing.Unlike the Chromatic step (which has
if: ${{ env.ENCRYPTED_CHROMATIC_TOKEN }}), the BundleWatch step has nocontinue-on-error: trueand no guard condition. Any BundleWatch failure — including service outages, upstream API errors, or a staleBUNDLEWATCH_GITHUB_TOKEN— will fail the wholebuild_test_packjob and prevent Chromatic from publishing.If the intent is for bundle size regressions to be hard-blocking, this is fine. But consider adding
continue-on-error: true(at least initially while baselining) so that infrastructure issues don't cascade into blocking the rest of the job.💡 Suggested guard pattern (optional)
- name: BundleWatch + continue-on-error: true env: BUNDLEWATCH_GITHUB_TOKEN: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/ci.yml around lines 175 - 183, The BundleWatch step named "BundleWatch" is currently unguarded and can fail the entire build_test_pack job; update that workflow step to either add continue-on-error: true to the BundleWatch step or add a guard condition (e.g., only run when BUNDLEWATCH_GITHUB_TOKEN is present) so transient BundleWatch failures do not block Chromatic publishing—locate the step that sets BUNDLEWATCH_GITHUB_TOKEN and run: npm run bundlewatch and add the chosen guard (continue-on-error or an if: check) to that step.
175-183: Add explicit step dependency or pre-check for bundlewatch-bundles files.The BundleWatch step (lines 175-183) implicitly depends on
bundlewatch-bundles/treeshaking-*.jsfiles created by the "Upload bundle analysis report to Codecov" step, but there is no explicitneeds:clause. Additionally, error handling inscripts/upload-bundle-analysis.jsswallows failures: the.catch()at line 36 logs errors without rethrowing, so if the promise chain exits early (e.g., before all fivefs.copyFileSynccalls at line 118), BundleWatch will silently find missing files or report 0 bytes without a clear diagnostic.Clarify this coupling by adding an explicit
needs:dependency in the workflow, or add a pre-check in the BundleWatch step to verify the expected files exist.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/ci.yml around lines 175 - 183, The BundleWatch job currently implicitly depends on artifacts produced by the "Upload bundle analysis report to Codecov" step and should either declare that dependency or perform a pre-check; update the workflow so the BundleWatch step (name: BundleWatch) includes an explicit needs: reference to the job that runs scripts/upload-bundle-analysis.js, or add a pre-check before running npm run bundlewatch that validates the presence of bundlewatch-bundles/treeshaking-*.js files and fails fast with a clear message if any are missing; also update scripts/upload-bundle-analysis.js to stop swallowing errors by removing the top-level .catch() that only logs and instead rethrow or propagate the error (so failures during fs.copyFileSync calls cannot silently leave missing files).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In @.github/workflows/ci.yml:
- Around line 175-183: The BundleWatch step named "BundleWatch" is currently
unguarded and can fail the entire build_test_pack job; update that workflow step
to either add continue-on-error: true to the BundleWatch step or add a guard
condition (e.g., only run when BUNDLEWATCH_GITHUB_TOKEN is present) so transient
BundleWatch failures do not block Chromatic publishing—locate the step that sets
BUNDLEWATCH_GITHUB_TOKEN and run: npm run bundlewatch and add the chosen guard
(continue-on-error or an if: check) to that step.
- Around line 175-183: The BundleWatch job currently implicitly depends on
artifacts produced by the "Upload bundle analysis report to Codecov" step and
should either declare that dependency or perform a pre-check; update the
workflow so the BundleWatch step (name: BundleWatch) includes an explicit needs:
reference to the job that runs scripts/upload-bundle-analysis.js, or add a
pre-check before running npm run bundlewatch that validates the presence of
bundlewatch-bundles/treeshaking-*.js files and fails fast with a clear message
if any are missing; also update scripts/upload-bundle-analysis.js to stop
swallowing errors by removing the top-level .catch() that only logs and instead
rethrow or propagate the error (so failures during fs.copyFileSync calls cannot
silently leave missing files).
Integrates BundleWatch to track bundle sizes on every CI run, with PR comments showing size deltas against
main.Description
.bundlewatch.config.json— new config tracking 6 bundles:umd/Recharts.js(minified UMD, 600kB limit)bundlewatch-bundles/treeshaking-{cartesian,polar,treemap,sunburst,sankey}.js(300kB limit each)scripts/upload-bundle-analysis.js—generateAndUploadTreeshakingBundlenow accepts an optionalbundlewatchOutputFile; when provided, copies the bundle tobundlewatch-bundles/before the temp dir is cleaned up. All 5 tree-shaking calls pass their respective output paths so BundleWatch has persistent files to read..github/workflows/ci.yml—BundleWatchstep added after the Codecov bundle analysis step (which now populatesbundlewatch-bundles/). PassesBUNDLEWATCH_GITHUB_TOKENfrom secrets and sets the required CI env vars (CI_COMMIT_SHAuses the PR head SHA for pull requests,CI_BRANCH_BASEfalls back tomainfor direct pushes)..gitignore—bundlewatch-bundles/excluded.package.json—bundlewatch@^0.4.1added to devDependencies;bundlewatchnpm script added asbundlewatch --config .bundlewatch.config.json(BundleWatch does not auto-discover.bundlewatch.config.jsonby name — without an explicit--configflag it looks inpackage.jsonand fails with "Configuration missing").Related Issue
Tracks the same 5 tree-shaking bundles plus the UMD artifact introduced in #7032.
Motivation and Context
Without BundleWatch, there is no automated per-PR signal on whether bundle sizes are growing. BundleWatch posts a PR comment summarising size changes vs the
mainbaseline, giving reviewers actionable data before merging.How Has This Been Tested?
CI workflow updated; will validate on first run against this PR. The
upload-bundle-analysis.jschange is additive (file copy before temp-dir cleanup) and does not affect the existing Codecov upload path.Screenshots (if appropriate):
Types of changes
Checklist:
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.
Summary by CodeRabbit