From 6ccb4e9e661577608f86b8c63e53d3fa7d43829f Mon Sep 17 00:00:00 2001 From: anthony sottile Date: Wed, 24 Jul 2024 16:59:26 -0400 Subject: [PATCH] ref: unify signature of get_release_hook --- src/sentry/plugins/base/v2.py | 7 ++++--- src/sentry_plugins/heroku/plugin.py | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/sentry/plugins/base/v2.py b/src/sentry/plugins/base/v2.py index 166d76f3c37aac..5ec47cf32dcff6 100644 --- a/src/sentry/plugins/base/v2.py +++ b/src/sentry/plugins/base/v2.py @@ -11,6 +11,7 @@ from sentry.plugins.base.configuration import default_plugin_config, default_plugin_options from sentry.plugins.base.response import Response from sentry.plugins.config import PluginConfigMixin +from sentry.plugins.interfaces.releasehook import ReleaseHook from sentry.plugins.status import PluginStatusMixin from sentry.utils.hashlib import md5_text @@ -411,7 +412,7 @@ def get_feature_hooks(self, **kwargs): """ return [] - def get_release_hook(self, **kwargs): + def get_release_hook(self) -> type[ReleaseHook] | None: """ Return an implementation of ``ReleaseHook``. @@ -421,10 +422,10 @@ def get_release_hook(self, **kwargs): >>> def handle(self, request: Request) -> Response: >>> self.finish_release(version=request.POST['version']) - >>> def get_release_hook(self, **kwargs): + >>> def get_release_hook(self): >>> return MyReleaseHook """ - return [] + return None def get_custom_contexts(self): """Return a list of of context types. diff --git a/src/sentry_plugins/heroku/plugin.py b/src/sentry_plugins/heroku/plugin.py index b24fc4d85fd982..e97c95a61f2a20 100644 --- a/src/sentry_plugins/heroku/plugin.py +++ b/src/sentry_plugins/heroku/plugin.py @@ -215,5 +215,5 @@ def get_release_doc_html(self, hook_url):
heroku webhooks:add -i api:release -l notify -u {hook_url} -a YOUR_APP_NAME
""" - def get_release_hook(self): + def get_release_hook(self) -> type[HerokuReleaseHook]: return HerokuReleaseHook