Browse Source

ref(github): Remove disable github feature flag (#56408)

This has been GA'd for a week - removing the flag in code now that it's
not needed.
Colleen O'Rourke 1 year ago
parent
commit
e2d67ffc2e

+ 0 - 2
src/sentry/conf/server.py

@@ -1446,8 +1446,6 @@ SENTRY_FEATURES = {
     "organizations:profiling-battery-usage-chart": False,
     # Enable profiling summary redesign view
     "organizations:profiling-summary-redesign": False,
-    # Enable disabling github integrations when broken is detected
-    "organizations:github-disable-on-broken": False,
     # Enable disabling gitlab integrations when broken is detected
     "organizations:gitlab-disable-on-broken": False,
     # Enable multi project selection

+ 0 - 1
src/sentry/features/__init__.py

@@ -278,7 +278,6 @@ default_manager.add("organizations:codecov-commit-sha-from-git-blame", Organizat
 default_manager.add("organizations:ds-sliding-window", OrganizationFeature, FeatureHandlerStrategy.INTERNAL)
 default_manager.add("organizations:ds-sliding-window-org", OrganizationFeature, FeatureHandlerStrategy.INTERNAL)
 default_manager.add("organizations:ds-org-recalibration", OrganizationFeature, FeatureHandlerStrategy.INTERNAL)
-default_manager.add("organizations:github-disable-on-broken", OrganizationFeature, FeatureHandlerStrategy.REMOTE)
 default_manager.add("organizations:gitlab-disable-on-broken", OrganizationFeature, FeatureHandlerStrategy.REMOTE)
 default_manager.add("organizations:sourcemaps-bundle-flat-file-indexing", OrganizationFeature, FeatureHandlerStrategy.REMOTE)
 default_manager.add("organizations:sourcemaps-upload-release-as-artifact-bundle", OrganizationFeature, FeatureHandlerStrategy.REMOTE)

+ 1 - 4
src/sentry/shared_integrations/client/base.py

@@ -452,10 +452,7 @@ class BaseApiClient(TrackResponseMixin):
 
         if (
             (rpc_integration.provider == "slack" and buffer.is_integration_fatal_broken())
-            or (
-                features.has("organizations:github-disable-on-broken", org)
-                and rpc_integration.provider == "github"
-            )
+            or (rpc_integration.provider == "github")
             or (
                 features.has("organizations:gitlab-disable-on-broken", org)
                 and rpc_integration.provider == "gitlab"

+ 6 - 12
tests/sentry/integrations/github/test_client.py

@@ -22,7 +22,6 @@ from sentry.shared_integrations.response.base import BaseApiResponse
 from sentry.silo.base import SiloMode
 from sentry.silo.util import PROXY_BASE_PATH, PROXY_OI_HEADER, PROXY_SIGNATURE_HEADER
 from sentry.testutils.cases import TestCase
-from sentry.testutils.helpers import with_feature
 from sentry.utils.cache import cache
 
 GITHUB_CODEOWNERS = {
@@ -595,7 +594,6 @@ class GithubProxyClientTest(TestCase):
 
     @mock.patch("sentry.integrations.github.client.get_jwt", return_value=ApiError)
     @responses.activate
-    @with_feature("organizations:github-disable-on-broken")
     def test_fatal_and_disable_integration(self, get_jwt):
         """
         fatal fast shut off with disable flag on, integration should be broken and disabled
@@ -621,7 +619,6 @@ class GithubProxyClientTest(TestCase):
         assert len(buffer._get_all_from_buffer()) == 0
 
     @responses.activate
-    @with_feature("organizations:github-disable-on-broken")
     def test_disable_email(self):
         with self.tasks():
             notify_disable(
@@ -647,7 +644,7 @@ class GithubProxyClientTest(TestCase):
     @responses.activate
     def test_fatal_integration(self, get_jwt):
         """
-        fatal fast shut off with disable flag off, integration should be broken but not disabled
+        fatal fast shut off with disable flag on, integration should be broken and disabled
         """
         responses.add(
             responses.POST,
@@ -662,10 +659,8 @@ class GithubProxyClientTest(TestCase):
         self.gh_client.integration = None
         with pytest.raises(Exception):
             self.gh_client.get_blame_for_file(self.repo, "foo.py", "main", 1)
-        buffer = IntegrationRequestBuffer(self.gh_client._get_redis_key())
-        assert buffer.is_integration_broken() is True
         integration = Integration.objects.get(id=self.integration.id)
-        assert integration.status == ObjectStatus.ACTIVE
+        assert integration.status == ObjectStatus.DISABLED
 
     @responses.activate
     def test_error_integration(self):
@@ -698,7 +693,6 @@ class GithubProxyClientTest(TestCase):
         assert buffer.is_integration_broken() is False
 
     @responses.activate
-    @with_feature("organizations:github-disable-on-broken")
     @freeze_time("2022-01-01 03:30:00")
     def test_slow_integration_is_not_broken_or_disabled(self):
         """
@@ -730,8 +724,8 @@ class GithubProxyClientTest(TestCase):
     @freeze_time("2022-01-01 03:30:00")
     def test_a_slow_integration_is_broken(self):
         """
-        slow shut off with disable flag off
-        put errors in buffer for 10 days, assert integration is broken but not disabled
+        slow shut off with disable flag on
+        put errors in buffer for 10 days, assert integration is broken and disabled
         """
         responses.add(
             responses.POST,
@@ -747,7 +741,7 @@ class GithubProxyClientTest(TestCase):
             with freeze_time(now - timedelta(days=i)):
                 buffer.record_error()
         self.gh_client.integration = None
+        assert Integration.objects.get(id=self.integration.id).status == ObjectStatus.ACTIVE
         with pytest.raises(Exception):
             self.gh_client.get_blame_for_file(self.repo, "foo.py", "main", 1)
-        assert buffer.is_integration_broken() is True
-        assert Integration.objects.get(id=self.integration.id).status == ObjectStatus.ACTIVE
+        assert Integration.objects.get(id=self.integration.id).status == ObjectStatus.DISABLED