Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

example(platform): Fake notification registration #86262

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

GabeVillalobos
Copy link
Member

WIP:
Adds a new, basic implementation of a Logging integration provider.

This also adds notification registrations for our 4 different types of notifications:

  1. Issue Alerts
  2. Metric Alerts
  3. Digest Notifications (coming soon)
  4. Spike Protection (coming soon)

@github-actions github-actions bot added Scope: Frontend Automatically applied to PRs that change frontend components Scope: Backend Automatically applied to PRs that change backend components labels Mar 4, 2025
Copy link
Contributor

github-actions bot commented Mar 4, 2025

🚨 Warning: This pull request contains Frontend and Backend changes!

It's discouraged to make changes to Sentry's Frontend and Backend in a single pull request. The Frontend and Backend are not atomically deployed. If the changes are interdependent of each other, they must be separated into two pull requests and be made forward or backwards compatible, such that the Backend or Frontend can be safely deployed independently.

Have questions? Please ask in the #discuss-dev-infra channel.

Comment on lines +10 to +17
@register_notification_provider(ExternalProviders.FAKE_LOG)
def send_fake_log_alert_notification(
notification: BaseNotification,
recipients: Iterable[Actor],
shared_context: Mapping[str, Any],
extra_context_by_actor: Mapping[Actor, Mapping[str, Any]] | None,
):
pass
Copy link
Member Author

Choose a reason for hiding this comment

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

Redundant

Copy link

codecov bot commented Mar 4, 2025

❌ 14 Tests Failed:

Tests completed Failed Passed Skipped
33436 14 33422 294
View the top 3 failed test(s) by shortest run time
tests.sentry.incidents.endpoints.test_organization_alert_rule_available_action_index.OrganizationAlertRuleAvailableActionIndexEndpointTest::test_simple
Stack Traces | 1.48s run time
#x1B[1m#x1B[.../incidents/endpoints/test_organization_alert_rule_available_action_index.py#x1B[0m:164: in test_simple
    assert len(response.data) == 2
#x1B[1m#x1B[31mE   assert 3 == 2#x1B[0m
#x1B[1m#x1B[31mE    +  where 3 = len([{'allowedTargetTypes': ['user', 'team'], 'type': 'email'}, {'allowedTargetTypes': ['specific'], 'type': 'fake_log'}, {'allowedTargetTypes': ['specific'], 'integrationId': 45, 'integrationName': '', 'type': 'slack'}])#x1B[0m
#x1B[1m#x1B[31mE    +    where [{'allowedTargetTypes': ['user', 'team'], 'type': 'email'}, {'allowedTargetTypes': ['specific'], 'type': 'fake_log'}, {'allowedTargetTypes': ['specific'], 'integrationId': 45, 'integrationName': '', 'type': 'slack'}] = <Response status_code=200, "application/json">.data#x1B[0m
tests.sentry.incidents.endpoints.test_organization_alert_rule_available_action_index.OrganizationAlertRuleAvailableActionIndexEndpointTest::test_no_integrations
Stack Traces | 1.5s run time
#x1B[1m#x1B[.../incidents/endpoints/test_organization_alert_rule_available_action_index.py#x1B[0m:154: in test_no_integrations
    assert response.data == [build_action_response(self.email)]
#x1B[1m#x1B[31mE   AssertionError: assert [{'allowedTar...: 'fake_log'}] == [{'allowedTar...pe': 'email'}]#x1B[0m
#x1B[1m#x1B[31mE     #x1B[0m
#x1B[1m#x1B[31mE     Left contains one more item: {'allowedTargetTypes': ['specific'], 'type': 'fake_log'}#x1B[0m
#x1B[1m#x1B[31mE     #x1B[0m
#x1B[1m#x1B[31mE     Full diff:#x1B[0m
#x1B[1m#x1B[31mE       [#x1B[0m
#x1B[1m#x1B[31mE           {#x1B[0m
#x1B[1m#x1B[31mE               'allowedTargetTypes': [#x1B[0m
#x1B[1m#x1B[31mE                   'user',#x1B[0m
#x1B[1m#x1B[31mE                   'team',#x1B[0m
#x1B[1m#x1B[31mE               ],#x1B[0m
#x1B[1m#x1B[31mE               'type': 'email',#x1B[0m
#x1B[1m#x1B[31mE           },#x1B[0m
#x1B[1m#x1B[31mE     +     {#x1B[0m
#x1B[1m#x1B[31mE     +         'allowedTargetTypes': [#x1B[0m
#x1B[1m#x1B[31mE     +             'specific',#x1B[0m
#x1B[1m#x1B[31mE     +         ],#x1B[0m
#x1B[1m#x1B[31mE     +         'type': 'fake_log',#x1B[0m
#x1B[1m#x1B[31mE     +     },#x1B[0m
#x1B[1m#x1B[31mE       ]#x1B[0m
tests.sentry.incidents.endpoints.test_organization_alert_rule_available_action_index.OrganizationAlertRuleAvailableActionIndexEndpointTest::test_org_integration_disabled
Stack Traces | 1.66s run time
#x1B[1m#x1B[.../incidents/endpoints/test_organization_alert_rule_available_action_index.py#x1B[0m:279: in test_org_integration_disabled
    assert len(response.data) == 1
#x1B[1m#x1B[31mE   assert 2 == 1#x1B[0m
#x1B[1m#x1B[31mE    +  where 2 = len([{'allowedTargetTypes': ['user', 'team'], 'type': 'email'}, {'allowedTargetTypes': ['specific'], 'type': 'fake_log'}])#x1B[0m
#x1B[1m#x1B[31mE    +    where [{'allowedTargetTypes': ['user', 'team'], 'type': 'email'}, {'allowedTargetTypes': ['specific'], 'type': 'fake_log'}] = <Response status_code=200, "application/json">.data#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 Scope: Frontend Automatically applied to PRs that change frontend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant