Skip to content

fix(ci): a package fails its size budget only when more than 1% over it - #6131

Merged
miguel-heygen merged 1 commit into
mainfrom
fix/package-size-tolerance
Oct 23, 2026
Merged

miguel-heygen merged 1 commit into
mainfrom
fix/package-size-tolerance

Conversation

@miguel-heygen

Copy link
Copy Markdown
Collaborator

Package size budgets are the exact packed sizes someone last measured, so any PR that adds ordinary code fails Build on a few hundred bytes. This lets a package go up to 1% over its budget before verify:packed-manifests fails. The budget in scripts/package-size-budgets.json stays the number people bump, and the 15% ratchet that makes a shrinking package lower its budget is unchanged.

Measured against what the guard exists to catch (a stray sourcemap, tests or assets in the tarball):

case over budget at 1%
the v0.8.187 publish job, @hyperframes/aws-lambda +115 B packed (0.16%), +208 B unpacked (0.08%) passes
#6127, @hyperframes/engine +215 B passes
#6104, @hyperframes/studio-server +325 B passes
the ECR push, @hyperframes/aws-lambda +2486 B packed (3.4%), +8846 B unpacked (3.3%) fails, needs an explicit budget bump

Tolerance per package is small in bytes: aws-lambda 733 B packed and 2.7 KB unpacked, engine 4.3 KB, studio-server 1.4 KB. A stray tests directory or sourcemap is tens of KB to MB, over 5% on every package. The 150 MB Lambda zip class is guarded separately by verify:zip-size.

The new test fails without the change: with verify-packed-manifests.mjs from main the two size tests fail, with the change all 23 pass (run on a built tree).

No visible change

Build tooling only.

The budgets are the exact packed sizes people last measured, so a few hundred bytes of ordinary code failed Build. The exact budget stays the number to bump and the 15% ratchet stays; only the over-budget comparison gets 1% of tolerance.

@heygengenesis heygengenesis Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Verdict: APPROVE · 0 blocker · 0 important · 0 nits · head 02ea2d35

Scope

The tolerance only changes the over-budget comparison (budget × 1.01). The budget stays the cap, so slack can't pile up across PRs. The 15% ratchet and the 5% suggested-budget headroom (:563) are unchanged, and publish.yml runs the same script. With the new rule, #6104's studio-server (+325 B of 141718) and #6127's engine (+215 B) pass, and a stray sourcemap or test directory still fails. Lint, Typecheck, Build and every Test job passed at this head.

@miguel-heygen
miguel-heygen added this pull request to the merge queue Oct 23, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 23, 2026
@miguel-heygen
miguel-heygen added this pull request to the merge queue Oct 23, 2026
Merged via the queue into main with commit 2b8282f Oct 23, 2026
67 of 69 checks passed
@miguel-heygen
miguel-heygen deleted the fix/package-size-tolerance branch October 23, 2026 16:04
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.

1 participant