Skip to content
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
4 changes: 3 additions & 1 deletion src/sentry/integrations/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,9 @@ class is just a descriptor for how that object functions, and what behavior
# whether or not the integration installation be initiated from Sentry
can_add = True

# can the integration be disabled ?
# if the integration can be uninstalled in Sentry, set to False
# if True, the integration must be uninstalled from the other platform
# which is uninstalled/disabled via wehbook
can_disable = False

# if the integration has no application-style access token, associate
Expand Down
18 changes: 1 addition & 17 deletions src/sentry/integrations/github/integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,20 +52,6 @@
),
]

disable_dialog = {
"actionText": "Visit GitHub",
"body": "Before deleting this integration, you must uninstall this"
" integration from GitHub. After uninstalling, your integration will"
" be disabled at which point you can choose to delete this"
" integration.",
}

removal_dialog = {
"actionText": "Delete",
"body": "Deleting this integration will delete all associated repositories"
" and commit data. This action cannot be undone. Are you sure you"
" want to delete your integration?",
}

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

API_ERRORS = {
Expand Down Expand Up @@ -160,8 +146,6 @@ class GitHubIntegrationProvider(IntegrationProvider):
integration_cls = GitHubIntegration
features = frozenset([IntegrationFeatures.COMMITS, IntegrationFeatures.ISSUE_BASIC])

can_disable = True
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd explicitly set can_disable to false and leave comment describing the user issue.
Also the comment above IntegrationProvider.can_disable doesn't really describe what disabling does.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree it's a little confusing because technically the integration can still be set to disabled if the user uninstalls from GH first. But we use this attribute for whether or not we show the disable dialog text.

I think we should really be documenting the install and uninstall flows for our integrations and related data (i.e. repos, commits, alert rules)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MeredithAnya @mgaeta I added a new comment in the base class what can_disable actually does


setup_dialog_config = {"width": 1030, "height": 1000}

def post_install(self, integration, organization, extra=None):
Expand Down
2 changes: 1 addition & 1 deletion src/sentry/integrations/github/webhook.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def __call__(self, event, host=None):
"github.deletion-missing-integration",
extra={
"action": event["action"],
"installation_name": event["account"]["login"],
"installation_name": installation["account"]["login"],
"external_id": six.text_type(external_id),
},
)
Expand Down