From aae4fa39c6f90ca524d49c876b725b13527889e8 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 7 May 2026 19:44:23 +0000 Subject: [PATCH] ci: use different git repo id for releases (#17942) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description When a flaky test is detected on a release branch (e.g. `4.8`, `4.10`), it is quarantined across **all** branches — including `main`. This causes problems in two directions: 1. **Release branches don't receive flaky-test-fix backports from `main`**, so a test that gets fixed and unquarantined on `main` may remain quarantined (or vice versa) on a release branch indefinitely. 2. **New flakes introduced during release activity** (cherry-picks, backports, release-specific patches) pollute the main pool and can suppress test failures on `main` and feature branches. This change uses a separate [Datadog Test Optimization](https://docs.datadoghq.com/tests/) Flaky Test Management pool for release branches by overriding `DD_GIT_REPOSITORY_URL` to `https://github.com/DataDog/dd-trace-py-release.git` in GitLab CI pipelines that run on release branches. The Datadog backend uses `git.repository_url` (surfaced in the UI as `@git.repository.id_v2`) as the partition key for Flaky Test Management. By giving release-branch pipelines a distinct URL, their quarantine list is fully independent from the one used by `main`, merge queues, and feature branches. ### How it works - **Release branches** (`X.Y` / `X.YZ` pattern, e.g. `4.8`, `4.10`): `DD_GIT_REPOSITORY_URL` is set to `https://github.com/DataDog/dd-trace-py-release.git` vian`workflow:rules:variables`, which overrides the global variable for the entire pipeline. - **All other pipelines** (`main`, merge queues, feature branches): continue using `https://github.com/DataDog/dd-trace-py.git` unchanged. ## Testing The change is CI-only. It can be validated by triggering a pipeline on a release branch (e.g. `4.8`) and confirming that test results appear under `@git.repository.id_v2:github.com/datadog/dd-trace-py-release` in the Datadog Test Optimization UI, while a pipeline on `main` still shows `@git.repository.id_v2:github.com/datadog/dd-trace-py`. ## Risks - **Quarantine list starts empty for release branches.** Any tests already quarantined on release branches under the old pool ID will not carry over — they will re-run and be re-detected as flaky. This is a one-time, bounded cost. - No application code is changed; no test behaviour is affected outside of the flaky-test quarantine logic. ## Additional Notes `workflow:rules:variables` in GitLab CI takes precedence over the global `variables:` block, so the override is not silently clobbered. `DD_GIT_REPOSITORY_URL` is not redefined in any included job template or project-level CI/CD variable, so the behaviour is deterministic. Co-authored-by: federico.mon (cherry picked from commit e3bdccd354c5f05b50df073d20e5277102287440) Co-authored-by: Federico Mon --- .gitlab-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 636c73386ab..32ca3694ce0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -41,6 +41,8 @@ workflow: auto_cancel: on_new_commit: none - if: !reference [.is_release_branch] + variables: + DD_GIT_REPOSITORY_URL: "https://github.com/DataDog/dd-trace-py-release.git" auto_cancel: on_new_commit: none - when: always