Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ class OrganizationTraceItemAttributesEndpointBase(OrganizationEventsEndpointBase
"organizations:ourlogs-enabled",
"organizations:visibility-explore-view",
"organizations:tracemetrics-enabled",
"organizations:preprod-frontend-routes",
Comment thread
cursor[bot] marked this conversation as resolved.
]

def has_feature(self, organization: Organization, request: Request) -> bool:
Expand Down
2 changes: 0 additions & 2 deletions src/sentry/features/temporary.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,6 @@ def register_temporary_features(manager: FeatureManager) -> None:
manager.add("organizations:performance-web-vitals-seer-suggestions", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=True)
# Enable the warning banner to inform users of pending deprecation of the transactions dataset
manager.add("organizations:performance-transaction-deprecation-banner", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=True)
# Enable preprod frontend routes
manager.add("organizations:preprod-frontend-routes", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=True)
# Enable preprod_artifact webhook subscription UI in Sentry App settings
manager.add("organizations:preprod-artifact-webhooks", OrganizationFeature, FeatureHandlerStrategy.FLAGPOLE, api_expose=True)
# Enable preprod issue reporting
Expand Down
11 changes: 0 additions & 11 deletions src/sentry/preprod/api/endpoints/builds.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from rest_framework.request import Request
from rest_framework.response import Response

from sentry import features
from sentry.api.api_owners import ApiOwner
from sentry.api.api_publish_status import ApiPublishStatus
from sentry.api.base import cell_silo_endpoint
Expand All @@ -21,8 +20,6 @@

logger = logging.getLogger(__name__)

ERR_FEATURE_REQUIRED = "Feature {} is not enabled for the organization."


@cell_silo_endpoint
class BuildsEndpoint(OrganizationEndpoint):
Expand All @@ -32,14 +29,6 @@ class BuildsEndpoint(OrganizationEndpoint):
}

def get(self, request: Request, organization: Organization) -> Response:
if not features.has(
"organizations:preprod-frontend-routes", organization, actor=request.user
):
return Response(
{"detail": ERR_FEATURE_REQUIRED.format("organizations:preprod-frontend-routes")},
status=403,
)

def on_results(artifacts: list[PreprodArtifact]) -> list[dict[str, Any]]:
results = []
for artifact in artifacts:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@
import jsonschema
import orjson
import sentry_sdk
from django.conf import settings
from rest_framework.request import Request
from rest_framework.response import Response

from sentry import analytics, features
from sentry import analytics
from sentry.api.api_owners import ApiOwner
from sentry.api.api_publish_status import ApiPublishStatus
from sentry.api.base import cell_silo_endpoint
Expand Down Expand Up @@ -145,11 +144,6 @@ def post(self, request: Request, project: Project) -> Response:
)
)

if not settings.IS_DEV and not features.has(
"organizations:preprod-frontend-routes", project.organization, actor=request.user
):
return Response({"error": "Feature not enabled"}, status=403)

with sentry_sdk.start_span(op="preprod_artifact.assemble"):
data, error_message = validate_preprod_artifact_schema(request.body)
if error_message:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from rest_framework.request import Request
from rest_framework.response import Response

from sentry import analytics, features
from sentry import analytics
from sentry.api.api_owners import ApiOwner
from sentry.api.api_publish_status import ApiPublishStatus
from sentry.api.base import cell_silo_endpoint
Expand Down Expand Up @@ -34,11 +34,6 @@ def delete(
) -> Response:
"""Delete a preprod artifact and all associated data"""

if not features.has(
"organizations:preprod-frontend-routes", project.organization, actor=request.user
):
return Response({"error": "Feature not enabled"}, status=403)

