Skip to content

: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.

chore(ci): route trunk uploads to test collections (#108517)

Raúl Negrón-Otero80343aef6f47
diff --git a/.depot/actions/trunk-quarantine-gate/action.yml b/.depot/actions/trunk-quarantine-gate/action.yml
index 23f3efa63e2e..1e76939d60b7 100644
--- a/.depot/actions/trunk-quarantine-gate/action.yml
+++ b/.depot/actions/trunk-quarantine-gate/action.yml
@@ -15,6 +15,9 @@ inputs:
description: 'Trunk variant, for suites whose shards upload under one name'
required: false
default: ''
+ test-collection-id:
+ description: 'Trunk test collection that owns these tests'
+ required: true
runs:
using: 'composite'
@@ -36,9 +39,13 @@ runs:
id: upload
continue-on-error: true
uses: trunk-io/analytics-uploader@385f1ccdf345b4532dc4b6c665dd432b702b8e28 # v2.1.2
+ env:
+ # Link to the repo view: a new collection has no history yet.
+ TRUNK_HIDE_TEST_COLLECTION_LINKS: 'true'
with:
junit-paths: ${{ inputs.junit-paths }}
org-slug: posthog-inc
+ test-collection-id: ${{ inputs.test-collection-id }}
variant: ${{ inputs.variant }}
# Pinned rather than 'latest', which costs an extra github.com request to follow the release redirect.
cli-version: '0.15.4'
@@ -61,9 +68,12 @@ runs:
if: ${{ steps.upload.outcome == 'failure' && inputs.previous-step-outcome == 'success' }}
continue-on-error: true
uses: trunk-io/analytics-uploader@385f1ccdf345b4532dc4b6c665dd432b702b8e28 # v2.1.2
+ env:
+ TRUNK_HIDE_TEST_COLLECTION_LINKS: 'true'
with:
junit-paths: ${{ inputs.junit-paths }}
org-slug: posthog-inc
+ test-collection-id: ${{ inputs.test-collection-id }}
variant: ${{ inputs.variant }}
cli-version: '0.15.4'
quarantine: true
diff --git a/.depot/workflows/ci-backend.yml b/.depot/workflows/ci-backend.yml
index 3e653dd9e4cc..7725dbdeefd5 100644
--- a/.depot/workflows/ci-backend.yml
+++ b/.depot/workflows/ci-backend.yml
@@ -1499,6 +1499,7 @@ jobs:
uses: ./.github/actions/trunk-quarantine-gate
with:
junit-paths: trunk-junit/junit-product-*.xml
+ test-collection-id: C0LrorjW # backend-product
# A native-JSON leg uploads under its own variant, so a failure in that mode
# does not read as a flake of the legacy test with the same id.
variant: ${{ matrix.new-events-schema && 'events-json' || '' }}
@@ -3962,9 +3963,12 @@ jobs:
continue-on-error: true
if: ${{ needs.wait-for-handoff.outputs.handed_off == 'true' && (!cancelled() && matrix.segment == 'Core' && needs.changes.outputs.backend == 'true' && env.RUNS_ON_INTERNAL_PR == 'true' && github.repository == 'PostHog/posthog' && github.actor != 'dependabot[bot]' && vars.TRUNK_UPLOAD_ENABLED == 'true') }}
uses: trunk-io/analytics-uploader@385f1ccdf345b4532dc4b6c665dd432b702b8e28 # v2.1.2
+ env:
+ TRUNK_HIDE_TEST_COLLECTION_LINKS: 'true'
with:
junit-paths: junit-core.xml,junit-core-retry-failures.xml
org-slug: posthog-inc
+ test-collection-id: AA6dvTdI # backend-core
# Non-default rows upload under their own variant, so a failure only that mode
# hits does not quarantine the default test with the same id.
variant: ${{ matrix.compat && format('compat-{0}', matrix.clickhouse-server-image) || matrix.person-on-events && (matrix.new-events-schema && 'poe-off-events-json' || 'poe-off') || matrix.new-events-schema && 'events-json' || '' }}
@@ -3978,9 +3982,12 @@ jobs:
continue-on-error: true
if: ${{ needs.wait-for-handoff.outputs.handed_off == 'true' && (!cancelled() && matrix.segment == 'Temporal' && needs.changes.outputs.backend == 'true' && env.RUNS_ON_INTERNAL_PR == 'true' && github.repository == 'PostHog/posthog' && github.actor != 'dependabot[bot]' && vars.TRUNK_UPLOAD_ENABLED == 'true') }}
uses: trunk-io/analytics-uploader@385f1ccdf345b4532dc4b6c665dd432b702b8e28 # v2.1.2
+ env:
+ TRUNK_HIDE_TEST_COLLECTION_LINKS: 'true'
with:
junit-paths: junit-temporal.xml,junit-temporal-retry-failures.xml
org-slug: posthog-inc
+ test-collection-id: smyQjxZ3 # backend-temporal
# A native-JSON row uploads under its own variant, so a failure in that mode
# does not read as a flake of the legacy test with the same id.
variant: ${{ matrix.new-events-schema && 'events-json' || '' }}
diff --git a/.github/actions/trunk-quarantine-gate/action.yml b/.github/actions/trunk-quarantine-gate/action.yml
index 23f3efa63e2e..1e76939d60b7 100644
--- a/.github/actions/trunk-quarantine-gate/action.yml
+++ b/.github/actions/trunk-quarantine-gate/action.yml
@@ -15,6 +15,9 @@ inputs:
description: 'Trunk variant, for suites whose shards upload under one name'
required: false
default: ''
+ test-collection-id:
+ description: 'Trunk test collection that owns these tests'
+ required: true
runs:
using: 'composite'
@@ -36,9 +39,13 @@ runs:
id: upload
continue-on-error: true
uses: trunk-io/analytics-uploader@385f1ccdf345b4532dc4b6c665dd432b702b8e28 # v2.1.2
+ env:
+ # Link to the repo view: a new collection has no history yet.
+ TRUNK_HIDE_TEST_COLLECTION_LINKS: 'true'
with:
junit-paths: ${{ inputs.junit-paths }}
org-slug: posthog-inc
+ test-collection-id: ${{ inputs.test-collection-id }}
variant: ${{ inputs.variant }}
# Pinned rather than 'latest', which costs an extra github.com request to follow the release redirect.
cli-version: '0.15.4'
@@ -61,9 +68,12 @@ runs:
if: ${{ steps.upload.outcome == 'failure' && inputs.previous-step-outcome == 'success' }}
continue-on-error: true
uses: trunk-io/analytics-uploader@385f1ccdf345b4532dc4b6c665dd432b702b8e28 # v2.1.2
+ env:
+ TRUNK_HIDE_TEST_COLLECTION_LINKS: 'true'
with:
junit-paths: ${{ inputs.junit-paths }}
org-slug: posthog-inc
+ test-collection-id: ${{ inputs.test-collection-id }}
variant: ${{ inputs.variant }}
cli-version: '0.15.4'
quarantine: true
diff --git a/.github/workflows/ci-backend.yml b/.github/workflows/ci-backend.yml
index 81235fa68988..d1467834506a 100644
--- a/.github/workflows/ci-backend.yml
+++ b/.github/workflows/ci-backend.yml
@@ -1285,6 +1285,7 @@ jobs:
uses: ./.github/actions/trunk-quarantine-gate
with:
junit-paths: trunk-junit/junit-product-*.xml
+ test-collection-id: C0LrorjW # backend-product
# A native-JSON leg uploads under its own variant, so a failure in that mode
# does not read as a flake of the legacy test with the same id.
variant: ${{ matrix.new-events-schema && 'events-json' || '' }}
@@ -4004,9 +4005,12 @@ jobs:
continue-on-error: true
if: ${{ !cancelled() && matrix.segment == 'Core' && needs.changes.outputs.backend == 'true' && env.RUNS_ON_INTERNAL_PR == 'true' && github.repository == 'PostHog/posthog' && github.actor != 'dependabot[bot]' && vars.TRUNK_UPLOAD_ENABLED == 'true' }}
uses: trunk-io/analytics-uploader@385f1ccdf345b4532dc4b6c665dd432b702b8e28 # v2.1.2
+ env:
+ TRUNK_HIDE_TEST_COLLECTION_LINKS: 'true'
with:
junit-paths: junit-core.xml,junit-core-retry-failures.xml
org-slug: posthog-inc
+ test-collection-id: AA6dvTdI # backend-core
# Non-default rows upload under their own variant, so a failure only that mode
# hits does not quarantine the default test with the same id.
variant: ${{ matrix.compat && format('compat-{0}', matrix.clickhouse-server-image) || matrix.person-on-events && (matrix.new-events-schema && 'poe-off-events-json' || 'poe-off') || matrix.new-events-schema && 'events-json' || '' }}
@@ -4019,9 +4023,12 @@ jobs:
continue-on-error: true
if: ${{ !cancelled() && matrix.segment == 'Temporal' && needs.changes.outputs.backend == 'true' && env.RUNS_ON_INTERNAL_PR == 'true' && github.repository == 'PostHog/posthog' && github.actor != 'dependabot[bot]' && vars.TRUNK_UPLOAD_ENABLED == 'true' }}
uses: trunk-io/analytics-uploader@385f1ccdf345b4532dc4b6c665dd432b702b8e28 # v2.1.2
+ env:
+ TRUNK_HIDE_TEST_COLLECTION_LINKS: 'true'
with:
junit-paths: junit-temporal.xml,junit-temporal-retry-failures.xml
org-slug: posthog-inc
+ test-collection-id: smyQjxZ3 # backend-temporal
# A native-JSON row uploads under its own variant, so a failure in that mode
# does not read as a flake of the legacy test with the same id.
variant: ${{ matrix.new-events-schema && 'events-json' || '' }}
diff --git a/.github/workflows/ci-e2e-playwright.yml b/.github/workflows/ci-e2e-playwright.yml
index a67f65d216aa..4f2d8d004eb8 100644
--- a/.github/workflows/ci-e2e-playwright.yml
+++ b/.github/workflows/ci-e2e-playwright.yml
@@ -1143,9 +1143,12 @@ jobs:
continue-on-error: true
if: ${{ !cancelled() && env.RUNS_ON_INTERNAL_PR == 'true' && github.repository == 'PostHog/posthog' && github.actor != 'dependabot[bot]' && vars.TRUNK_UPLOAD_ENABLED == 'true' }}
uses: trunk-io/analytics-uploader@385f1ccdf345b4532dc4b6c665dd432b702b8e28 # v2.1.2
+ env:
+ TRUNK_HIDE_TEST_COLLECTION_LINKS: 'true'
with:
junit-paths: playwright/junit-results.xml
org-slug: posthog-inc
+ test-collection-id: kF88Gx2u # e2e-playwright
cli-version: '0.15.4'
quarantine: true
previous-step-outcome: ${{ steps.playwright-tests.outcome }}
diff --git a/.github/workflows/ci-frontend.yml b/.github/workflows/ci-frontend.yml
index e81bfc3986b8..4d9f348eaf8c 100644
--- a/.github/workflows/ci-frontend.yml
+++ b/.github/workflows/ci-frontend.yml
@@ -992,6 +992,7 @@ jobs:
uses: ./.github/actions/trunk-quarantine-gate
with:
junit-paths: junit-results/junit-${{ matrix.segment }}-${{ matrix.chunk }}.xml
+ test-collection-id: OZ6hVJ5z # frontend-jest
previous-step-outcome: ${{ steps.run-jest.outcome }}
token: ${{ secrets.TRUNK_API_TOKEN }}
# Verdict: red a real failure the gate didn't clear as a quarantined flake. != 'success'
@@ -1062,6 +1063,7 @@ jobs:
uses: ./.github/actions/trunk-quarantine-gate
with:
junit-paths: junit-results/junit-replay-shared.xml
+ test-collection-id: OZ6hVJ5z # frontend-jest
variant: replay-shared
previous-step-outcome: ${{ steps.run-jest.outcome }}
token: ${{ secrets.TRUNK_API_TOKEN }}
diff --git a/.github/workflows/ci-mcp.yml b/.github/workflows/ci-mcp.yml
index 5390feb865bb..957f9a2aaabb 100644
--- a/.github/workflows/ci-mcp.yml
+++ b/.github/workflows/ci-mcp.yml
@@ -761,6 +761,7 @@ jobs:
uses: ./.github/actions/trunk-quarantine-gate
with:
junit-paths: services/mcp/junit-integration.xml
+ test-collection-id: Nt38b1Ej # mcp
previous-step-outcome: ${{ steps.run-integration-tests.outcome }}
token: ${{ secrets.TRUNK_API_TOKEN }}
diff --git a/.github/workflows/ci-nodejs.yml b/.github/workflows/ci-nodejs.yml
index d58b4838139f..596e3947233e 100644
--- a/.github/workflows/ci-nodejs.yml
+++ b/.github/workflows/ci-nodejs.yml
@@ -726,6 +726,7 @@ jobs:
uses: ./.github/actions/trunk-quarantine-gate
with:
junit-paths: junit-results/junit-*.xml
+ test-collection-id: ugvRjGsw # nodejs
# Worst of the two test steps: the gate must know the run failed even when
# only the parity step (shard 1) did. A skipped parity step counts as success.
previous-step-outcome: ${{ (steps.run-jest.outcome == 'failure' || steps.run-parity.outcome == 'failure') && 'failure' || 'success' }}
diff --git a/.github/workflows/ci-rust.yml b/.github/workflows/ci-rust.yml
index 162e5ce6a1f2..8b1d986a37ee 100644
--- a/.github/workflows/ci-rust.yml
+++ b/.github/workflows/ci-rust.yml
@@ -589,6 +589,7 @@ jobs:
uses: ./.github/actions/trunk-quarantine-gate
with:
junit-paths: rust/junit-nextest-*.xml
+ test-collection-id: TewkWR1w # rust
previous-step-outcome: ${{ steps.run-tests.outcome }}
token: ${{ secrets.TRUNK_API_TOKEN }}
diff --git a/.github/workflows/ci-storybook.yml b/.github/workflows/ci-storybook.yml
index 8853ddc885cf..71f9ee2ecfd0 100644
--- a/.github/workflows/ci-storybook.yml
+++ b/.github/workflows/ci-storybook.yml
@@ -802,6 +802,7 @@ jobs:
uses: ./.github/actions/trunk-quarantine-gate
with:
junit-paths: common/storybook/junit.xml
+ test-collection-id: P3SjL3vy # storybook
variant: ${{ matrix.browser }}
previous-step-outcome: ${{ steps.test-runner.outcome }}
token: ${{ secrets.TRUNK_API_TOKEN }}