getsentry / getsentry/sentry-javascript

Add per-PR bundle size checks

未关闭
#21,813 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
Dev: CI
主要语言
TypeScript
星标
8.7k
派生
1.8k
平均合并
1 天 17 小时
30 天内合并 PR
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 摘要。