From 5a6f6c457eee0c0ad2a8c670c37186e656a40df0 Mon Sep 17 00:00:00 2001 From: ellisonmarks Date: Tue, 18 Nov 2025 01:39:49 -0800 Subject: [PATCH 1/3] Fixes profiles export source prefix to end in slash `google.api_core.exceptions.InvalidArgument: 400 GCS source Path argument must end with '/'` --- src/sentry/profiles/data_export.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sentry/profiles/data_export.py b/src/sentry/profiles/data_export.py index 07a5cacd88b532..791c51c67b9d28 100644 --- a/src/sentry/profiles/data_export.py +++ b/src/sentry/profiles/data_export.py @@ -44,7 +44,7 @@ def export_profiles_data( gcp_project_id=gcp_project_id, transfer_job_name=None, source_bucket=source_bucket, - source_prefix=f"{organization_id}", + source_prefix=f"{organization_id}/", destination_bucket=destination_bucket, destination_prefix=destination_prefix, notification_topic=pubsub_topic_name, From a2967ea0291a5b50a4300d2bce5ee90f798d55d5 Mon Sep 17 00:00:00 2001 From: Francesco Vigliaturo Date: Tue, 18 Nov 2025 10:52:33 +0100 Subject: [PATCH 2/3] add missing trailing slash to source_prefix in export_replay_blob_data --- src/sentry/replays/data_export.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sentry/replays/data_export.py b/src/sentry/replays/data_export.py index 43beb5938ca811..1e3dff441e63e4 100644 --- a/src/sentry/replays/data_export.py +++ b/src/sentry/replays/data_export.py @@ -593,7 +593,7 @@ def export_replay_blob_data[T]( gcp_project_id=gcp_project_id, transfer_job_name=None, source_bucket=source_bucket, - source_prefix=f"{retention_days}/{project_id}", + source_prefix=f"{retention_days}/{project_id}/", destination_bucket=destination_bucket, destination_prefix=destination_prefix, notification_topic=pubsub_topic_name, From 2fa30ae8f2b828a8ccb66ba71cf7e36c3950b01c Mon Sep 17 00:00:00 2001 From: Francesco Vigliaturo Date: Tue, 18 Nov 2025 11:52:09 +0100 Subject: [PATCH 3/3] fix replay tests --- tests/sentry/replays/unit/test_data_export.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/sentry/replays/unit/test_data_export.py b/tests/sentry/replays/unit/test_data_export.py index 831f0921d7dd37..5f9dfa8949796b 100644 --- a/tests/sentry/replays/unit/test_data_export.py +++ b/tests/sentry/replays/unit/test_data_export.py @@ -109,6 +109,6 @@ def test_export_replay_blob_data() -> None: # Assert a job is created for each retention-period. assert len(jobs) == 3 - assert jobs[0].transfer_job.transfer_spec.gcs_data_source.path == "30/1" - assert jobs[1].transfer_job.transfer_spec.gcs_data_source.path == "60/1" - assert jobs[2].transfer_job.transfer_spec.gcs_data_source.path == "90/1" + assert jobs[0].transfer_job.transfer_spec.gcs_data_source.path == "30/1/" + assert jobs[1].transfer_job.transfer_spec.gcs_data_source.path == "60/1/" + assert jobs[2].transfer_job.transfer_spec.gcs_data_source.path == "90/1/"