Conversation
…on issues Extract filter logic from kick_off_seer_automation into two helper functions that return skip reasons. This enables a single metrics.incr and logger.info call per filtered issue, giving visibility into why issues are being skipped (e.g. fixability too low, issue too old, no connected repos, already triggered). Refs AIML-2686 Co-Authored-By: Claude <noreply@anthropic.com>
Replace bare str return type with a SeerAutomationSkipReason Literal union for type safety on skip reason values. Refs AIML-2686 Co-Authored-By: Claude <noreply@anthropic.com>
Move SeerAutomationSkipReason, get_default_seer_automation_skip_reason, and get_seat_based_seer_automation_skip_reason into a new src/sentry/seer/autofix/trigger.py file. This makes the trigger decision logic self-contained and easier to follow. Refs AIML-2686 Co-Authored-By: Claude <noreply@anthropic.com>
Move lazy imports to top-level in trigger.py since there are no circular dependency concerns. Pass the locks manager from post_process.py rather than recreating it. Refs AIML-2686 Co-Authored-By: Claude <noreply@anthropic.com>
Restore original comments in trigger.py and post_process.py. Use `if skip_reason is not None` instead of `if skip_reason` for clarity. Refs AIML-2686 Co-Authored-By: Claude <noreply@anthropic.com>
Revert to lazy imports in trigger.py to match original post_process.py behavior and avoid mock patching issues. Move the >= 10 no-summary rate limit check back to kick_off_seer_automation to avoid a TOCTOU race from reading the cache twice. Refs AIML-2686 Co-Authored-By: Claude <noreply@anthropic.com>
…NCE_THRESHOLD Co-Authored-By: Claude <noreply@anthropic.com>
Add get_seer_automation_ineligibility_reason() which returns specific reasons like not_eligible.issue_category_ineligible, not_eligible.no_budget, etc. instead of a generic not_eligible. Move eligibility functions from utils.py to trigger.py to consolidate trigger decision logic. Refs AIML-2686 Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
…AutomationIneligibilityReason Removes duplication between the two Literal types by composing SeerAutomationSkipReason as a Union of its own literals and SeerAutomationIneligibilityReason. Refs AIML-2686 Co-Authored-By: Claude <noreply@anthropic.com>
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.
Builds on #111486 (already merged) which added initial
seer.automation.filteredmetrics and extracted filter logic intosrc/sentry/seer/autofix/trigger.py.This PR adds two improvements:
1. Breaks down
not_eligibleinto specific sub-reasonsThe generic
not_eligibleskip reason is now 5 specific reasons:not_eligible.issue_category_ineligiblenot_eligible.gen_ai_feature_disablednot_eligible.ai_features_hiddennot_eligible.scanner_not_enablednot_eligible.no_budgetMoves
is_issue_eligible_for_seer_automationand a newget_seer_automation_ineligibility_reasonfromutils.pyintotrigger.pyto consolidate trigger decision logic.2. Tracks
below_occurrence_thresholdas a skip reasonIssues with
times_seen_with_pending < AUTOFIX_AUTOMATION_OCCURRENCE_THRESHOLDare now tracked as filtered from full automation. Summary generation (generate_issue_summary_only) still fires for these issues.Refs AIML-2686