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_configure_plugin_fields #74871

Merged
merged 1 commit into from
Jul 24, 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
8 changes: 1 addition & 7 deletions src/sentry/plugins/base/v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -507,13 +507,7 @@ def get_url_module(self):

def view_configure(self, request, project, **kwargs):
if request.method == "GET":
return Response(
self.get_configure_plugin_fields(
request=request, # DEPRECATED: this param should not be used
project=project,
**kwargs,
)
)
return Response(self.get_configure_plugin_fields(project=project, **kwargs))
self.configure(project, request.data)
return Response({"message": "Successfully updated configuration."})

Expand Down
3 changes: 0 additions & 3 deletions src/sentry/plugins/bases/issue2.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,9 +392,6 @@ def plugin_issues(self, request: Request, group, plugin_issues, **kwargs) -> Non

def get_config(self, *args, **kwargs):
# TODO(dcramer): update existing plugins to just use get_config
# TODO(dcramer): remove request kwarg after sentry-plugins has been
# updated
kwargs.setdefault("request", None)
return self.get_configure_plugin_fields(*args, **kwargs)

def check_config_and_auth(self, request: Request, group):
Expand Down
2 changes: 1 addition & 1 deletion src/sentry_plugins/bitbucket/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ def view_autocomplete(self, request: Request, group, **kwargs):

return Response({field: issues})

def get_configure_plugin_fields(self, request: Request, project, **kwargs):
def get_configure_plugin_fields(self, project, **kwargs):
return [
{
"name": "repo",
Expand Down
2 changes: 1 addition & 1 deletion src/sentry_plugins/github/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ def view_autocomplete(self, request: Request, group, **kwargs):

return Response({field: issues})

def get_configure_plugin_fields(self, request: Request, project, **kwargs):
def get_configure_plugin_fields(self, project, **kwargs):
return [
{
"name": "repo",
Expand Down
2 changes: 1 addition & 1 deletion src/sentry_plugins/gitlab/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def get_issue_url(self, group, issue_iid, **kwargs):

return f"{url}/{repo}/issues/{issue_iid}"

def get_configure_plugin_fields(self, request: Request, project, **kwargs):
def get_configure_plugin_fields(self, project, **kwargs):
gitlab_token = self.get_option("gitlab_token", project)
secret_field = get_secret_field_config(
gitlab_token, "Enter your GitLab API token.", include_prefix=True
Expand Down
2 changes: 1 addition & 1 deletion src/sentry_plugins/jira/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ def validate_config(self, project, config, actor=None):

return config

def get_configure_plugin_fields(self, request: Request, project, **kwargs):
def get_configure_plugin_fields(self, project, **kwargs):
instance = self.get_option("instance_url", project)
username = self.get_option("username", project)
pw = self.get_option("password", project)
Expand Down
2 changes: 1 addition & 1 deletion src/sentry_plugins/phabricator/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def get_api(self, project):
token=self.get_option("token", project),
)

def get_configure_plugin_fields(self, request: Request, project, **kwargs):
def get_configure_plugin_fields(self, project, **kwargs):
token = self.get_option("token", project)
helptext = "You may generate a Conduit API Token from your account settings in Phabricator."
secret_field = get_secret_field_config(token, helptext, include_prefix=True)
Expand Down
2 changes: 1 addition & 1 deletion src/sentry_plugins/pivotal/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ def get_issue_title_by_id(self, request: Request, group, issue_id):
json_resp = json.loads(body)
return json_resp["name"]

def get_configure_plugin_fields(self, request: Request, project, **kwargs):
def get_configure_plugin_fields(self, project, **kwargs):
token = self.get_option("token", project)
helptext = (
"Enter your API Token (found on "
Expand Down
Loading