Skip to content

Commit

Permalink
ref: unify signature of get_release_hook (#74897)
Browse files Browse the repository at this point in the history
fixes errors pointed out by upgrading mypy to 1.11

<!-- Describe your PR here. -->
  • Loading branch information
asottile-sentry authored and Christinarlong committed Jul 26, 2024
1 parent 5f31a11 commit 3a1b625
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions src/sentry/plugins/base/v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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``.
Expand All @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/sentry_plugins/heroku/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,5 +215,5 @@ def get_release_doc_html(self, hook_url):
<pre class="clippy">heroku webhooks:add -i api:release -l notify -u {hook_url} -a YOUR_APP_NAME</pre>
"""

def get_release_hook(self):
def get_release_hook(self) -> type[HerokuReleaseHook]:
return HerokuReleaseHook

0 comments on commit 3a1b625

Please sign in to comment.