-
-
Notifications
You must be signed in to change notification settings - Fork 736
chore: add rsdoctor diff action #12256
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: chore/diff-v2
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for rspack canceled.
|
90a810c to
4cbf2b1
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
This PR adds Rsdoctor diff action functionality to the reusable build-test workflow to track and report build size changes.
- Integrates rsdoctor-action to monitor bundle size differences
- Clones an external demo repository for analysis
- Configures automated reporting on pull requests
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| run: pnpm run build | ||
|
|
||
| - name: Report Compressed Size | ||
| uses: web-infra-dev/rsdoctor-action@main |
Copilot
AI
Nov 20, 2025
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.
Using @main for the action version is a security and stability risk. The action could change unexpectedly, breaking the workflow or introducing malicious code.
Pin to a specific version or commit SHA:
uses: web-infra-dev/[email protected] # or specific commit SHA| uses: web-infra-dev/rsdoctor-action@main | |
| uses: web-infra-dev/rsdoctor-action@v1.0.0 |
| with: | ||
| github_token: ${{ secrets.GITHUB_TOKEN }} | ||
| file_path: "rspack-diff-minimal/dist/rsdoctor-data.json" | ||
| target_branch: "chore/diff-v2" |
Copilot
AI
Nov 20, 2025
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.
The target branch "chore/diff-v2" is hardcoded, which means this workflow will always compare against the same branch regardless of the actual PR base branch. This will produce incorrect comparisons for PRs targeting different branches.
Consider making this configurable or using a dynamic value like ${{ github.base_ref }} to automatically use the PR's target branch.
| target_branch: "chore/diff-v2" | |
| target_branch: ${{ github.base_ref }} |
| - name: Clone rspack-sourcemap-demo | ||
| run: git clone [email protected]:yifancong/rspack-diff-minimal.git | ||
|
|
||
| - name: Install dependencies | ||
| working-directory: rspack-diff-minimal | ||
| run: pnpm i | ||
|
|
||
| - name: Build project | ||
| working-directory: rspack-diff-minimal | ||
| run: pnpm run build | ||
|
|
||
| - name: Report Compressed Size | ||
| uses: web-infra-dev/rsdoctor-action@main | ||
| with: | ||
| github_token: ${{ secrets.GITHUB_TOKEN }} | ||
| file_path: "rspack-diff-minimal/dist/rsdoctor-data.json" | ||
| target_branch: "chore/diff-v2" |
Copilot
AI
Nov 20, 2025
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.
These rsdoctor diff steps run unconditionally for all test matrix combinations (different Node versions and targets). This means the same rsdoctor analysis will be executed multiple times unnecessarily, wasting CI resources and potentially causing conflicts.
Add a condition to run only once, for example:
- name: Clone rspack-diff-minimal
if: ${{ matrix.node == '20' && inputs.target == 'x86_64-unknown-linux-gnu' }}
run: git clone https://github.com/yifancong/rspack-diff-minimal.gitApply the same condition to all rsdoctor-related steps (lines 149-162).
|
|
||
| ### Rsdoctor Diff Action | ||
| - name: Clone rspack-sourcemap-demo | ||
| run: git clone [email protected]:yifancong/rspack-diff-minimal.git |
Copilot
AI
Nov 20, 2025
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.
The git clone command uses SSH protocol ([email protected]:), which will fail in GitHub Actions without SSH key configuration. There's no SSH key setup in the workflow, so this step will fail with an authentication error.
Replace with HTTPS protocol:
run: git clone https://github.com/yifancong/rspack-diff-minimal.git| run: git clone git@github.com:yifancong/rspack-diff-minimal.git | |
| run: git clone https://github.com/yifancong/rspack-diff-minimal.git |
📦 Binary Size-limit
🙈 Size remains the same at 47.63MB |
CodSpeed Performance ReportMerging #12256 will degrade performances by 20.12%Comparing Summary
Benchmarks breakdown
Footnotes |
3850784 to
10c9699
Compare
09834f9 to
7caec74
Compare
db8515a to
f8aab99
Compare
0af480d to
9719312
Compare
Summary
Related links
Checklist