Skip to content

Conversation

nora-shap
Copy link
Member

Summary

Removes the legacy release-based fallback logic from the event file committers endpoint, simplifying it to use only GroupOwner-based suspect commit detection.

There are currently 2 suspect commit assessment strategies, both create a GroupOwner for the Group if they find a good suspect commit. These changes mean that only GroupOwners created during original analysis will be retuned for the Issue.

While my intention has been to create fewer but better suspect commits, with the logic in this function it meant I was actually displaying a lot more legacy strategy suspect commits, which is not what I want.

Changes Made

Core Logic Changes

  • Removed legacy fallback: get_serialized_event_file_committers now only calls _get_serialized_committers_from_group_owners
  • Dynamic suspect commit type: Uses suspectCommitStrategy from GroupOwner context instead of hardcoding INTEGRATION_COMMIT
    • RELEASE_BASED"via commit in release"
    • SCM_BASED"via SCM integration"
  • Preserved API contract: Still returns 404 when no committers found (not empty array)

Behavior Changes

Before

# 1. Check GroupOwners first
# 2. If no GroupOwners, fall back to release-based analysis (legacy logic)
# 3. Analyze stacktrace frames against recent release commits  
# 4. Always returned "via SCM integration" regardless of actual strategy

After

# 1. Check GroupOwners only - all suspect commit strategies create GroupOwners when the Issue is first processed
# 2. If no GroupOwners, return 404 "No committers found"
# 3. Use actual commit strategy from GroupOwner context
# 4. Only 1 suspect commit can be returned

@nora-shap nora-shap requested a review from a team August 29, 2025 00:29
@nora-shap nora-shap requested a review from a team as a code owner August 29, 2025 00:29
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Aug 29, 2025
Copy link

codecov bot commented Aug 29, 2025

❌ 2 Tests Failed:

Tests completed Failed Passed Skipped
27503 2 27501 596
View the top 2 failed test(s) by shortest run time
tests.sentry.tasks.test_groupowner.TestGroupOwners::test_no_matching_user
Stack Traces | 3.77s run time
#x1B[1m#x1B[.../sentry/tasks/test_groupowner.py#x1B[0m:137: in test_no_matching_user
    assert len(result) == 1
#x1B[1m#x1B[31mE   assert 0 == 1#x1B[0m
#x1B[1m#x1B[31mE    +  where 0 = len([])#x1B[0m
tests.sentry.mail.test_adapter.MailAdapterNotifyTest::test_notify_with_suspect_commits
Stack Traces | 7.46s run time
#x1B[1m#x1B[.../sentry/mail/test_adapter.py#x1B[0m:868: in test_notify_with_suspect_commits
    assert "Suspect Commits" in msg.body
#x1B[1m#x1B[31mE   assert 'Suspect Commits' in 'Details\n-------\n\nhttp:.../baz/issues/161/?notification_uuid=59753b71-cd14-4509-ad33-17ce1f7... File "sentry/models/release.py", line 39, in set_commits\n\n\nMessage\n-----------\n\nKaboom!\n\n\n\n\nUnsubscribe:\n'#x1B[0m
#x1B[1m#x1B[31mE    +  where 'Details\n-------\n\nhttp:.../baz/issues/161/?notification_uuid=59753b71-cd14-4509-ad33-17ce1f7... File "sentry/models/release.py", line 39, in set_commits\n\n\nMessage\n-----------\n\nKaboom!\n\n\n\n\nUnsubscribe:\n' = <django.core.mail.message.EmailMultiAlternatives object at 0x7f3d7d3b92e0>.body#x1B[0m

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scope: Backend Automatically applied to PRs that change backend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant