diff --git a/src/sentry/features/temporary.py b/src/sentry/features/temporary.py index 40395574f291..0249d4cf2804 100644 --- a/src/sentry/features/temporary.py +++ b/src/sentry/features/temporary.py @@ -124,7 +124,6 @@ def register_temporary_features(manager: FeatureManager) -> None: manager.add("organizations:increased-issue-owners-rate-limit", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=False) # Starfish: extract metrics from the spans manager.add("organizations:indexed-spans-extraction", OrganizationFeature, FeatureHandlerStrategy.INTERNAL, api_expose=False) - manager.add("organizations:integrations-github-platform-detection", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=True) manager.add("organizations:integrations-github-multi-platform-detection", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=True) manager.add("organizations:integrations-slack-staging", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=True) manager.add("organizations:integrations-vercel-upsert-env-var", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=False) diff --git a/src/sentry/integrations/api/endpoints/organization_repository_platforms.py b/src/sentry/integrations/api/endpoints/organization_repository_platforms.py index 82aeb0022992..9d6124074a8c 100644 --- a/src/sentry/integrations/api/endpoints/organization_repository_platforms.py +++ b/src/sentry/integrations/api/endpoints/organization_repository_platforms.py @@ -36,13 +36,6 @@ class OrganizationRepositoryPlatformsEndpoint(OrganizationRepositoryEndpoint): } def get(self, request: Request, organization: Organization, repo: Repository) -> Response: - if not features.has( - "organizations:integrations-github-platform-detection", - organization, - actor=request.user, - ): - return Response(status=404) - if ( not repo.integration_id or repo.provider != f"integrations:{IntegrationProviderSlug.GITHUB}" diff --git a/tests/acceptance/test_scm_onboarding.py b/tests/acceptance/test_scm_onboarding.py index 395f92887ff9..022a4b2d06db 100644 --- a/tests/acceptance/test_scm_onboarding.py +++ b/tests/acceptance/test_scm_onboarding.py @@ -133,7 +133,6 @@ def test_scm_onboarding_happy_path(self) -> None: { "organizations:onboarding-scm-experiment": True, "organizations:onboarding-scm-project-details-experiment": True, - "organizations:integrations-github-platform-detection": True, } ), mock.patch( @@ -214,7 +213,6 @@ def test_scm_onboarding_reload_restores_connected_repo(self) -> None: { "organizations:onboarding-scm-experiment": True, "organizations:onboarding-scm-project-details-experiment": True, - "organizations:integrations-github-platform-detection": True, } ), mock.patch( @@ -310,7 +308,6 @@ def validate_for(client: object, installation: object, repo: str) -> dict[str, s { "organizations:onboarding-scm-experiment": True, "organizations:onboarding-scm-project-details-experiment": True, - "organizations:integrations-github-platform-detection": True, } ), mock.patch( @@ -452,7 +449,6 @@ def test_scm_onboarding_with_integration_install(self) -> None: { "organizations:onboarding-scm-experiment": True, "organizations:onboarding-scm-project-details-experiment": True, - "organizations:integrations-github-platform-detection": True, } ), mock.patch( @@ -588,7 +584,6 @@ def test_scm_onboarding_detection_error_falls_back_to_manual_picker(self) -> Non { "organizations:onboarding-scm-experiment": True, "organizations:onboarding-scm-project-details-experiment": True, - "organizations:integrations-github-platform-detection": True, } ), mock.patch( @@ -859,7 +854,6 @@ def test_scm_onboarding_control_happy_path(self) -> None: { "organizations:onboarding-scm-experiment": True, "organizations:onboarding-scm-project-details-experiment": False, - "organizations:integrations-github-platform-detection": True, } ), mock.patch( diff --git a/tests/sentry/integrations/api/endpoints/test_organization_repository_platforms.py b/tests/sentry/integrations/api/endpoints/test_organization_repository_platforms.py index f705cf6ecbbc..0fbda96b6dc4 100644 --- a/tests/sentry/integrations/api/endpoints/test_organization_repository_platforms.py +++ b/tests/sentry/integrations/api/endpoints/test_organization_repository_platforms.py @@ -10,7 +10,6 @@ from sentry.models.repository import Repository from sentry.testutils.cases import APITestCase -FEATURE_FLAG = "organizations:integrations-github-platform-detection" MULTI_FLAG = "organizations:integrations-github-multi-platform-detection" ENDPOINT_MODULE = "sentry.integrations.api.endpoints.organization_repository_platforms" @@ -42,10 +41,6 @@ def setUp(self) -> None: integration_id=self.integration.id, ) - def test_feature_flag_required(self) -> None: - response = self.get_response(self.organization.slug, self.repo.id) - assert response.status_code == 404 - @mock.patch("sentry.integrations.github.client.get_jwt", return_value="jwt_token_1") @responses.activate def test_detects_platforms(self, get_jwt: mock.MagicMock) -> None: @@ -63,10 +58,7 @@ def test_detects_platforms(self, get_jwt: mock.MagicMock) -> None: status=200, ) - with self.feature(FEATURE_FLAG): - response = self.get_success_response( - self.organization.slug, self.repo.id, status_code=200 - ) + response = self.get_success_response(self.organization.slug, self.repo.id, status_code=200) # Only the top language by bytes is returned assert response.data == { @@ -106,10 +98,7 @@ def test_detects_framework(self, get_jwt: mock.MagicMock) -> None: status=200, ) - with self.feature(FEATURE_FLAG): - response = self.get_success_response( - self.organization.slug, self.repo.id, status_code=200 - ) + response = self.get_success_response(self.organization.slug, self.repo.id, status_code=200) assert response.data == { "platforms": [ @@ -138,8 +127,7 @@ def test_detects_framework(self, get_jwt: mock.MagicMock) -> None: } def test_repo_not_found(self) -> None: - with self.feature(FEATURE_FLAG): - response = self.get_response(self.organization.slug, 99999) + response = self.get_response(self.organization.slug, 99999) assert response.status_code == 404 def test_non_github_repo(self) -> None: @@ -150,8 +138,7 @@ def test_non_github_repo(self) -> None: external_id="456", ) - with self.feature(FEATURE_FLAG): - response = self.get_response(self.organization.slug, repo.id) + response = self.get_response(self.organization.slug, repo.id) assert response.status_code == 400 assert "only supported for GitHub" in response.data["detail"] @@ -164,8 +151,7 @@ def test_github_enterprise_repo_rejected(self) -> None: integration_id=self.integration.id, ) - with self.feature(FEATURE_FLAG): - response = self.get_response(self.organization.slug, repo.id) + response = self.get_response(self.organization.slug, repo.id) assert response.status_code == 400 assert "only supported for GitHub" in response.data["detail"] @@ -178,8 +164,7 @@ def test_repo_without_integration(self) -> None: integration_id=None, ) - with self.feature(FEATURE_FLAG): - response = self.get_response(self.organization.slug, repo.id) + response = self.get_response(self.organization.slug, repo.id) assert response.status_code == 400 def test_other_orgs_repo_not_accessible(self) -> None: @@ -192,8 +177,7 @@ def test_other_orgs_repo_not_accessible(self) -> None: integration_id=self.integration.id, ) - with self.feature(FEATURE_FLAG): - response = self.get_response(self.organization.slug, other_repo.id) + response = self.get_response(self.organization.slug, other_repo.id) assert response.status_code == 404 @mock.patch(f"{ENDPOINT_MODULE}.sentry_sdk") @@ -209,8 +193,7 @@ def test_github_api_error_returns_502( status=500, ) - with self.feature(FEATURE_FLAG): - response = self.get_response(self.organization.slug, self.repo.id) + response = self.get_response(self.organization.slug, self.repo.id) assert response.status_code == 502 assert "Failed to detect" in response.data["detail"] assert mock_sentry_sdk.capture_exception.called @@ -221,7 +204,7 @@ def test_github_api_error_returns_502( class OrganizationRepositoryPlatformsMultiGetTest(APITestCase): - """Tests for the multi-platform detector path (both flags enabled).""" + """Tests for the multi-platform detector path (multi flag enabled).""" endpoint = "sentry-api-0-organization-repository-platforms" @@ -269,7 +252,7 @@ def test_multi_detects_framework_and_language(self, get_jwt: mock.MagicMock) -> status=200, ) - with self.feature({FEATURE_FLAG: True, MULTI_FLAG: True}): + with self.feature(MULTI_FLAG): response = self.get_success_response( self.organization.slug, self.repo.id, status_code=200 ) @@ -299,7 +282,7 @@ def test_multi_empty_repo_returns_empty_list( status=409, ) - with self.feature({FEATURE_FLAG: True, MULTI_FLAG: True}): + with self.feature(MULTI_FLAG): response = self.get_success_response( self.organization.slug, self.repo.id, status_code=200 ) @@ -325,7 +308,7 @@ def test_multi_github_api_error_returns_502( status=500, ) - with self.feature({FEATURE_FLAG: True, MULTI_FLAG: True}): + with self.feature(MULTI_FLAG): response = self.get_response(self.organization.slug, self.repo.id) assert response.status_code == 502 @@ -360,7 +343,7 @@ def test_detects_multi_platforms(self, get_jwt: mock.MagicMock) -> None: status=200, ) - with self.feature({FEATURE_FLAG: True, MULTI_FLAG: True}): + with self.feature(MULTI_FLAG): response = self.get_success_response( self.organization.slug, self.repo.id, status_code=200 ) @@ -408,7 +391,7 @@ def test_detects_multi_framework(self, get_jwt: mock.MagicMock) -> None: status=200, ) - with self.feature({FEATURE_FLAG: True, MULTI_FLAG: True}): + with self.feature(MULTI_FLAG): response = self.get_success_response( self.organization.slug, self.repo.id, status_code=200 )