:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
feat(ci): split trunk upload from quarantine masking (#72542)
Georges-Antoine Assi5bc4e964015a
diff --git a/.depot/workflows/ci-backend.yml b/.depot/workflows/ci-backend.ymlindex 5223114e7c3a..e6dd1c991206 100644--- a/.depot/workflows/ci-backend.yml+++ b/.depot/workflows/ci-backend.yml@@ -22,10 +22,11 @@# failure" step owns the pass/fail verdict. The shadow strips all of it — no# Trunk posting from a non-blocking timing trial — and so also omits the test# steps' continue-on-error and that verdict step, letting each shard's test-# exit code be the verdict directly. Canonical now also gates each quarantine-# gate on the TRUNK_UPLOAD_ENABLED repo variable as a kill-switch; since the-# shadow strips the gate entirely, that variable is a no-op here and there is-# nothing to mirror)+# exit code be the verdict directly. Canonical gates each quarantine gate on the+# TRUNK_UPLOAD_ENABLED repo variable as an upload kill-switch, and its verdict step+# on TRUNK_QUARANTINE_ENABLED to decide whether known flakes are masked; since the+# shadow strips both the gate and the verdict step entirely, both variables are+# no-ops here and there is nothing to mirror)# - Per-test failure rollup: canonical's django_tests gate uploads product JUnit and, when a# test job fails, downloads that shard's JUnit to list the actual failing tests. The shadow# strips artifact uploads (above), so it has nothing to download and keeps the plaindiff --git a/.github/workflows/ci-backend.yml b/.github/workflows/ci-backend.ymlindex ebdb17db241d..8afe1483c2f0 100644--- a/.github/workflows/ci-backend.yml+++ b/.github/workflows/ci-backend.yml@@ -900,8 +900,10 @@ jobs:# Best-effort Trunk upload (continue-on-error); the "Fail on test failure" step below is# the verdict, so a Trunk outage can't red a passing shard. Internal PRs only (needs the# secret); cli-version pinned, not 'latest' (skips the release redirect).- # The TRUNK_UPLOAD_ENABLED repo variable is the kill-switch: when it is not 'true'- # this gate skips, so nothing uploads and no known flakes are quarantined.+ # TRUNK_UPLOAD_ENABLED is the master kill-switch: when it is not 'true' this gate+ # skips, so nothing uploads and no known flakes are quarantined. TRUNK_QUARANTINE_ENABLED+ # splits the two — it defaults off, so set it to 'true' to let the verdict step below mask+ # known flakes; otherwise any real failure reds the job (quarantining needs upload on too).- name: Quarantine gateid: quarantine_gatecontinue-on-error: true@@ -919,7 +921,7 @@ jobs:# also covers the skipped gate on fork/Dependabot. Sits before the timing-data upload so# a real failure still skips it, as it did before the test step got continue-on-error.- name: Fail on test failure- if: ${{ !cancelled() && steps.run-product-tests.outcome == 'failure' && steps.quarantine_gate.outcome != 'success' }}+ if: ${{ !cancelled() && steps.run-product-tests.outcome == 'failure' && (vars.TRUNK_QUARANTINE_ENABLED != 'true' || steps.quarantine_gate.outcome != 'success') }}shell: bashrun: exit 1@@ -2960,8 +2962,10 @@ jobs:# Best-effort Trunk upload (continue-on-error); the "Fail on test failure" step below is# the verdict, so a Trunk outage can't red a passing shard. Internal PRs only (needs the# secret); cli-version pinned, not 'latest' (skips the release redirect).- # The TRUNK_UPLOAD_ENABLED repo variable is the kill-switch: when it is not 'true'- # this gate skips, so nothing uploads and no known flakes are quarantined.+ # TRUNK_UPLOAD_ENABLED is the master kill-switch: when it is not 'true' this gate+ # skips, so nothing uploads and no known flakes are quarantined. TRUNK_QUARANTINE_ENABLED+ # splits the two — it defaults off, so set it to 'true' to let the verdict step below mask+ # known flakes; otherwise any real failure reds the job (quarantining needs upload on too).- name: Quarantine gate (Core)id: quarantine_gate_corecontinue-on-error: true@@ -2989,7 +2993,7 @@ jobs:# Verdict: red a real failure the gate didn't clear as a quarantined flake. != 'success'# also covers the skipped gate on fork/Dependabot. Passing shards never red here.- name: Fail on test failure- if: ${{ !cancelled() && ((steps.run-core-tests.outcome == 'failure' && steps.quarantine_gate_core.outcome != 'success') || (steps.run-temporal-tests.outcome == 'failure' && steps.quarantine_gate_temporal.outcome != 'success')) }}+ if: ${{ !cancelled() && ((steps.run-core-tests.outcome == 'failure' && (vars.TRUNK_QUARANTINE_ENABLED != 'true' || steps.quarantine_gate_core.outcome != 'success')) || (steps.run-temporal-tests.outcome == 'failure' && (vars.TRUNK_QUARANTINE_ENABLED != 'true' || steps.quarantine_gate_temporal.outcome != 'success'))) }}shell: bashrun: exit 1diff --git a/.github/workflows/ci-e2e-playwright.yml b/.github/workflows/ci-e2e-playwright.ymlindex ce7569e37701..008bc9323a83 100644--- a/.github/workflows/ci-e2e-playwright.yml+++ b/.github/workflows/ci-e2e-playwright.yml@@ -961,8 +961,10 @@ jobs:# Best-effort Trunk upload (continue-on-error); the "Fail on Playwright failure" step# below is the verdict, so a Trunk outage can't red a passing job. Internal PRs only# (needs the secret); cli-version pinned, not 'latest' (skips the release redirect).- # The TRUNK_UPLOAD_ENABLED repo variable is the kill-switch: when it is not 'true'- # this gate skips, so nothing uploads and no known flakes are quarantined.+ # TRUNK_UPLOAD_ENABLED is the master kill-switch: when it is not 'true' this gate+ # skips, so nothing uploads and no known flakes are quarantined. TRUNK_QUARANTINE_ENABLED+ # splits the two — it defaults off, so set it to 'true' to let the verdict step below mask+ # known flakes; otherwise any real failure reds the job (quarantining needs upload on too).- name: Quarantine gateid: quarantine_gatecontinue-on-error: true@@ -978,7 +980,7 @@ jobs:# Verdict: red a real failure the gate didn't clear as a quarantined flake. != 'success'# also covers the skipped gate on fork/Dependabot.- name: Fail on Playwright failure- if: ${{ !cancelled() && steps.playwright-tests.outcome == 'failure' && steps.quarantine_gate.outcome != 'success' }}+ if: ${{ !cancelled() && steps.playwright-tests.outcome == 'failure' && (vars.TRUNK_QUARANTINE_ENABLED != 'true' || steps.quarantine_gate.outcome != 'success') }}shell: bashrun: exit 1diff --git a/.github/workflows/ci-frontend.yml b/.github/workflows/ci-frontend.ymlindex d44d12fd0d19..b8f0c5a84489 100644--- a/.github/workflows/ci-frontend.yml+++ b/.github/workflows/ci-frontend.yml@@ -716,8 +716,10 @@ jobs:# the verdict, so a Trunk outage can't red a passing shard. FOSS and EE share test files,# so each segment uploads under its own variant. Internal PRs only (needs the secret);# cli-version pinned, not 'latest' (skips the release redirect).- # The TRUNK_UPLOAD_ENABLED repo variable is the kill-switch: when it is not 'true'- # this gate skips, so nothing uploads and no known flakes are quarantined.+ # TRUNK_UPLOAD_ENABLED is the master kill-switch: when it is not 'true' this gate+ # skips, so nothing uploads and no known flakes are quarantined. TRUNK_QUARANTINE_ENABLED+ # splits the two — it defaults off, so set it to 'true' to let the verdict step below mask+ # known flakes; otherwise any real failure reds the job (quarantining needs upload on too).- name: Quarantine gateid: quarantine_gatecontinue-on-error: true@@ -734,7 +736,7 @@ jobs:# Verdict: red a real failure the gate didn't clear as a quarantined flake. != 'success'# also covers the skipped gate on fork/Dependabot. Passing shards never red here.- name: Fail on jest failure- if: ${{ !cancelled() && steps.run-jest.outcome == 'failure' && steps.quarantine_gate.outcome != 'success' }}+ if: ${{ !cancelled() && steps.run-jest.outcome == 'failure' && (vars.TRUNK_QUARANTINE_ENABLED != 'true' || steps.quarantine_gate.outcome != 'success') }}shell: bashrun: exit 1@@ -776,8 +778,10 @@ jobs:# Best-effort Trunk upload (continue-on-error); the "Fail on jest failure" step below is# the verdict. See the jest job for the full rationale. cli-version pinned, not 'latest'.- # The TRUNK_UPLOAD_ENABLED repo variable is the kill-switch: when it is not 'true'- # this gate skips, so nothing uploads and no known flakes are quarantined.+ # TRUNK_UPLOAD_ENABLED is the master kill-switch: when it is not 'true' this gate+ # skips, so nothing uploads and no known flakes are quarantined. TRUNK_QUARANTINE_ENABLED+ # splits the two — it defaults off, so set it to 'true' to let the verdict step below mask+ # known flakes; otherwise any real failure reds the job (quarantining needs upload on too).- name: Quarantine gateid: quarantine_gatecontinue-on-error: true@@ -792,7 +796,7 @@ jobs:previous-step-outcome: ${{ steps.run-jest.outcome }}token: ${{ secrets.TRUNK_API_TOKEN }}- name: Fail on jest failure- if: ${{ !cancelled() && steps.run-jest.outcome == 'failure' && steps.quarantine_gate.outcome != 'success' }}+ if: ${{ !cancelled() && steps.run-jest.outcome == 'failure' && (vars.TRUNK_QUARANTINE_ENABLED != 'true' || steps.quarantine_gate.outcome != 'success') }}shell: bashrun: exit 1diff --git a/.github/workflows/ci-llm-gateway.yml b/.github/workflows/ci-llm-gateway.ymlindex 7275f8bb7b5f..a0b056f98720 100644--- a/.github/workflows/ci-llm-gateway.yml+++ b/.github/workflows/ci-llm-gateway.yml@@ -103,8 +103,10 @@ jobs:# Best-effort Trunk upload (continue-on-error); the "Fail on test failure" step below is# the verdict, so a Trunk outage can't red a passing job. Internal PRs only (needs the# secret); cli-version pinned, not 'latest' (skips the release redirect).- # The TRUNK_UPLOAD_ENABLED repo variable is the kill-switch: when it is not 'true'- # this gate skips, so nothing uploads and no known flakes are quarantined.+ # TRUNK_UPLOAD_ENABLED is the master kill-switch: when it is not 'true' this gate+ # skips, so nothing uploads and no known flakes are quarantined. TRUNK_QUARANTINE_ENABLED+ # splits the two — it defaults off, so set it to 'true' to let the verdict step below mask+ # known flakes; otherwise any real failure reds the job (quarantining needs upload on too).- name: Quarantine gateid: quarantine_gatecontinue-on-error: true@@ -121,7 +123,7 @@ jobs:# Verdict: red a real failure the gate didn't clear as a quarantined flake. != 'success'# also covers the skipped gate on fork/Dependabot.- name: Fail on test failure- if: ${{ !cancelled() && steps.run-tests.outcome == 'failure' && steps.quarantine_gate.outcome != 'success' }}+ if: ${{ !cancelled() && steps.run-tests.outcome == 'failure' && (vars.TRUNK_QUARANTINE_ENABLED != 'true' || steps.quarantine_gate.outcome != 'success') }}shell: bashrun: exit 1diff --git a/.github/workflows/ci-mcp.yml b/.github/workflows/ci-mcp.ymlindex 06bf839f4059..60717dea18f6 100644--- a/.github/workflows/ci-mcp.yml+++ b/.github/workflows/ci-mcp.yml@@ -572,8 +572,10 @@ jobs:# Best-effort Trunk upload (continue-on-error); the "Fail on test failure" step below is# the verdict, so a Trunk outage can't red a passing job. Internal PRs only (needs the# secret); cli-version pinned, not 'latest' (skips the release redirect).- # The TRUNK_UPLOAD_ENABLED repo variable is the kill-switch: when it is not 'true'- # this gate skips, so nothing uploads and no known flakes are quarantined.+ # TRUNK_UPLOAD_ENABLED is the master kill-switch: when it is not 'true' this gate+ # skips, so nothing uploads and no known flakes are quarantined. TRUNK_QUARANTINE_ENABLED+ # splits the two — it defaults off, so set it to 'true' to let the verdict step below mask+ # known flakes; otherwise any real failure reds the job (quarantining needs upload on too).- name: Quarantine gateid: quarantine_gatecontinue-on-error: true@@ -591,7 +593,7 @@ jobs:# also covers the skipped gate on fork/Dependabot. Sits before the logs-on-failure steps# so a real failure still triggers them via failure().- name: Fail on test failure- if: ${{ !cancelled() && steps.run-integration-tests.outcome == 'failure' && steps.quarantine_gate.outcome != 'success' }}+ if: ${{ !cancelled() && steps.run-integration-tests.outcome == 'failure' && (vars.TRUNK_QUARANTINE_ENABLED != 'true' || steps.quarantine_gate.outcome != 'success') }}shell: bashrun: exit 1diff --git a/.github/workflows/ci-nodejs.yml b/.github/workflows/ci-nodejs.ymlindex 1b6b8ac9f4fc..0148e73b72d7 100644--- a/.github/workflows/ci-nodejs.yml+++ b/.github/workflows/ci-nodejs.yml@@ -403,8 +403,10 @@ jobs:# Best-effort Trunk upload (continue-on-error); the "Fail on test failure" step below is# the verdict, so a Trunk outage can't red a passing shard. Internal PRs only (needs the# secret); cli-version pinned, not 'latest' (skips the release redirect).- # The TRUNK_UPLOAD_ENABLED repo variable is the kill-switch: when it is not 'true'- # this gate skips, so nothing uploads and no known flakes are quarantined.+ # TRUNK_UPLOAD_ENABLED is the master kill-switch: when it is not 'true' this gate+ # skips, so nothing uploads and no known flakes are quarantined. TRUNK_QUARANTINE_ENABLED+ # splits the two — it defaults off, so set it to 'true' to let the verdict step below mask+ # known flakes; otherwise any real failure reds the job (quarantining needs upload on too).- name: Quarantine gateid: quarantine_gatecontinue-on-error: true@@ -424,7 +426,7 @@ jobs:# also covers the skipped gate on fork/Dependabot. Sits before the logs-on-failure step# so a real failure still triggers it via failure().- name: Fail on test failure- if: ${{ !cancelled() && (steps.run-jest.outcome == 'failure' || steps.run-parity.outcome == 'failure') && steps.quarantine_gate.outcome != 'success' }}+ if: ${{ !cancelled() && (steps.run-jest.outcome == 'failure' || steps.run-parity.outcome == 'failure') && (vars.TRUNK_QUARANTINE_ENABLED != 'true' || steps.quarantine_gate.outcome != 'success') }}shell: bashrun: exit 1