Browse Source

ref: remove freight (#49337)

Joshua Li 1 year ago
parent
commit
d2102d3340

+ 0 - 2
setup.cfg

@@ -44,7 +44,6 @@ sentry.apps =
     auth_onelogin = sentry.auth.providers.saml2.onelogin
     auth_rippling = sentry.auth.providers.saml2.rippling
     auth_saml2 = sentry.auth.providers.saml2.generic
-    freight = sentry_plugins.freight
     jira = sentry_plugins.jira
     opsgenie = sentry_plugins.opsgenie
     redmine = sentry_plugins.redmine
@@ -55,7 +54,6 @@ sentry.plugins =
     amazon_sqs = sentry_plugins.amazon_sqs.plugin:AmazonSQSPlugin
     asana = sentry_plugins.asana.plugin:AsanaPlugin
     bitbucket = sentry_plugins.bitbucket.plugin:BitbucketPlugin
-    freight = sentry_plugins.freight.plugin:FreightPlugin
     github = sentry_plugins.github.plugin:GitHubPlugin
     gitlab = sentry_plugins.gitlab.plugin:GitLabPlugin
     heroku = sentry_plugins.heroku.plugin:HerokuPlugin

+ 0 - 0
src/sentry_plugins/freight/__init__.py


+ 0 - 45
src/sentry_plugins/freight/plugin.py

@@ -1,45 +0,0 @@
-from rest_framework.request import Request
-from rest_framework.response import Response
-
-import sentry
-from sentry.plugins.bases import ReleaseTrackingPlugin
-from sentry.plugins.interfaces.releasehook import ReleaseHook
-from sentry.utils import json
-
-DOC_HTML = """
-<p>Configure a Freight notification with the given webhook url.</p>
-<pre class="clippy">{{
-    "type": "sentry",
-    "config": {{"webhook_url": "{hook_url}"}}
-}}</pre>
-"""
-
-
-class FreightReleaseHook(ReleaseHook):
-    def handle(self, request: Request) -> Response:
-        data = json.loads(request.body)
-        if data["event"] == "started":
-            self.start_release(version=data["sha"], ref=data["ref"], url=data["link"])
-        elif data["event"] == "finished":
-            self.finish_release(version=data["sha"], ref=data["ref"], url=data["link"])
-        else:
-            raise ValueError(data["event"])
-
-
-class FreightPlugin(ReleaseTrackingPlugin):
-    author = "Sentry Team"
-    author_url = "https://github.com/getsentry"
-
-    title = "Freight"
-    slug = "freight"
-    description = "Integrate Freight release tracking."
-    version = sentry.VERSION
-
-    def has_plugin_conf(self):
-        return True
-
-    def get_release_doc_html(self, hook_url):
-        return DOC_HTML.format(hook_url=hook_url)
-
-    def get_release_hook(self):
-        return FreightReleaseHook

+ 0 - 2
tests/sentry/integrations/utils/fixtures/sentry_files.json

@@ -2475,8 +2475,6 @@
     "src/sentry_plugins/bitbucket/testutils.py",
     "src/sentry_plugins/bitbucket/urls.py",
     "src/sentry_plugins/client.py",
-    "src/sentry_plugins/freight/__init__.py",
-    "src/sentry_plugins/freight/plugin.py",
     "src/sentry_plugins/github/__init__.py",
     "src/sentry_plugins/github/client.py",
     "src/sentry_plugins/github/options.py",