analytics.record(
PreprodArtifactApiDeleteEvent(
organization_id=project.organization_id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from rest_framework.request import Request
from rest_framework.response import Response

from sentry import analytics, features
from sentry import analytics
from sentry.api.api_owners import ApiOwner
from sentry.api.api_publish_status import ApiPublishStatus
from sentry.api.base import cell_silo_endpoint
Expand Down Expand Up @@ -58,11 +58,6 @@ def get(
)
)

if not features.has(
"organizations:preprod-frontend-routes", project.organization, actor=request.user
):
return Response({"error": "Feature not enabled"}, status=403)

cutoff = get_size_retention_cutoff(project.organization)
if head_artifact.date_added < cutoff:
return Response({"detail": "This build's size data has expired."}, status=404)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from rest_framework.request import Request
from rest_framework.response import Response

from sentry import features
from sentry.api.api_owners import ApiOwner
from sentry.api.api_publish_status import ApiPublishStatus
from sentry.api.base import cell_silo_endpoint
Expand Down Expand Up @@ -72,11 +71,6 @@ def get(
and iOS-specific code signing information.
"""

if not features.has(
"organizations:preprod-frontend-routes", organization, actor=request.user
):
return Response({"detail": "Feature not enabled"}, status=403)

try:
artifact = PreprodArtifact.objects.select_related(
"mobile_app_info",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
from rest_framework.request import Request
from rest_framework.response import Response

from sentry import features
from sentry.api.api_owners import ApiOwner
from sentry.api.api_publish_status import ApiPublishStatus
from sentry.api.base import cell_silo_endpoint
Expand Down Expand Up @@ -119,11 +118,6 @@ def get(
- `COMPLETED`: Analysis finished successfully with full size data.
"""

if not features.has(
"organizations:preprod-frontend-routes", organization, actor=request.user
):
return Response({"detail": "Feature not enabled"}, status=403)

try:
head_artifact = PreprodArtifact.objects.select_related(
"mobile_app_info", "build_configuration", "commit_comparison"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from rest_framework.request import Request
from rest_framework.response import Response

from sentry import analytics, features
from sentry import analytics
from sentry.api.api_owners import ApiOwner
from sentry.api.api_publish_status import ApiPublishStatus
from sentry.api.base import cell_silo_endpoint
Expand Down Expand Up @@ -113,11 +113,6 @@ def get(
)
)

if not features.has(
"organizations:preprod-frontend-routes", project.organization, actor=request.user
):
return Response({"detail": "Feature not enabled"}, status=403)

cutoff = get_size_retention_cutoff(project.organization)
if head_artifact.date_added < cutoff or base_artifact.date_added < cutoff:
return Response({"detail": "This build's size data has expired."}, status=404)
Expand Down Expand Up @@ -279,11 +274,6 @@ def post(
)
)

if not features.has(
"organizations:preprod-frontend-routes", project.organization, actor=request.user
):
return Response({"detail": "Feature not enabled"}, status=403)

cutoff = get_size_retention_cutoff(project.organization)
if head_artifact.date_added < cutoff or base_artifact.date_added < cutoff:
return Response({"detail": "This build's size data has expired."}, status=404)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from rest_framework.request import Request
from rest_framework.response import Response

from sentry import analytics, features
from sentry import analytics
from sentry.api.api_owners import ApiOwner
from sentry.api.api_publish_status import ApiPublishStatus
from sentry.api.base import cell_silo_endpoint
Expand Down Expand Up @@ -55,11 +55,6 @@ def get(
)
)

if not features.has(
"organizations:preprod-frontend-routes", project.organization, actor=request.user
):
return Response({"detail": "Feature not enabled"}, status=403)

