Skip to content

Add logic to replicate file content of Synthetics Tests with file uploads#477

Open
melkouri wants to merge 3 commits intomainfrom
malak.elkouri/SYNTH-25085/support-synthetics-file-replication-for-ddr
Open

Add logic to replicate file content of Synthetics Tests with file uploads#477
melkouri wants to merge 3 commits intomainfrom
malak.elkouri/SYNTH-25085/support-synthetics-file-replication-for-ddr

Conversation

@melkouri
Copy link
Contributor

@melkouri melkouri commented Mar 17, 2026

Requirements for Contributing to this repository

  • Fill out the template below. Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the maintainers' discretion.
  • The pull request must only fix one issue, or add one feature, at the time.
  • The pull request must update the test suite to demonstrate the changed functionality.
  • After you create the pull request, all status checks must be pass before a maintainer reviews your contribution. For more details, please see CONTRIBUTING.

What does this PR do?

This PR adds support for replicating file uploads when syncing Synthetics tests between orgs.
Previously, tests with file uploads (API tests with multipart/form-data, multistep API tests, and browser tests with uploadFiles steps) would fail with 400 errors because we copied these tests that reference Bucket Keys in R1 not existing in R2 infra.

Description of the Change

When a Synthetics test contains uploaded files, the sync tool now:

  1. Downloads file content from the source org via the presigned URL endpoint (/api/v2/synthetics/tests/{source_public_id}/files/download), which returns a presigned S3 URL for each file's bucketKey.
  2. Injects the file content inline into the resource payload (replacing bucketKey with content + size), so the destination API stores the file in its own R2 and generates a new bucketKey.
  3. Handles all three file locations in the Synthetics test schema:
    • config.request.files[] — single-step API tests
    • config.steps[].request.files[] — multistep API tests
    • steps[].params.files[] — browser test upload steps

Depends on Add endpoints to download and upload a file into Synthetics buckets for DDR

Alternate Designs

Possible Drawbacks

Verification Process

Run the dd-sync-cli on R1 for Synthetics tests with file uploads
image

They have correctly been replicated in R2
image

You can compare the file's content from the AWS console
For R1 bucket path
For R2 bucket path

Additional Notes

Release Notes

Review checklist (to be filled by reviewers)

  • Feature or bug fix MUST have appropriate tests (unit, integration, etc...)
  • PR title must be written as a CHANGELOG entry (see why)
  • Files changes must correspond to the primary purpose of the PR as described in the title (small unrelated changes should have their own PR)
  • PR must have one changelog/ label attached. If applicable it should have the backward-incompatible label attached.
  • PR should not have do-not-merge/ label attached.
  • If Applicable, issue must have kind/ and severity/ labels attached at least.

@melkouri melkouri changed the title add logic to replicate file content Add logic to replicate file content of Synthetics Tests with file uploads Mar 18, 2026
@melkouri melkouri marked this pull request as ready for review March 19, 2026 13:42
@melkouri melkouri requested a review from a team as a code owner March 19, 2026 13:42
@melkouri
Copy link
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants