Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/sentry/features/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
default_manager.add('organizations:gitlab-integration', OrganizationFeature) # NOQA
default_manager.add('organizations:jira-server-integration', OrganizationFeature) # NOQA
default_manager.add('organizations:large-debug-files', OrganizationFeature) # NOQA
default_manager.add('organizations:legacy-event-id', OrganizationFeature) # NOQA

# Project scoped features
default_manager.add('projects:similarity-view', ProjectFeature) # NOQA
Expand Down
8 changes: 7 additions & 1 deletion src/sentry/plugins/sentry_webhooks/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
from django.conf import settings
from django.utils.translation import ugettext_lazy as _

from sentry import features
from sentry.exceptions import PluginError
from sentry.models import Event
from sentry.plugins.bases import notify
from sentry.http import is_valid_url, safe_urlopen
from sentry.utils.safe import safe_execute
Expand Down Expand Up @@ -90,7 +92,11 @@ def get_group_data(self, group, event, triggering_rules):
data['event'] = dict(event.data or {})
data['event']['tags'] = event.get_tags()
data['event']['event_id'] = event.event_id
data['event']['id'] = event.id
if features.has('organizations:legacy-event-id', group.project.organization):
data['event']['id'] = Event.objects.filter(
project_id=event.project_id,
event_id=event.event_id,
).values_list('id', flat=True).get()
return data

def get_webhook_urls(self, project):
Expand Down
3 changes: 2 additions & 1 deletion tests/sentry/plugins/sentry_webhooks/test_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ def test_simple_notification(self):
notification = Notification(event=event, rule=rule)
self.project.update_option('webhooks:urls', 'http://example.com')

self.plugin.notify(notification)
with self.feature('organizations:legacy-event-id'):
self.plugin.notify(notification)

assert len(responses.calls) == 1

Expand Down