Skip to content

Commit 36b4de0

Browse files
authored
fix(vsts): Hide VSTS Extension from integrations (#9538)
The VSTS Extension is just meant to enable a VSTS -> Sentry flow, so we don't want to show it in the list of installable integrations.
1 parent 7f1ad91 commit 36b4de0

File tree

4 files changed

+25
-1
lines changed

4 files changed

+25
-1
lines changed

src/sentry/integrations/base.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ class is just a descriptor for how that object functions, and what behavior
6262
# than ``key``. See: VstsExtensionIntegrationProvider.
6363
_integration_key = None
6464

65+
# Whether this integration should show up in the list on the Organization
66+
# Integrations page.
67+
visible = True
68+
6569
# a human readable name (e.g. 'Slack')
6670
name = None
6771

src/sentry/integrations/manager.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ def __iter__(self):
1818

1919
def all(self):
2020
for key in six.iterkeys(self.__values):
21-
yield self.get(key)
21+
integration = self.get(key)
22+
if integration.visible:
23+
yield integration
2224

2325
def get(self, key, **kwargs):
2426
try:

src/sentry/integrations/vsts_extension/integration.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ class VstsExtensionIntegrationProvider(VstsIntegrationProvider):
1414
key = 'vsts-extension'
1515
integration_key = 'vsts'
1616

17+
# This is only to enable the VSTS -> Sentry installation flow, so we don't
18+
# want it to actually appear of the Integrations page.
19+
visible = False
20+
1721
def get_pipeline_views(self):
1822
views = super(VstsExtensionIntegrationProvider, self).get_pipeline_views()
1923
views = [view for view in views if not isinstance(view, AccountConfigView)]
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
from __future__ import absolute_import
2+
3+
from sentry import integrations
4+
from sentry.integrations.vsts_extension import VstsExtensionIntegrationProvider
5+
from sentry.testutils import TestCase
6+
7+
8+
class TestIntegrations(TestCase):
9+
def test_excludes_non_visible_integrations(self):
10+
# The VSTSExtension is not visible
11+
assert all(
12+
not isinstance(i, VstsExtensionIntegrationProvider)
13+
for i in integrations.all()
14+
)

0 commit comments

Comments
 (0)