-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
feat(cicd): add bundle stats comparison #8245
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8245 +/- ##
==========================================
+ Coverage 76.45% 76.72% +0.26%
==========================================
Files 115 118 +3
Lines 9643 9822 +179
Branches 317 336 +19
==========================================
+ Hits 7373 7536 +163
- Misses 2269 2284 +15
- Partials 1 2 +1 ☔ View full report in Codecov by Sentry. |
|
WOW look soo cool ! I'm surprised there are any tool like that on Vercel |
This comment was marked as outdated.
This comment was marked as outdated.
53e8bac to
cfe260e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds a workflow to compare bundle sizes between a PR and the base branch using build artifacts, and updates the build pipeline to emit and upload stats.
- Introduces a workflow_run-triggered job that pulls artifacts from the PR’s Build run and the latest main run, then compares stats.
- Updates the Build workflow to generate webpack stats (via TURBOPACK_STATS) and upload them as an artifact on ubuntu-latest.
- Plumbs TURBOPACK_STATS through Turbo tasks in apps/site.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| apps/site/turbo.json | Allows TURBOPACK_STATS to pass through for dev/build/start/deploy tasks so stats can be generated in CI. |
| .github/workflows/build.yml | Exposes TURBOPACK_STATS on ubuntu-latest and uploads webpack-stats.json as an artifact. |
| .github/workflows/bundle-compare.yml | New workflow to fetch artifacts from the PR run and latest main run and compare bundle stats, posting results to the PR. |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
You can also download the stats file, as it's an artifact.
|
|
This is cool. I am probably naive to some inner working here - but surprised it works with the chunks being generated hash filenames |
|
Bump @nodejs/web-infra |
4879222 to
95f43b0
Compare
|
So apparently the action doesn't support So, I need to write a little custom action to do all of our special logic |
|
Can we not just open a PR upstream to add support, rather than rolling our own? |
I'm planning to do both. I'll open a Pr upstream, and in the meantime, have a simple script here, unless we'd rather wait for the upstream PR to land? |
|
I'm personally fine with waiting until upstream support is landed, unless others have a strong need for this urgently. |
|
I'm fine merging this without workflow_run for now. @avivkeller can you mark the PR as ready and open a follow-up issue? |
|
@ovflowd we need workflow_run for this, otherwise, it's useless to have as an extra file |
|
Ack, any issue created upstream? |
|
Yea, I opened a PR |
1117c2c to
073d763
Compare
|
It seems nothing is happening upstream, so I'm implementing something here |
📦 Build Size ComparisonSummary
Changes➕ Added Assets (1)
➖ Removed Assets (1)
|

Adds a new
workflow_runworkflow which compares the bundle size of the current PR and the base branch.See #8245 (comment), which shows the diff between a previous commit of this PR and the current commit (which, since no Next.js code changed, is nothing).
Note
If this workflow fails, it will not display 🔴 on the PR. If it succeeds, it won't display 🟢 either.
Note
This workflow will fail for PRs open up unto this point, but should succeed for PRs opened after this is merged.