From aeb6a4a9b9cbf11bcffd4da2cda8947319ba6754 Mon Sep 17 00:00:00 2001 From: Nico Hinderling Date: Wed, 24 Jun 2026 13:04:03 -0700 Subject: [PATCH] chore(preprod): Remove preprod-enforce-size-quota feature flag Graduate size quota enforcement to always-on. The flag previously gated an early return in has_size_quota() that skipped the quota check entirely when disabled; now the check always runs. Remove the flag registration, the gate in has_size_quota(), and the flag from the affected task tests. --- src/sentry/features/temporary.py | 2 -- src/sentry/preprod/quotas.py | 6 ------ tests/sentry/preprod/test_tasks.py | 4 ---- 3 files changed, 12 deletions(-) diff --git a/src/sentry/features/temporary.py b/src/sentry/features/temporary.py index bce608914410..87c68b44bb12 100644 --- a/src/sentry/features/temporary.py +++ b/src/sentry/features/temporary.py @@ -197,8 +197,6 @@ def register_temporary_features(manager: FeatureManager) -> None: manager.add("organizations:preprod-artifact-webhooks", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=True) # Enable preprod PR comments for build distribution manager.add("organizations:preprod-build-distribution-pr-comments", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=True) - # Enable enforcement of preprod size quota checks (when disabled, size quota checks always return True) - manager.add("organizations:preprod-enforce-size-quota", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=False) # Enable enforcement of preprod distribution quota checks (when disabled, distribution quota checks always return True) manager.add("organizations:preprod-enforce-distribution-quota", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=False) # Enable preprod size monitors frontend diff --git a/src/sentry/preprod/quotas.py b/src/sentry/preprod/quotas.py index a19c29f65e9c..3594aec1d292 100644 --- a/src/sentry/preprod/quotas.py +++ b/src/sentry/preprod/quotas.py @@ -46,12 +46,6 @@ def get_size_retention_cutoff(organization: Organization) -> datetime: def has_size_quota(organization: Organization, actor: User | AnonymousUser | None = None) -> bool: - if not features.has("organizations:preprod-enforce-size-quota", organization, actor=actor): - logger.info( - "has_size_quota", - extra={"organization_id": organization.id, "result": True, "reason": "not_enforced"}, - ) - return True result = quotas.backend.has_usage_quota(organization.id, DataCategory.SIZE_ANALYSIS) logger.info( "has_size_quota", diff --git a/tests/sentry/preprod/test_tasks.py b/tests/sentry/preprod/test_tasks.py index 8e746321c957..436d09a21545 100644 --- a/tests/sentry/preprod/test_tasks.py +++ b/tests/sentry/preprod/test_tasks.py @@ -464,7 +464,6 @@ def test_create_preprod_artifact_succeeds_with_both_quotas_available(self) -> No with self.feature( [ - "organizations:preprod-enforce-size-quota", "organizations:preprod-enforce-distribution-quota", ] ): @@ -487,7 +486,6 @@ def quota_side_effect(org_id, data_category): with self.feature( [ - "organizations:preprod-enforce-size-quota", "organizations:preprod-enforce-distribution-quota", ] ): @@ -513,7 +511,6 @@ def quota_side_effect(org_id, data_category): with self.feature( [ - "organizations:preprod-enforce-size-quota", "organizations:preprod-enforce-distribution-quota", ] ): @@ -536,7 +533,6 @@ def test_create_preprod_artifact_raises_no_quota_exception(self) -> None: with self.feature( [ - "organizations:preprod-enforce-size-quota", "organizations:preprod-enforce-distribution-quota", ] ):