Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ref: unify signature of get_release_hook #74897

Merged
merged 1 commit into from
Jul 25, 2024
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
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
Loading