Skip to content

Commit a355bde

Browse files
author
Stephen Cefali
authored
feat(github): allow users to uninstall github from Sentry (#21327)
1 parent 7ba1b20 commit a355bde

File tree

3 files changed

+5
-19
lines changed

3 files changed

+5
-19
lines changed

src/sentry/integrations/base.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,9 @@ class is just a descriptor for how that object functions, and what behavior
147147
# whether or not the integration installation be initiated from Sentry
148148
can_add = True
149149

150-
# can the integration be disabled ?
150+
# if the integration can be uninstalled in Sentry, set to False
151+
# if True, the integration must be uninstalled from the other platform
152+
# which is uninstalled/disabled via wehbook
151153
can_disable = False
152154

153155
# if the integration has no application-style access token, associate

src/sentry/integrations/github/integration.py

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -52,20 +52,6 @@
5252
),
5353
]
5454

55-
disable_dialog = {
56-
"actionText": "Visit GitHub",
57-
"body": "Before deleting this integration, you must uninstall this"
58-
" integration from GitHub. After uninstalling, your integration will"
59-
" be disabled at which point you can choose to delete this"
60-
" integration.",
61-
}
62-
63-
removal_dialog = {
64-
"actionText": "Delete",
65-
"body": "Deleting this integration will delete all associated repositories"
66-
" and commit data. This action cannot be undone. Are you sure you"
67-
" want to delete your integration?",
68-
}
6955

7056
metadata = IntegrationMetadata(
7157
description=DESCRIPTION.strip(),
@@ -74,7 +60,7 @@
7460
noun=_("Installation"),
7561
issue_url="https://github.com/getsentry/sentry/issues/new?title=GitHub%20Integration:%20&labels=Component%3A%20Integrations",
7662
source_url="https://github.com/getsentry/sentry/tree/master/src/sentry/integrations/github",
77-
aspects={"disable_dialog": disable_dialog, "removal_dialog": removal_dialog},
63+
aspects={},
7864
)
7965

8066
API_ERRORS = {
@@ -160,8 +146,6 @@ class GitHubIntegrationProvider(IntegrationProvider):
160146
integration_cls = GitHubIntegration
161147
features = frozenset([IntegrationFeatures.COMMITS, IntegrationFeatures.ISSUE_BASIC])
162148

163-
can_disable = True
164-
165149
setup_dialog_config = {"width": 1030, "height": 1000}
166150

167151
def post_install(self, integration, organization, extra=None):

src/sentry/integrations/github/webhook.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def __call__(self, event, host=None):
118118
"github.deletion-missing-integration",
119119
extra={
120120
"action": event["action"],
121-
"installation_name": event["account"]["login"],
121+
"installation_name": installation["account"]["login"],
122122
"external_id": six.text_type(external_id),
123123
},
124124
)

0 commit comments

Comments
 (0)