getsentry / getsentry/sentry-javascript

Add per-PR bundle size checks

Offen
#21,813 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Dev: CI
Vorherrschende Sprache
TypeScript
Sterne
8.7k
Forks
1.8k
Ø Merge
1 T. 17 Std.
Gemergte PRs (30 T.)
515

Beschreibung

A while ago we decided to automatically bump our bundle size limits on a weekly basis, with the main objective of avoiding having to bump limits on PRs that didn't cause a lot of size increase on their own, but brought existing limits just over the brink. While the new approach fixes this in 99% of the cases, it also makes us much less aware of larger increases because they still fall under the weekly bumped limit.

We talked about this issue and decided that

1. We don't want to resort to the old behaviour since it brought indeed friction
2. Instead, we want to go with a per-PR/size-diff based approach:
- Check delta of size increase that the specific PR causes
- Fail CI job if size increase is larger than 0.5KB **for gzipped** bundles. Don't take uncompressed bundles into consideration.
- Have users apply a label (e.g. "Increases bundle size"), or alternatively a comment that reruns the CI job so that it passes. (The advantage of the label is that we can filter on size-increasing PRs easier but it's not a must-do).
- Remove the weekly bumping and the actual size limits. We of course still want to report the overall bundle size (on every PR and on every GH release) but since we move to a diff-based limiting approach, there's no point anymore for overall limits

h/t @nicohrubec for suggesting the per-PR idea!

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

No files or tests are named. Start by locating the CI job and configuration responsible for weekly bundle-limit updates and bundle-size reporting, then trace how PR size data and gzipped bundles are calculated. Done means weekly bumping and absolute limits are removed, PRs fail for gzipped increases over 0.5KB unless approved, and overall sizes remain reported on PRs and releases.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
typescript
Bereich
build-system, ci-cd, performance
Issue-Typ
Feature
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Ruhig
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
48/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.