Skip to content

Commit b878791

Browse files
authored
Fixes profiles export source prefix to end in slash (#103509)
`google.api_core.exceptions.InvalidArgument: 400 GCS source Path argument must end with '/'`
1 parent 8600dbd commit b878791

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/sentry/profiles/data_export.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def export_profiles_data(
4444
gcp_project_id=gcp_project_id,
4545
transfer_job_name=None,
4646
source_bucket=source_bucket,
47-
source_prefix=f"{organization_id}",
47+
source_prefix=f"{organization_id}/",
4848
destination_bucket=destination_bucket,
4949
destination_prefix=destination_prefix,
5050
notification_topic=pubsub_topic_name,

src/sentry/replays/data_export.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,7 @@ def export_replay_blob_data[T](
593593
gcp_project_id=gcp_project_id,
594594
transfer_job_name=None,
595595
source_bucket=source_bucket,
596-
source_prefix=f"{retention_days}/{project_id}",
596+
source_prefix=f"{retention_days}/{project_id}/",
597597
destination_bucket=destination_bucket,
598598
destination_prefix=destination_prefix,
599599
notification_topic=pubsub_topic_name,

tests/sentry/replays/unit/test_data_export.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,6 @@ def test_export_replay_blob_data() -> None:
109109

110110
# Assert a job is created for each retention-period.
111111
assert len(jobs) == 3
112-
assert jobs[0].transfer_job.transfer_spec.gcs_data_source.path == "30/1"
113-
assert jobs[1].transfer_job.transfer_spec.gcs_data_source.path == "60/1"
114-
assert jobs[2].transfer_job.transfer_spec.gcs_data_source.path == "90/1"
112+
assert jobs[0].transfer_job.transfer_spec.gcs_data_source.path == "30/1/"
113+
assert jobs[1].transfer_job.transfer_spec.gcs_data_source.path == "60/1/"
114+
assert jobs[2].transfer_job.transfer_spec.gcs_data_source.path == "90/1/"

0 commit comments

Comments
 (0)