Skip to content

feat(preprod): Hook size analysis detector to diff#108209

Merged
chromy merged 1 commit intomasterfrom
chromy/2026-03-12-hook-detector-to-diff-task
Feb 23, 2026
Merged

feat(preprod): Hook size analysis detector to diff#108209
chromy merged 1 commit intomasterfrom
chromy/2026-03-12-hook-detector-to-diff-task

Conversation

@chromy
Copy link
Contributor

@chromy chromy commented Feb 13, 2026

Replace direct Kafka occurrence production with the workflow engine's
DataPacket pipeline. maybe_emit_issues() now looks up
SizeAnalysisSubscriptions for the project and feeds size deltas into
process_data_packet(), which resolves linked detectors and evaluates
them instead of using a hardcoded threshold.

PRs:

Design doc

@chromy chromy requested review from a team as code owners February 13, 2026 11:33
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Feb 13, 2026
@github-actions
Copy link
Contributor

This PR has a migration; here is the generated SQL for src/sentry/preprod/migrations/0027_size_analysis_subscription.py

for 0027_size_analysis_subscription in preprod

--
-- Create model SizeAnalysisSubscription
--
CREATE TABLE "sentry_sizeanalysissubscription" ("id" bigint NOT NULL PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY, "date_updated" timestamp with time zone NOT NULL, "date_added" timestamp with time zone NOT NULL, "project_id" bigint NOT NULL);
ALTER TABLE "sentry_sizeanalysissubscription" ADD CONSTRAINT "sentry_sizeanalysiss_project_id_41e3355e_fk_sentry_pr" FOREIGN KEY ("project_id") REFERENCES "sentry_project" ("id") DEFERRABLE INITIALLY DEFERRED NOT VALID;
ALTER TABLE "sentry_sizeanalysissubscription" VALIDATE CONSTRAINT "sentry_sizeanalysiss_project_id_41e3355e_fk_sentry_pr";
CREATE INDEX CONCURRENTLY "sentry_sizeanalysissubscription_project_id_41e3355e" ON "sentry_sizeanalysissubscription" ("project_id");

@chromy chromy marked this pull request as draft February 13, 2026 11:45
@chromy chromy changed the base branch from master to chromy/2026-03-12-add-grouptype February 13, 2026 11:46
Copy link
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

@chromy chromy force-pushed the chromy/2026-03-12-add-grouptype branch from a50e1e0 to 5317fb3 Compare February 13, 2026 12:04
@chromy chromy force-pushed the chromy/2026-03-12-add-grouptype branch from 5317fb3 to affc2c2 Compare February 16, 2026 14:26
@chromy chromy force-pushed the chromy/2026-03-12-hook-detector-to-diff-task branch from cb6d43f to 7b2967d Compare February 16, 2026 14:42
@chromy chromy force-pushed the chromy/2026-03-12-add-grouptype branch from affc2c2 to 258f072 Compare February 16, 2026 18:34
@chromy chromy force-pushed the chromy/2026-03-12-hook-detector-to-diff-task branch from 7b2967d to f5ae972 Compare February 16, 2026 18:35
@chromy chromy force-pushed the chromy/2026-03-12-add-grouptype branch from 258f072 to 92722b1 Compare February 20, 2026 14:10
chromy added a commit that referenced this pull request Feb 20, 2026
Add PreprodSizeAnalysisGroupType (type_id=11003) with detector handler
and validators that integrate with the workflow engine to emit issues
when build size thresholds are exceeded.

- PreprodSizeAnalysisDetectorHandler: evaluates DataPackets from size
  comparisons and produces IssueOccurrences
- PreprodSizeAnalysisDetectorValidato validate detector creation via the
API
- Register the GroupType import in preprod/grouptype.py

PRs:
- #108208 Add size_analysis detector (this PR)
- #108209 Hook size analysis detector to diff
- #108210 Add new issue type to frontend
- #108211 Add size monitor UI

[Design
doc](https://www.notion.so/sentry/Size-Monitors-3068b10e4b5d805ca57de084d1b4eba6)

This stack of PRs is missing a handful of important features:
- Filters
- Detailed data on the occurrence
- Some UI polish

but it works end to end.
Base automatically changed from chromy/2026-03-12-add-grouptype to master February 20, 2026 14:48
@chromy chromy force-pushed the chromy/2026-03-12-hook-detector-to-diff-task branch from f5ae972 to c1d2a73 Compare February 20, 2026 14:53
@chromy chromy force-pushed the chromy/2026-03-12-hook-detector-to-diff-task branch from c1d2a73 to 2c73f84 Compare February 20, 2026 15:32
@chromy chromy force-pushed the chromy/2026-03-12-hook-detector-to-diff-task branch from 2c73f84 to 00f3d9a Compare February 20, 2026 15:40
@chromy chromy marked this pull request as ready for review February 20, 2026 15:44
chromy added a commit that referenced this pull request Feb 23, 2026
Add PREPROD_SIZE_ANALYSIS to the IssueType enum, IssueTitle mapping,
  and occurrence type lookup (type_id 11003) so the frontend can
  recognize and label Size Analysis issues.

PRs:
- #108208 Add size_analysis detector
- #108209 Hook size analysis detector to diff
- #108210 Add new issue type to frontend (this PR)
- #108211 Add size monitor UI

The old issue types will later be deprecated:
```
  11001: IssueType.PREPROD_STATIC,
  11002: IssueType.PREPROD_DELTA,
```

[Design
doc](https://www.notion.so/sentry/Size-Monitors-3068b10e4b5d805ca57de084d1b4eba6)
Copy link
Contributor

@runningcode runningcode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This simplifies this quite a bit! So many removed tests.

@chromy chromy merged commit dc87bfc into master Feb 23, 2026
77 checks passed
@chromy chromy deleted the chromy/2026-03-12-hook-detector-to-diff-task branch February 23, 2026 10:37
priscilawebdev pushed a commit that referenced this pull request Feb 24, 2026
Add PreprodSizeAnalysisGroupType (type_id=11003) with detector handler
and validators that integrate with the workflow engine to emit issues
when build size thresholds are exceeded.

- PreprodSizeAnalysisDetectorHandler: evaluates DataPackets from size
  comparisons and produces IssueOccurrences
- PreprodSizeAnalysisDetectorValidato validate detector creation via the
API
- Register the GroupType import in preprod/grouptype.py

PRs:
- #108208 Add size_analysis detector (this PR)
- #108209 Hook size analysis detector to diff
- #108210 Add new issue type to frontend
- #108211 Add size monitor UI

[Design
doc](https://www.notion.so/sentry/Size-Monitors-3068b10e4b5d805ca57de084d1b4eba6)

This stack of PRs is missing a handful of important features:
- Filters
- Detailed data on the occurrence
- Some UI polish

but it works end to end.
priscilawebdev pushed a commit that referenced this pull request Feb 24, 2026
Add PREPROD_SIZE_ANALYSIS to the IssueType enum, IssueTitle mapping,
  and occurrence type lookup (type_id 11003) so the frontend can
  recognize and label Size Analysis issues.

PRs:
- #108208 Add size_analysis detector
- #108209 Hook size analysis detector to diff
- #108210 Add new issue type to frontend (this PR)
- #108211 Add size monitor UI

The old issue types will later be deprecated:
```
  11001: IssueType.PREPROD_STATIC,
  11002: IssueType.PREPROD_DELTA,
```

[Design
doc](https://www.notion.so/sentry/Size-Monitors-3068b10e4b5d805ca57de084d1b4eba6)
mchen-sentry pushed a commit that referenced this pull request Feb 24, 2026
Add PreprodSizeAnalysisGroupType (type_id=11003) with detector handler
and validators that integrate with the workflow engine to emit issues
when build size thresholds are exceeded.

- PreprodSizeAnalysisDetectorHandler: evaluates DataPackets from size
  comparisons and produces IssueOccurrences
- PreprodSizeAnalysisDetectorValidato validate detector creation via the
API
- Register the GroupType import in preprod/grouptype.py

PRs:
- #108208 Add size_analysis detector (this PR)
- #108209 Hook size analysis detector to diff
- #108210 Add new issue type to frontend
- #108211 Add size monitor UI

[Design
doc](https://www.notion.so/sentry/Size-Monitors-3068b10e4b5d805ca57de084d1b4eba6)

This stack of PRs is missing a handful of important features:
- Filters
- Detailed data on the occurrence
- Some UI polish

but it works end to end.
mchen-sentry pushed a commit that referenced this pull request Feb 24, 2026
Add PREPROD_SIZE_ANALYSIS to the IssueType enum, IssueTitle mapping,
  and occurrence type lookup (type_id 11003) so the frontend can
  recognize and label Size Analysis issues.

PRs:
- #108208 Add size_analysis detector
- #108209 Hook size analysis detector to diff
- #108210 Add new issue type to frontend (this PR)
- #108211 Add size monitor UI

The old issue types will later be deprecated:
```
  11001: IssueType.PREPROD_STATIC,
  11002: IssueType.PREPROD_DELTA,
```

[Design
doc](https://www.notion.so/sentry/Size-Monitors-3068b10e4b5d805ca57de084d1b4eba6)
mchen-sentry pushed a commit that referenced this pull request Feb 24, 2026
Replace direct Kafka occurrence production with the workflow engine's
DataPacket pipeline. maybe_emit_issues() now looks up
SizeAnalysisSubscriptions for the project and feeds size deltas into
process_data_packet(), which resolves linked detectors and evaluates
them instead of using a hardcoded threshold.

PRs:
- #108208 Add size_analysis detector
- #108209 Hook size analysis detector to diff (this PR)
- #108210 Add new issue type to frontend
- #108211 Add size monitor UI

[Design
doc](https://www.notion.so/sentry/Size-Monitors-3068b10e4b5d805ca57de084d1b4eba6)
chromy added a commit that referenced this pull request Feb 26, 2026
Add list, detail, and create/edit views for the preprod_size_analysis
detector type ("Mobile Builds"). Users can configure a metric
(install/download size), measurement (absolute/diff/relative), optional
build filters, and priority thresholds. Includes a live preview section,
detector type selection form, and routes at /detectors/mobile-builds/.

PRs:
- #108208 Add size_analysis detector
- #108209 Hook size analysis detector to diff
- #108210 Add new issue type to frontend
- #108211 Add size monitor UI (this PR)

[Design
doc](https://www.notion.so/sentry/Size-Monitors-3068b10e4b5d805ca57de084d1b4eba6)
@github-actions github-actions bot locked and limited conversation to collaborators Mar 10, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants