Repository navigation
feat(preprod): Tie approvals to the result they approved - #133319
Open
sentry-junior[bot] wants to merge 4 commits into
Open
sentry-junior[bot] wants to merge 4 commits into
sentry-junior[bot] wants to merge 4 commits into
Conversation
Each new approval saves the snapshot comparison or size analysis it covers, and only counts while that result is unchanged. Refs EME-1371 Co-Authored-By: Nico Hinderling <9902528+NicoHinderling@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
decision-model-linterapi
decision-model-linter: 44 calls on 9 files, 113,359 input tokens, $0.0048, model typesafe/jev-1.13-20260917 |
Sentry's build and snapshot pages counted any approval, so after the result changed they still showed it as approved and hid the Approve action. Size approvals also reset whenever the base changed, even when no rule compares against the base. Auto-approval now reads the sibling's newest comparison, the same one the status check uses. Refs EME-1371
NicoHinderling
marked this pull request as ready for review
December 2, 2026 23:48
| from sentry.models.commitcomparison import CommitComparison | ||
| from sentry.models.project import Project | ||
| from sentry.preprod.analytics import PreprodStatusCheckTriggeredRulePostedEvent | ||
| from sentry.preprod.approvals import approval_matches, size_approval_result |
Contributor
There was a problem hiding this comment.
Size approval matching uses caller rules, so PR comments drop valid approvals
Approvals store size_approval_result with status-check rules, but evaluate_size_and_format_messages rebuilds the result with the caller-supplied rules. PR comments pass preprod_size_pr_comments_rules, so a differing diff-rule config makes base_size_analysis disagree and a still-valid size approval is ignored.
Evidence
get_approval_result()always callssize_approval_result(..., get_status_check_rules(artifact.project)), so savedbase_size_analysisdepends only on status-check rules (absolute_diff/relative_diff).- The new matching path in
evaluate_size_and_format_messagescallssize_approval_result(..., rules)with whatever list the caller passed, thenapproval_matchesrequires exact equality. create_preprod_size_pr_comment_taskloads rules viaoption_key=sentry:preprod_size_pr_comments_rules, which is independent of status-check rules.- If only one of those rule sets has a diff measurement, one side gets
base_size_analysis: Noneand the other a metric list; matching fails and the approval is omitted fromapprovals_map, so PR comments still treat the build as action-required.
Identified by Warden · code-review · ZPZ-N8K
…pprovals Build details now look up the size approval result only for builds that have a size approval, so list endpoints no longer run extra queries per build. Size approval matching always uses the status-check rules, so the PR comment's own rule set can't make a valid approval look stale.
This branch has not been deployed
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.
An approval used to cover the whole build, so a result that changed after approval (a late snapshot base, a rerun or a size base that completes) still passed, and could seed auto-approval. Each new approval now saves the result it covers in
extras. It counts only while that result matches, in the status checks,get_size_status, auto-approval, the "Already approved" checks and the build and snapshot pages. For size, the base is part of the result only when a diff rule is configured. Approvals made before this change keep counting. Refs EME-1371