Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds support for collapsible sections in bundle analysis reports and implements a fallback mechanism to find baseline artifacts from parent commits when the latest commit lacks them. The changes improve the user experience by automatically expanding reports with significant changes while keeping minor changes collapsed, and by providing clearer feedback when baseline comparisons use fallback commits.
Key Changes
- Exports
formatBytesandcalculateDiffutility functions for reuse across modules - Implements fallback logic to search up to 5 parent commits when the latest commit doesn't have baseline artifacts
- Adds collapsible Quick Summary and Detailed Reports sections in PR comments, with automatic expansion based on change significance
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/report.ts | Exports utility functions (formatBytes, calculateDiff) and changes 'N/A' to '0' for missing baseline comparisons; removes emoji for changes < 1% |
| src/github.ts | Adds hasArtifactsForCommit and getParentCommit methods; modifies getTargetBranchLatestCommit to return object with fallback information and traverse up to 5 parent commits |
| src/index.ts | Adds fallback tracking fields to ProjectReport; implements collapsible sections with conditional expansion based on change significance (>= 1%); adds Quick Summary table for monorepo overview |
| src/tests/github.test.ts | Updates test to expect object return type from getTargetBranchLatestCommit; adds test case for fallback commit behavior when latest commit has no artifacts |
| dist/index.js | Compiled output reflecting source changes, including new methods and collapsible section logic |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
4310ddc to
45dda4e
Compare
Rsdoctor Bundle Diff AnalysisFound 2 projects in monorepo, 1 project with changes. 📊 Quick Summary
📋 Detailed Reports (Click to expand)📁 rsbuild-demo2Path:
📦 Download Diff Report: rsbuild-demo2 Bundle Diff Generated by Rsdoctor GitHub Action |
c698191 to
5b550d6
Compare
optimize: collapse the details info