Skip to content

Scope package size report to this repo's packages and colorize deltas - #5184

Merged
iscai-msft merged 2 commits into
Azure:mainfrom
timotheeguerin:improve-package-size-report
Aug 7, 2026
Merged

Scope package size report to this repo's packages and colorize deltas#5184
iscai-msft merged 2 commits into
Azure:mainfrom
timotheeguerin:improve-package-size-report

Conversation

@timotheeguerin

@timotheeguerin Timothee Guerin (timotheeguerin) commented Aug 7, 2026

Copy link
Copy Markdown
Member

The package size check reports noise. On #5182 — a core submodule bump — it claimed 25 packages changed size, most by a handful of bytes. Two independent causes, both fixed here.

It measured the core/ submodule. Those packages are published from microsoft/typespec; no PR here can change their published size. They're also measured unreliably — 11 of them ship .turbo/turbo-build.log, which captures the compiler version banner and CLI spinner frames, so their tarball size shifts on every build (filed as microsoft/typespec#11589). Measurement is now scoped to this repo's packages/, taking the report from 45 packages down to the 13 we actually publish.

Rebuilding isn't byte-reproducible, so every package wobbled. @azure-tools/typespec-java is the clearest case: it ships a Maven jar whose zip entries carry wall-clock build timestamps. The workflow builds head and base minutes apart, so those bytes differ while the jar's length doesn't — the packed size moves a few dozen bytes and the unpacked delta is exactly zero. The report duly announced it as a change.

Deltas now need to clear both a byte floor and a percentage floor to count, mirroring isNotableMetricChange in packages/benchmark/src/compare.ts. Sub-threshold rows drop into the collapsed section instead of leading the comment:

2 packages changed size, +19.99 KB (+0.1%) packed overall.

Package Packed (base → head) Δ Packed Unpacked (base → head) Δ Unpacked
@azure-tools/typespec-metadata 🆕 — → 15.91 KB +15.91 KB (new) — → 62.26 KB +62.26 KB (new)
@azure-tools/typespec-azure-core 123.69 KB → 127.87 KB +4.18 KB (+3.4%) 🔴 689.86 KB → 695.48 KB +5.63 KB (+0.8%) 🔴
2 package(s) with no notable change
Package Packed (base → head) Δ Packed Unpacked (base → head) Δ Unpacked
@azure-tools/typespec-ts 524.72 KB → 524.66 KB -58 B (-0.0%) 2.53 MB → 2.53 MB
@azure-tools/typespec-java 13.51 MB → 13.51 MB -46 B (-0.0%) 15.03 MB → 15.03 MB

The 🔴/🟢 markers match the benchmark comment's existing convention. I first tried real colored text via GitHub inline math, but it renders in MathJax's fonts rather than GitHub's, and it's a pattern almost no size bot uses — preactjs/compressed-size-action, size-limit-action, Codecov, BundleMon and the Next.js bot all signal direction with emoji instead.

compare.ts no longer runs main() on import, so the rendering is covered by tests.

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

No changes needing a change description found.

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

📦 Package size report

✅ No notable package size changes compared to the base branch.

13 package(s) with no notable change
Package Packed (base → head) Δ Packed Unpacked (base → head) Δ Unpacked
@azure-tools/typespec-java 13.51 MB → 13.51 MB -24 B (-0.0%) 15.03 MB → 15.03 MB
@azure-tools/azure-http-specs 146.21 KB → 146.21 KB 1.16 MB → 1.16 MB
@azure-tools/typespec-autorest 80.93 KB → 80.93 KB 395.06 KB → 395.06 KB
@azure-tools/typespec-autorest-canonical 7.42 KB → 7.42 KB 26.00 KB → 26.00 KB
@azure-tools/typespec-azure-core 127.87 KB → 127.87 KB 695.48 KB → 695.48 KB
@azure-tools/typespec-azure-portal-core 42.26 KB → 42.26 KB 192.36 KB → 192.36 KB
@azure-tools/typespec-azure-resource-manager 171.18 KB → 171.18 KB 1.04 MB → 1.04 MB
@azure-tools/typespec-azure-rulesets 5.15 KB → 5.15 KB 31.73 KB → 31.73 KB
@azure-tools/typespec-client-generator-core 225.96 KB → 225.96 KB 1.22 MB → 1.22 MB
@azure-tools/typespec-go 242.43 KB → 242.43 KB 1.24 MB → 1.24 MB
@azure-tools/typespec-metadata 15.91 KB → 15.91 KB 62.26 KB → 62.26 KB
@azure-tools/typespec-python 46.22 KB → 46.22 KB 180.83 KB → 180.83 KB
@azure-tools/typespec-ts 524.66 KB → 524.66 KB 2.53 MB → 2.53 MB

Packed = gzipped .tgz published to npm. Unpacked = total extracted size. 🆕 added, 🗑️ removed. Packages from the core/ submodule are not included.
🔴 grew · 🟢 shrank — only changes of at least 512 B and 0.5% are marked.

@azure-sdk-automation

Copy link
Copy Markdown
Contributor

You can try these changes here

🛝 Playground 🌐 Website

@iscai-msft
iscai-msft added this pull request to the merge queue Aug 7, 2026
Merged via the queue into Azure:main with commit 06f0c04 Aug 7, 2026
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants