getsentry / getsentry/sentry-javascript

Add per-PR bundle size checks

オープン
#21,813 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
Dev: CI
主要言語
TypeScript
スター
8.7k
フォーク
1.8k
平均マージ
1日 17時間
マージ済み PR(30日)
515

説明

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!

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
typescript
領域
build-system, ci-cd, performance
issue の種類
機能追加
難易度
4/5
見積もり時間
3〜5日
活発さ
静か
明瞭さ
おおむね明確
初心者へのやさしさ
48/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。