Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 0 additions & 2 deletions .github/codeowners-coverage-baseline.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2196,8 +2196,6 @@ tests/sentry/plugins/interfaces/__init__.py
tests/sentry/plugins/interfaces/test_releasehook.py
tests/sentry/plugins/sentry_useragents/__init__.py
tests/sentry/plugins/sentry_useragents/test_models.py
tests/sentry/plugins/sentry_webhooks/__init__.py
tests/sentry/plugins/sentry_webhooks/test_plugin.py
tests/sentry/plugins/test_config.py
tests/sentry/plugins/test_helpers.py
tests/sentry/plugins/test_integration_repository.py
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -1225,7 +1225,6 @@ module = [
"sentry.plugins.sentry_interface_types.*",
"sentry.plugins.sentry_urls.*",
"sentry.plugins.sentry_useragents.*",
"sentry.plugins.sentry_webhooks.*",
"sentry.plugins.utils",
"sentry.processing.*",
"sentry.processing_errors.*",
Expand Down
1 change: 0 additions & 1 deletion src/sentry/conf/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,6 @@ def env(
"sentry.plugins.sentry_interface_types.apps.Config",
"sentry.plugins.sentry_urls.apps.Config",
"sentry.plugins.sentry_useragents.apps.Config",
"sentry.plugins.sentry_webhooks.apps.Config",
"social_auth",
"sudo",
"sentry.eventstream",
Expand Down
1 change: 0 additions & 1 deletion src/sentry/plugins/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"jira",
"pagerduty",
"opsgenie",
"webhooks",
"amazon-sqs",
"asana",
"trello",
Expand Down
Empty file.
12 changes: 0 additions & 12 deletions src/sentry/plugins/sentry_webhooks/apps.py

This file was deleted.

22 changes: 0 additions & 22 deletions src/sentry/plugins/sentry_webhooks/client.py

This file was deleted.

152 changes: 0 additions & 152 deletions src/sentry/plugins/sentry_webhooks/plugin.py

This file was deleted.

7 changes: 0 additions & 7 deletions src/sentry/rules/actions/notify_event.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from collections.abc import Generator, Sequence

from sentry import features
from sentry.plugins.base import plugins
from sentry.rules.actions.base import EventAction
from sentry.rules.actions.services import LegacyPluginService
Expand All @@ -20,16 +19,10 @@ class NotifyEventAction(EventAction):
def get_plugins(self) -> Sequence[LegacyPluginService]:
from sentry.plugins.bases.notify import NotificationPlugin

skip_webhooks = features.has(
"organizations:legacy-webhook-disable-old-path", self.project.organization
)

results = []
for plugin in plugins.for_project(self.project, version=1):
if not isinstance(plugin, NotificationPlugin):
continue
if skip_webhooks and plugin.slug == "webhooks":
continue
results.append(LegacyPluginService(plugin))

return results
Expand Down
17 changes: 17 additions & 0 deletions src/sentry/workflow_engine/processors/action.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from sentry.integrations.services.integration import RpcIntegration, integration_service
from sentry.integrations.types import IntegrationProviderSlug
from sentry.models.group import Group
from sentry.models.options.project_option import ProjectOption
from sentry.models.organization import Organization
from sentry.models.project import Project
from sentry.plugins.base import plugins
Expand Down Expand Up @@ -344,6 +345,13 @@
)


class _LegacyWebhookStub:
slug = "webhooks"

def get_title(self) -> str:
return "WebHooks"


def get_notification_plugins_for_org(organization: Organization) -> list[PluginService]:
"""
Get all plugins for an organization.
Expand All @@ -362,6 +370,15 @@

plugin_map[plugin.slug] = PluginService(plugin)

if "webhooks" not in plugin_map:
has_webhooks = ProjectOption.objects.filter(
project__organization_id=organization.id,
key="webhooks:enabled",
value=True,
).exists()

Check warning on line 378 in src/sentry/workflow_engine/processors/action.py

View check run for this annotation

@sentry/warden / warden: sentry-backend-bugs

Webhook stub added for orgs with only soft-deleted projects that have webhooks enabled

The `ProjectOption` filter at line 373 is missing `project__status=ObjectStatus.ACTIVE`, so a soft-deleted project with `webhooks:enabled=True` will cause the stub to appear as an available action for the org even though no active project has webhooks configured.
Comment thread
sentry-warden[bot] marked this conversation as resolved.
Outdated
if has_webhooks:
plugin_map["webhooks"] = PluginService(_LegacyWebhookStub())

return list(plugin_map.values())


Expand Down
Empty file.
102 changes: 0 additions & 102 deletions tests/sentry/plugins/sentry_webhooks/test_plugin.py

This file was deleted.

Loading
Loading