feat(preprod): Add settings UX for size analysis PR comment rules#120205
Merged
mtopo27 merged 3 commits intoJul 22, 2026
Merged
Conversation
Adds a PR comments panel to the Size Analysis settings tab, mirroring the existing status check rules panel. Users can toggle size PR comments on/off (default off) and configure rules by metric, measurement, threshold, artifact type, and search filter. Refs EME-939
Contributor
📊 Type Coverage Diff
🔍 4 new type safety issues introducedType assertions (
This is informational only and does not block the PR. |
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 3 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 717e0d0. Configure here.
…d PR comments The Status Checks and PR Comments size-analysis settings panels were near-verbatim clones, along with their backing hooks. Extract a single config-driven SizeRulesPanel plus a parameterized useSizeRules hook; StatusCheckRules and PrCommentRules become thin wrappers supplying option keys, copy, toasts, the enabled default, and analytics callbacks. Behavior for both panels is unchanged (same option keys, defaults, events, and toasts). The shared rule editor (StatusCheckRuleForm) previously hardcoded status-check copy, so the PR Comments panel showed 'Fail Status Check When' and a status-check delete confirmation. The form now takes optional copy props (defaulting to the status-check text), and the PR Comments panel supplies PR-appropriate wording and search source. Also adopt Grid over a hand-rolled styled grid and drop a one-off styled Button wrapper in the empty state, per frontend guidelines. Refs EME-939
Contributor
Author
|
fwiw, working comment here: EmergeTools/hackernews#830 (comment) |
jamieQ
approved these changes
Jul 21, 2026
| const enabled = | ||
| project.preprodSizeStatusChecksEnabled ?? project.options?.[ENABLED_KEY] !== false; | ||
| project[config.enabledField] ?? | ||
| (enabledOption === undefined ? config.defaultEnabled : enabledOption === true); |
Member
There was a problem hiding this comment.
Maybe worth a test or two to ensure we handle this fallback logic when the explicit field isn't present in the pr comments and status check rules components.
Add component tests for the useSizeRules enabled fallback when the explicit top-level field is absent: option-key true/false for PR comments, and default-on plus option-key override for status checks. statusCheckRules had no spec previously. Refs EME-939
mtopo27
deleted the
maxtopolsky/eme-939-add-settings-ux-for-size-analysis-pr-comment-rules
branch
July 22, 2026 00:25
priscilawebdev
pushed a commit
that referenced
this pull request
Jul 22, 2026
…20205) Adds a **PR Comments** panel to the Size Analysis settings tab (Project Settings → Mobile Builds → Size Analysis), gated behind the `preprod-size-analysis-pr-comments` feature flag. It mirrors the existing Status Checks panel: an enable toggle plus a list of rules, each configured by metric, measurement, threshold, artifact type, and search filter. The backend (already deployed) persists these to the `sentry:preprod_size_pr_comments_enabled` / `sentry:preprod_size_pr_comments_rules` project options. The rule form, rule item, and shared types are reused unchanged from the status-check panel — the only option-specific additions are the `usePrCommentRules` CRUD hook and the `PrCommentRules` panel wrapper. The one behavioral difference worth reviewer attention: size PR comments **default off**, whereas status checks default on. The hook reflects this by treating anything other than an explicit `true` as disabled (`project.preprodSizePrCommentsEnabled ?? options[...] === true`), rather than the status-check panel's default-true (`!== false`) logic. Refs EME-939
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Adds a PR Comments panel to the Size Analysis settings tab (Project Settings → Mobile Builds → Size Analysis), gated behind the
preprod-size-analysis-pr-commentsfeature flag. It mirrors the existing Status Checks panel: an enable toggle plus a list of rules, each configured by metric, measurement, threshold, artifact type, and search filter. The backend (already deployed) persists these to thesentry:preprod_size_pr_comments_enabled/sentry:preprod_size_pr_comments_rulesproject options.The rule form, rule item, and shared types are reused unchanged from the status-check panel — the only option-specific additions are the
usePrCommentRulesCRUD hook and thePrCommentRulespanel wrapper.The one behavioral difference worth reviewer attention: size PR comments default off, whereas status checks default on. The hook reflects this by treating anything other than an explicit
trueas disabled (project.preprodSizePrCommentsEnabled ?? options[...] === true), rather than the status-check panel's default-true (!== false) logic.Refs EME-939