logger.info(
"preprod.size_analysis.compare.api.download",
extra={
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
from __future__ import annotations

from django.conf import settings
from django.http.response import HttpResponseBase
from rest_framework.request import Request
from rest_framework.response import Response

from sentry import analytics, features
from sentry import analytics
from sentry.api.api_owners import ApiOwner
from sentry.api.api_publish_status import ApiPublishStatus
from sentry.api.base import cell_silo_endpoint
Expand Down Expand Up @@ -58,11 +57,6 @@ def get(
)
)

if not settings.IS_DEV and not features.has(
"organizations:preprod-frontend-routes", project.organization, actor=request.user
):
return Response({"detail": "Feature not enabled"}, status=403)

cutoff = get_size_retention_cutoff(project.organization)
if head_artifact.date_added < cutoff:
return Response({"detail": "This build's size data has expired."}, status=404)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {Button, LinkButton} from '@sentry/scraps/button';
import {Flex} from '@sentry/scraps/layout';
import {Text} from '@sentry/scraps/text';

import Feature from 'sentry/components/acl/feature';
import {Breadcrumbs, type Crumb} from 'sentry/components/breadcrumbs';
import {ConfirmDelete} from 'sentry/components/confirmDelete';
import {DropdownButton} from 'sentry/components/dropdownButton';
Expand Down Expand Up @@ -198,15 +197,13 @@ export function BuildDetailsHeaderContent(props: BuildDetailsHeaderContentProps)
>
{t('Compare Build')}
</Button>
<Feature features="organizations:preprod-frontend-routes">
{project && (
<LinkButton
icon={<IconSettings />}
aria-label={t('Settings')}
to={`/settings/${organization.slug}/projects/${project.slug}/mobile-builds/`}
/>
)}
</Feature>
{project && (
<LinkButton
icon={<IconSettings />}
aria-label={t('Settings')}
to={`/settings/${organization.slug}/projects/${project.slug}/mobile-builds/`}
/>
)}
<ConfirmDelete
message={t(
'Are you sure you want to delete this build? This action cannot be undone and will permanently remove all associated files and data.'
Expand Down Expand Up @@ -320,16 +317,14 @@ export function BuildDetailsHeaderContent(props: BuildDetailsHeaderContentProps)
>
{t('Compare Build')}
</Button>
<Feature features="organizations:preprod-frontend-routes">
{project && (
<LinkButton
size="sm"
icon={<IconSettings />}
aria-label={t('Settings')}
to={`/settings/${organization.slug}/projects/${project.slug}/mobile-builds/`}
/>
)}
</Feature>
{project && (
<LinkButton
size="sm"
icon={<IconSettings />}
aria-label={t('Settings')}
to={`/settings/${organization.slug}/projects/${project.slug}/mobile-builds/`}
/>
)}
<ConfirmDelete
message={t(
'Are you sure you want to delete this build? This action cannot be undone and will permanently remove all associated files and data.'
Expand Down
25 changes: 3 additions & 22 deletions static/app/views/preprod/index.tsx
Original file line number Diff line number Diff line change
@@ -1,33 +1,14 @@
import {Outlet} from 'react-router-dom';

import {Alert} from '@sentry/scraps/alert';
import {Stack} from '@sentry/scraps/layout';

import Feature from 'sentry/components/acl/feature';
import {NoProjectMessage} from 'sentry/components/noProjectMessage';
import {t} from 'sentry/locale';
import {useOrganization} from 'sentry/utils/useOrganization';

export default function PreprodContainer() {
const organization = useOrganization();

return (
<Feature
features={['organizations:preprod-frontend-routes']}
organization={organization}
renderDisabled={() => (
<Stack flex={1} padding="2xl 3xl">
<Alert.Container>
<Alert variant="warning" showIcon={false}>
{t("You don't have access to this feature")}
</Alert>
</Alert.Container>
</Stack>
)}
>
<NoProjectMessage organization={organization}>
<Outlet />
</NoProjectMessage>
</Feature>
<NoProjectMessage organization={organization}>
<Outlet />
</NoProjectMessage>
);
}
5 changes: 1 addition & 4 deletions static/app/views/releases/detail/header/releaseHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,7 @@ export function ReleaseHeader({
to: 'builds/',
};

if (
organization.features?.includes('preprod-frontend-routes') &&
(numberOfMobileBuilds || isMobileRelease(project.platform, false))
) {
if (numberOfMobileBuilds || isMobileRelease(project.platform, false)) {
tabs.push(buildsTab);
}

Expand Down
2 changes: 1 addition & 1 deletion static/app/views/releases/list/index.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {ReleasesStatusOption} from 'sentry/views/releases/list/releasesStatusOpt

describe('ReleasesList', () => {
const organization = OrganizationFixture({
features: ['preprod-frontend-routes'],
features: [],
});
const projects = [ProjectFixture({features: ['releases']})];
const semverVersionInfo = {
Expand Down
Loading
Loading