Skip to content
Open
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
1 change: 0 additions & 1 deletion src/sentry/features/temporary.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
6 changes: 0 additions & 6 deletions tests/acceptance/test_scm_onboarding.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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:
Expand All @@ -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 == {
Expand Down Expand Up @@ -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": [
Expand Down Expand Up @@ -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:
Expand All @@ -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"]

Expand All @@ -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"]

Expand All @@ -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:
Expand All @@ -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")
Expand All @@ -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
Expand All @@ -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"

Expand Down Expand Up @@ -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
)
Expand Down Expand Up @@ -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
)
Expand All @@ -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
Expand Down Expand Up @@ -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
)
Expand Down Expand Up @@ -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
)
Expand Down
Loading