Skip to content

Conversation

@nikkikapadia
Copy link
Member

was getting scope bleed for the trigger action counts so adding in the isolation scope

@nikkikapadia nikkikapadia marked this pull request as ready for review November 21, 2025 15:47
@nikkikapadia nikkikapadia requested a review from a team as a code owner November 21, 2025 15:47
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Nov 21, 2025
scope.set_tag("false_positive_misfires", false_positive_misfire)
scope.set_tag("false_negative_misfires", false_negative_misfire)
for trigger_action_type, count in trigger_action_types.items():
scope.set_tag(f"trigger_action_type.{trigger_action_type}", count)
Copy link
Contributor

Choose a reason for hiding this comment

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

Bug: Misfire tags captured in scope with no event

The isolation scope at lines 330-334 sets misfire and trigger action tags but doesn't capture any event within that scope. The tags exit the scope without being associated with any Sentry event, making them ineffective. These tags should either be moved into the isolation scope where capture_message is called at line 352, or capture_message should be called within this scope.

Fix in Cursor Fix in Web

@codecov
Copy link

codecov bot commented Nov 21, 2025

❌ 2 Tests Failed:

Tests completed Failed Passed Skipped
29947 2 29945 245
View the top 2 failed test(s) by shortest run time
tests.sentry.discover.test_compare_timeseries.CompareAlertsTimeseriesTestCase::test_false_negative_misfires
Stack Traces | 4.7s run time
#x1B[1m#x1B[.../sentry/discover/test_compare_timeseries.py#x1B[0m:214: in test_false_negative_misfires
    mock_set_tag.assert_any_call("false_positive_misfires", 0)
#x1B[1m#x1B[.../hostedtoolcache/Python/3.13.1.../x64/lib/python3.13/unittest/mock.py#x1B[0m:1048: in assert_any_call
    raise AssertionError(
#x1B[1m#x1B[31mE   AssertionError: set_tag('false_positive_misfires', 0) call not found#x1B[0m
tests.sentry.discover.test_compare_timeseries.CompareAlertsTimeseriesTestCase::test_false_positive_misfires
Stack Traces | 6.57s run time
#x1B[1m#x1B[.../sentry/discover/test_compare_timeseries.py#x1B[0m:195: in test_false_positive_misfires
    mock_set_tag.assert_any_call("false_positive_misfires", 1)
#x1B[1m#x1B[.../hostedtoolcache/Python/3.13.1.../x64/lib/python3.13/unittest/mock.py#x1B[0m:1048: in assert_any_call
    raise AssertionError(
#x1B[1m#x1B[31mE   AssertionError: set_tag('false_positive_misfires', 1) call not found#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.

@nikkikapadia nikkikapadia merged commit 1a1274f into master Nov 21, 2025
67 checks passed
@nikkikapadia nikkikapadia deleted the nikki/isolate-tags-alerts-comparison branch November 21, 2025 16:44
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.

3 participants