Skip to content

ci: report binary size change on pull requests - #2081

Merged
fansenze merged 3 commits into
mainfrom
ci/binary-size-monitoring
Sep 20, 2026
Merged

fansenze merged 3 commits into
mainfrom
ci/binary-size-monitoring

Conversation

@elecmonkey

@elecmonkey elecmonkey commented Sep 7, 2026

Copy link
Copy Markdown
Member

Summary

Nothing in CI tells a reviewer how much a pull request grows the binary. This reports it, with no added build and no repository configuration.

How it works

  • MeasureTest npm packages already compiles everything behind ./cmd/rslint, so a release relink right after Build is link-only off the warm cache: 49s against 5m12s for a full build. It relinks rather than measuring the binary that job already produced, which is 52.20 MiB unstripped where the released one is 37.10 MiB.
  • Store — every run, main included, uploads its measurement as a workflow artifact. No repository writes, no token beyond the built-in GITHUB_TOKEN.
  • Compare — a pull request's baseline is the artifact of the main run for its base commit. The new Binary Size job reads both, writes the comparison to the job summary, and updates one pull request comment in place.

The job is deliberately absent from CI Done — porting a rule legitimately grows the binary, so this informs a review rather than blocking a merge.

Limits

  • A fork's token is read-only, so the comment step fails there by design and the job summary is the report.
  • Artifacts expire, so this covers the per-pull-request comparison; the long-term main trend still needs somewhere durable to write.

Related Links

Closes #2059

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Token scope in the Binary Size job

The trigger is pull_request, never pull_request_target: a fork's token is capped read-only regardless of the permissions: block, and a same-repo author already has push access. The pull-requests: write token crosses no privilege boundary.

@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

🦀📦 Binary size

Commit b90a29d merged into base 0e15fa6feat(jest,rstest): add prefer-lowercase-title rule (#2197).

Binary Base This PR Change
rslint (linux-x64-gnu) 39.23 MiB

Stripped go build -ldflags="-s -w" ./cmd/rslint, Go 1.26.0, linux/amd64 · run · 2026-09-20 09:09 UTC

@elecmonkey

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ff53febf97

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

Comment thread scripts/binary-size.mjs Outdated
Comment thread scripts/binary-size.mjs Outdated
@fansenze
fansenze enabled auto-merge (squash) September 20, 2026 09:24
@fansenze
fansenze merged commit 87f8dab into main Sep 20, 2026
16 checks passed
@fansenze
fansenze deleted the ci/binary-size-monitoring branch September 20, 2026 09:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Proposal]: Establish binary size monitoring for Rslint

2 participants