@@ -610,13 +610,13 @@ def test_does_not_process_sentry_apps_without_issue_webhooks(self, mock_record,
610
610
assert len (safe_urlopen .mock_calls ) == 0
611
611
assert_success_metric (mock_record )
612
612
613
- # APP_CREATE (success) -> GRANT_EXCHANGER (success) -> PREPARE_WEBHOOK (success)
613
+ # APP_CREATE (success) -> UPDATE_WEBHOOK (success) -> GRANT_EXCHANGER (success) -> PREPARE_WEBHOOK (success)
614
614
# Our SentryAppInstallation test fixture automatically runs GrantExchanger to get a valid token
615
615
assert_count_of_metric (
616
- mock_record = mock_record , outcome = EventLifecycleOutcome .STARTED , outcome_count = 3
616
+ mock_record = mock_record , outcome = EventLifecycleOutcome .STARTED , outcome_count = 4
617
617
)
618
618
assert_count_of_metric (
619
- mock_record = mock_record , outcome = EventLifecycleOutcome .SUCCESS , outcome_count = 3
619
+ mock_record = mock_record , outcome = EventLifecycleOutcome .SUCCESS , outcome_count = 4
620
620
)
621
621
622
622
@with_feature ("organizations:integrations-event-hooks" )
@@ -669,13 +669,13 @@ def test_error_created_sends_webhook(self, mock_record, safe_urlopen):
669
669
670
670
assert_success_metric (mock_record )
671
671
672
- # APP_CREATE (success) -> GRANT_EXCHANGER (success) -> PREPARE_WEBHOOK (success) ->
672
+ # APP_CREATE (success) -> UPDATE_WEBHOOK (success) -> GRANT_EXCHANGER (success) -> PREPARE_WEBHOOK (success) ->
673
673
# SEND_WEBHOOK (success) -> SEND_WEBHOOK (success) -> SEND_WEBHOOK (success)
674
674
assert_count_of_metric (
675
- mock_record = mock_record , outcome = EventLifecycleOutcome .STARTED , outcome_count = 6
675
+ mock_record = mock_record , outcome = EventLifecycleOutcome .STARTED , outcome_count = 7
676
676
)
677
677
assert_count_of_metric (
678
- mock_record = mock_record , outcome = EventLifecycleOutcome .SUCCESS , outcome_count = 6
678
+ mock_record = mock_record , outcome = EventLifecycleOutcome .SUCCESS , outcome_count = 7
679
679
)
680
680
681
681
@responses .activate
@@ -959,13 +959,13 @@ def test_record_lifecycle_error_from_pubished_apps(self, mock_record, safe_urlop
959
959
assert self .sentry_app_1 .webhook_url in call_urls
960
960
assert self .sentry_app_2 .webhook_url in call_urls
961
961
962
- # APP_CREATE (success) x 2 -> GRANT_EXCHANGER (success) x 2 -> PREPARE_WEBHOOK (success)
962
+ # APP_CREATE (success) x 2 -> UPDATE_WEBHOOK (success) x2 -> GRANT_EXCHANGER (success) x 2 -> PREPARE_WEBHOOK (success)
963
963
# -> SEND_WEBHOOK (success) x2 -> SEND_WEBHOOK (success) x2 -> SEND_WEBHOOK (halt) x2
964
964
assert_count_of_metric (
965
- mock_record = mock_record , outcome = EventLifecycleOutcome .STARTED , outcome_count = 11
965
+ mock_record = mock_record , outcome = EventLifecycleOutcome .STARTED , outcome_count = 13
966
966
)
967
967
assert_count_of_metric (
968
- mock_record = mock_record , outcome = EventLifecycleOutcome .SUCCESS , outcome_count = 9
968
+ mock_record = mock_record , outcome = EventLifecycleOutcome .SUCCESS , outcome_count = 11
969
969
)
970
970
assert_count_of_metric (
971
971
mock_record = mock_record , outcome = EventLifecycleOutcome .HALTED , outcome_count = 2
@@ -1030,13 +1030,13 @@ def test_sends_webhooks_to_all_installs_success(self, mock_record, safe_urlopen)
1030
1030
assert self .sentry_app_2 .webhook_url in call_urls
1031
1031
1032
1032
assert_success_metric (mock_record )
1033
- # APP_CREATE (success) x 2 -> GRANT_EXCHANGER (success) x 2 -> PREPARE_WEBHOOK (success)
1033
+ # APP_CREATE (success) x 2 -> UPDATE_WEBHOOK (success) x2 -> GRANT_EXCHANGER (success) x 2 -> PREPARE_WEBHOOK (success)
1034
1034
# -> SEND_WEBHOOK (success) x 2 -> SEND_WEBHOOK (success) x2 -> SEND_WEBHOOK (success) x2
1035
1035
assert_count_of_metric (
1036
- mock_record = mock_record , outcome = EventLifecycleOutcome .STARTED , outcome_count = 11
1036
+ mock_record = mock_record , outcome = EventLifecycleOutcome .STARTED , outcome_count = 13
1037
1037
)
1038
1038
assert_count_of_metric (
1039
- mock_record = mock_record , outcome = EventLifecycleOutcome .SUCCESS , outcome_count = 11
1039
+ mock_record = mock_record , outcome = EventLifecycleOutcome .SUCCESS , outcome_count = 13
1040
1040
)
1041
1041
1042
1042
@patch ("sentry.integrations.utils.metrics.EventLifecycle.record_event" )
@@ -1086,12 +1086,12 @@ def test_sends_webhooks_with_send_webhook_sentry_failure(self, mock_record):
1086
1086
assert_failure_metric (
1087
1087
mock_record , SentryAppSentryError (SentryAppWebhookFailureReason .EVENT_NOT_IN_SERVCEHOOK )
1088
1088
)
1089
- # APP_CREATE (success) -> GRANT_EXCHANGER (success) -> PREPARE_WEBHOOK (success) -> SEND_WEBHOOK (success) x 1 -> SEND_WEBHOOK (failure)
1089
+ # APP_CREATE (success) -> UPDATE_WEBHOOK (success) -> GRANT_EXCHANGER (success) -> PREPARE_WEBHOOK (success) -> SEND_WEBHOOK (success) x 1 -> SEND_WEBHOOK (failure)
1090
1090
assert_count_of_metric (
1091
- mock_record = mock_record , outcome = EventLifecycleOutcome .STARTED , outcome_count = 5
1091
+ mock_record = mock_record , outcome = EventLifecycleOutcome .STARTED , outcome_count = 6
1092
1092
)
1093
1093
assert_count_of_metric (
1094
- mock_record = mock_record , outcome = EventLifecycleOutcome .SUCCESS , outcome_count = 4
1094
+ mock_record = mock_record , outcome = EventLifecycleOutcome .SUCCESS , outcome_count = 5
1095
1095
)
1096
1096
assert_count_of_metric (
1097
1097
mock_record = mock_record , outcome = EventLifecycleOutcome .FAILURE , outcome_count = 1
@@ -1352,12 +1352,12 @@ def test_does_not_send_if_no_service_hook_exists(self, mock_record, safe_urlopen
1352
1352
assert_failure_metric (
1353
1353
mock_record , SentryAppSentryError (SentryAppWebhookFailureReason .MISSING_SERVICEHOOK )
1354
1354
)
1355
- # APP_CREATE (success) -> GRANT_EXCHANGER (success) -> PREPARE_WEBHOOK (success) -> send_webhook (error)
1355
+ # APP_CREATE (success) -> UPDATE_WEBHOOK (success) -> GRANT_EXCHANGER (success) -> PREPARE_WEBHOOK (success) -> send_webhook (error)
1356
1356
assert_count_of_metric (
1357
- mock_record = mock_record , outcome = EventLifecycleOutcome .STARTED , outcome_count = 4
1357
+ mock_record = mock_record , outcome = EventLifecycleOutcome .STARTED , outcome_count = 5
1358
1358
)
1359
1359
assert_count_of_metric (
1360
- mock_record = mock_record , outcome = EventLifecycleOutcome .SUCCESS , outcome_count = 3
1360
+ mock_record = mock_record , outcome = EventLifecycleOutcome .SUCCESS , outcome_count = 4
1361
1361
)
1362
1362
assert_count_of_metric (
1363
1363
mock_record = mock_record , outcome = EventLifecycleOutcome .FAILURE , outcome_count = 1
@@ -1380,12 +1380,12 @@ def test_does_not_send_if_event_not_in_app_events(self, mock_record, safe_urlope
1380
1380
assert_failure_metric (
1381
1381
mock_record , SentryAppSentryError (SentryAppWebhookFailureReason .EVENT_NOT_IN_SERVCEHOOK )
1382
1382
)
1383
- # APP_CREATE (success) -> GRANT_EXCHANGER (success) -> PREPARE_WEBHOOK (success) -> SEND_WEBHOOK (failure)
1383
+ # APP_CREATE (success) -> UPDATE_WEBHOOK (success) -> GRANT_EXCHANGER (success) -> PREPARE_WEBHOOK (success) -> SEND_WEBHOOK (failure)
1384
1384
assert_count_of_metric (
1385
- mock_record = mock_record , outcome = EventLifecycleOutcome .STARTED , outcome_count = 4
1385
+ mock_record = mock_record , outcome = EventLifecycleOutcome .STARTED , outcome_count = 5
1386
1386
)
1387
1387
assert_count_of_metric (
1388
- mock_record = mock_record , outcome = EventLifecycleOutcome .SUCCESS , outcome_count = 3
1388
+ mock_record = mock_record , outcome = EventLifecycleOutcome .SUCCESS , outcome_count = 4
1389
1389
)
1390
1390
assert_count_of_metric (
1391
1391
mock_record = mock_record , outcome = EventLifecycleOutcome .FAILURE , outcome_count = 1
0 commit comments