getsentry / getsentry/sentry-javascript
Add per-PR bundle size checks
- Ngôn ngữ chính
- TypeScript
- Star
- 8.7k
- Fork
- 1.8k
- Merge trung bình
- 1 ngày 17 giờ
- Pull request đã merge (30 ngày)
- 515
Mô tả
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!
Hướng dẫn đóng góp
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- typescript
- Lĩnh vực
- build-system, ci-cd, performance
- Loại issue
- Tính năng
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Ít trao đổi
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 48/100