Skip to content

[ci] Compare size against merge base - #37355

Open
eps1lon wants to merge 1 commit into
mainfrom
sebbie/sizebot-merge-base
Open

[ci] Compare size against merge base #37355
eps1lon wants to merge 1 commit into
mainfrom
sebbie/sizebot-merge-base

Conversation

@eps1lon

@eps1lon eps1lon commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

Sizebot compared the pull request head build against the build of pull_request.base.sha, which is the tip of the base branch at event time, not the commit the pull request diverged from. The field's semantics are undocumented in GitHub's API schema (the OpenAPI description types it as a bare string); the observed behavior and the compare API's merge_base_commit confirm the difference.

The difference between pull_request.base.sha and the merge base is confirmed with an example in #37356

The sizebot job now resolves the merge-base through the compare API and downloads the base build for that commit instead, so the report only ever contains the pull request's own changes. The job gains contents: read for the compare call.

When no base build can be downloaded for the merge-base, for example because its artifacts aged out of the retention window or its run failed, the sizebot job records a base-build-not-found result instead of failing immediately. render-comment.js on the default branch renders that as a warning comment naming the base commit and writes the sizebot-problem.txt marker, so the comment workflow fails its check after posting the warning, the same pattern already used for build configuration drift. The sizebot job itself intentionally stays green: a failed run would make the renderer discard the results and mask the warning with a generic "did not complete" message.

@meta-cla meta-cla Bot added the CLA Signed label Aug 24, 2026
@github-actions

github-actions Bot commented Aug 24, 2026

Copy link
Copy Markdown

Comparing: bd6ea41...fa7e59f

Critical size changes

Includes critical production bundles, as well as any change greater than 2%:

Name +/- Base Current +/- gzip Base gzip Current gzip
oss-stable/react-dom/cjs/react-dom.production.js = 7.35 kB 7.35 kB = 1.96 kB 1.96 kB
oss-stable/react-dom/cjs/react-dom-client.production.js = 622.22 kB 622.22 kB = 110.01 kB 110.01 kB
oss-experimental/react-dom/cjs/react-dom.production.js = 7.36 kB 7.36 kB = 1.96 kB 1.96 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js = 693.43 kB 693.43 kB = 121.46 kB 121.46 kB
facebook-www/ReactDOM-prod.classic.js = 713.60 kB 713.60 kB = 124.93 kB 124.93 kB
facebook-www/ReactDOM-prod.modern.js = 703.91 kB 703.91 kB = 123.36 kB 123.36 kB

Significant size changes

Includes any change greater than 0.2%:

(No significant changes)

Generated by sizebot against fa7e59f

@github-actions github-actions Bot added the React Core Team Opened by a member of the React Core Team label Aug 24, 2026
@eps1lon eps1lon changed the title sebbie/sizebot merge base [ci] Compare size against merge base Aug 24, 2026
@eps1lon
eps1lon force-pushed the sebbie/sizebot-merge-base branch from 3889b54 to 3a9a427 Compare August 24, 2026 12:31
eps1lon added a commit that referenced this pull request Aug 24, 2026
…e merge-base

This pull request contains a comment-only change on top of 675a29c, the parent of the size-changing commit dc631ef, because an empty diff is skipped by the workflow's path filters. It exists to demonstrate the problem that #37355 fixes: sizebot compares the head build against the build of `pull_request.base.sha`, the current tip of main, rather than against the merge-base. The sizebot comment on this pull request should therefore contain the entire size footprint of dc631ef even though this branch contains none of its changes. After #37355 lands, the sizebot comment on this pull request should instead be empty.

Co-Authored-By: Claude Code (kimi-k3[1m]) <noreply@anthropic.com>
Sizebot compared the pull request head build against the build of `pull_request.base.sha`, which is the tip of the base branch at event time, not the commit the pull request diverged from. The field's semantics are undocumented in GitHub's API schema; the observed behavior and the compare API's `merge_base_commit` confirm the difference. Once main moved ahead, every pull request based on an older commit reported the size changes of unrelated main commits as if they were its own, which is why a branch predating a large size-changing commit produced a report too large to display. The sizebot job now resolves the merge-base through the compare API and downloads the base build for that commit instead.

When no base build can be downloaded for the merge-base, for example because its artifacts aged out of the retention window or its run failed, the sizebot job now records a `base-build-not-found` result instead of failing immediately. `render-comment.js` on the default branch renders that as a warning comment naming the base commit and writes the `sizebot-problem.txt` marker, so the comment workflow fails its check after posting the warning, the same pattern already used for build configuration drift. The sizebot job itself stays green because a failed run would make the renderer discard the results and mask the warning with a generic "did not complete" message.

Co-Authored-By: Claude Code (kimi-k3[1m]) <noreply@anthropic.com>
@eps1lon
eps1lon force-pushed the sebbie/sizebot-merge-base branch from 3a9a427 to fa7e59f Compare August 24, 2026 13:14
@eps1lon
eps1lon marked this pull request as ready for review August 24, 2026 19:17
@eps1lon
eps1lon requested a review from hoxyq August 24, 2026 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed React Core Team Opened by a member of the React Core Team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant