Skip to content
This repository was archived by the owner on Jun 13, 2025. It is now read-only.

Commit 98d2583

Browse files
add other var
1 parent 4ca2ce8 commit 98d2583

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

upload/tests/views/test_bundle_analysis.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ def test_upload_bundle_analysis_success(db, client, mocker, mock_redis):
104104

105105

106106
@pytest.mark.django_db(databases={"default", "timeseries"})
107+
@override_settings(SHELTER_SHARED_SECRET="shelter-shared-secret")
107108
def test_upload_bundle_analysis_success_shelter(db, client, mocker, mock_redis):
108109
upload = mocker.patch.object(TaskService, "upload")
109110
mock_sentry_metrics = mocker.patch(
@@ -131,6 +132,7 @@ def test_upload_bundle_analysis_success_shelter(db, client, mocker, mock_redis):
131132
"service": "test-service",
132133
"compareSha": "6fd5b89357fc8cdf34d6197549ac7c6d7e5aaaaa",
133134
"storage_path": "shelter/test/path.txt",
135+
"upload_external_id": "test-47078f85-2cee-4511-b38d-183c334ef43b",
134136
},
135137
format="json",
136138
headers={"User-Agent": "codecov-cli/0.4.7"},

upload/views/bundle_analysis.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ class UploadSerializer(serializers.Serializer):
5050
compareSha = serializers.CharField(required=False, allow_null=True)
5151
git_service = serializers.CharField(required=False, allow_null=True)
5252
storage_path = serializers.CharField(required=False, allow_null=True)
53+
upload_external_id = serializers.CharField(required=False, allow_null=True)
5354

5455

5556
class BundleAnalysisView(APIView, ShelterMixin):
@@ -118,8 +119,9 @@ def post(self, request: HttpRequest) -> Response:
118119
)
119120

120121
storage_path = data.get("storage_path", None)
122+
upload_external_id = data.get("upload_external_id", None)
121123
url = None
122-
if storage_path is None or not self.is_shelter_request():
124+
if not self.is_shelter_request():
123125
upload_external_id = str(uuid.uuid4())
124126
storage_path = StoragePaths.upload.path(upload_key=upload_external_id)
125127
archive_service = ArchiveService(repo)

0 commit comments

Comments
 (0)