Skip to content

Commit 3ac8c6b

Browse files
authored
feat(chunk-upload): Decouple feature flag from chunk upload options (#46664)
Previously the `organizations:artifact-bundles` feature flag also controlled the chunk upload. We want to now only use this feature flag for the UI experience, and control the upload behavior explicitly via a flag in sentry-cli.
1 parent bb7604e commit 3ac8c6b

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

src/sentry/api/endpoints/chunk.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from rest_framework.request import Request
1010
from rest_framework.response import Response
1111

12-
from sentry import features, options
12+
from sentry import options
1313
from sentry.api.base import pending_silo_endpoint
1414
from sentry.api.bases.organization import OrganizationEndpoint, OrganizationReleasePermission
1515
from sentry.models import FileBlob
@@ -31,7 +31,9 @@
3131
"bcsymbolmaps", # BCSymbolMaps and associated PLists/UuidMaps
3232
"il2cpp", # Il2cpp LineMappingJson files
3333
"portablepdbs", # Portable PDB debug file
34-
# TODO: This is currently turned on by a feature flag
34+
# TODO: at a later point when we return artifact bundles here
35+
# users will by default upload artifact bundles as this is what
36+
# sentry-cli looks for.
3537
# "artifact_bundles", # Artifact bundles containing source maps.
3638
)
3739

@@ -81,13 +83,6 @@ def get(self, request: Request, organization) -> Response:
8183
# If user overridden upload url prefix, we want an absolute, versioned endpoint, with user-configured prefix
8284
url = absolute_uri(relative_url, endpoint)
8385

84-
# TODO: artifact bundles are still feature flagged.
85-
accept = CHUNK_UPLOAD_ACCEPT
86-
if features.has(
87-
"organizations:artifact-bundles", organization=organization, actor=request.user
88-
):
89-
accept += ("artifact_bundles",)
90-
9186
return Response(
9287
{
9388
"url": url,
@@ -98,7 +93,7 @@ def get(self, request: Request, organization) -> Response:
9893
"concurrency": MAX_CONCURRENCY,
9994
"hashAlgorithm": HASH_ALGORITHM,
10095
"compression": ["gzip"],
101-
"accept": accept,
96+
"accept": CHUNK_UPLOAD_ACCEPT,
10297
}
10398
)
10499

tests/sentry/api/endpoints/test_chunk_upload.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,12 @@ def test_accept_with_feature_flag_enabled_and_disabled(self):
5555
)
5656
assert "artifact_bundles" not in response.data["accept"]
5757

58+
# This currently should not flip the flag!
5859
with self.feature({"organizations:artifact-bundles": True}):
5960
response = self.client.get(
6061
self.url, HTTP_AUTHORIZATION=f"Bearer {self.token.token}", format="json"
6162
)
62-
assert "artifact_bundles" in response.data["accept"]
63+
assert "artifact_bundles" not in response.data["accept"]
6364

6465
def test_relative_url_support(self):
6566
# Starting `[email protected]` we added a support for relative chunk-uploads urls

0 commit comments

Comments
 (0)