fix(ci): compare native binary size against PR merge base#2112
Conversation
✅ Deploy Preview for viteplus-preview canceled.
|
How to use the Graphite Merge QueueAdd the label auto-merge to this PR to add it to the merge queue. You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
Native binary sizes (
|
| Artifact | Format | Base | PR | Change |
|---|---|---|---|---|
vp (Linux x64) |
Binary | 10.28 MiB | 10.28 MiB | 0 B (0.00%) |
vp (Linux x64) |
gzip -9 | 4.41 MiB | 4.41 MiB | 0 B (0.00%) |
| NAPI (Linux x64) | Binary | 33.41 MiB | 33.41 MiB | 0 B (0.00%) |
| NAPI (Linux x64) | gzip -9 | 12.78 MiB | 12.78 MiB | +1 B (+0.00%) |
vp (macOS ARM64) |
Binary | 7.61 MiB | 7.61 MiB | 0 B (0.00%) |
vp (macOS ARM64) |
gzip -9 | 3.82 MiB | 3.82 MiB | 0 B (0.00%) |
| NAPI (macOS ARM64) | Binary | 40.77 MiB | 40.77 MiB | 0 B (0.00%) |
| NAPI (macOS ARM64) | gzip -9 | 17.04 MiB | 17.04 MiB | +109 B (+0.00%) |
vp (Windows x64) |
Binary | 8.33 MiB | 8.33 MiB | 0 B (0.00%) |
vp (Windows x64) |
gzip -9 | 3.63 MiB | 3.63 MiB | 0 B (0.00%) |
| NAPI (Windows x64) | Binary | 27.87 MiB | 27.87 MiB | 0 B (0.00%) |
| NAPI (Windows x64) | gzip -9 | 10.78 MiB | 10.78 MiB | 0 B (0.00%) |
| Trampoline (Windows x64) | Binary | 203.00 KiB | 203.00 KiB | 0 B (0.00%) |
| Trampoline (Windows x64) | gzip -9 | 97.91 KiB | 97.91 KiB | 0 B (0.00%) |
| Installer (Windows x64) | Binary | 4.46 MiB | 4.46 MiB | 0 B (0.00%) |
| Installer (Windows x64) | gzip -9 | 2.08 MiB | 2.08 MiB | 0 B (0.00%) |
|
@codex review |
|
Codex Review: Didn't find any major issues. Hooray! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
The size gate diffed the PR head against the live tip of the base branch, so a branch merely behind on native-input changes already merged into the base branch would rebuild and post a size report it does not own (for example a docs-only PR forked before a dependency upgrade). Resolve the merge base and both compare and build against it, so the gate decision and the reported delta reflect only the PR's own changes.
Drop the explicit fetch of base.sha: checkout with fetch-depth 0 fetches every branch, so the extra fetch was a no-op round trip on each PR push. Fetch with filter blob:none: merge-base resolution needs commit ancestry, not historical blobs, cutting the gate checkout from ~28 MiB to ~10 MiB. Rename the base_sha output to merge_base_sha to distinguish it from pull_request.base.sha.
9f793ef to
8854385
Compare

The size gate compared the PR head against the current tip of the base branch. A branch that forked before a native-input change landed on main failed the hash comparison and got a six-platform rebuild plus a size report whose deltas came from commits already on main. #2111 hit this: an RFC-only PR received the size report for the #2104 dependency upgrade.
The gate now resolves the merge base and both compares and builds against it. The build runs only when the PR itself changes a native input, and the report covers only the PR's own delta. PRs that edit this workflow file still trigger a run.
The run on this PR exercised the new path end to end: base built at the merge base, head at the PR, and the size report shows 0 B raw delta on every artifact.