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): clarify backend gate (#61890)

Raúl Negrón-Otero58adf914e292
diff --git a/.depot/workflows/ci-backend.yml b/.depot/workflows/ci-backend.yml
index 3bce11474a0a..ccdbde1ca392 100644
--- a/.depot/workflows/ci-backend.yml
+++ b/.depot/workflows/ci-backend.yml
@@ -1179,46 +1179,47 @@ jobs:
# lone runner when the shadow is off.
if: always() && vars.CI_ENABLE_DEPOT_SHADOW == 'true'
steps:
- - name: Check matrix outcome
+ - name: Summarize dependency results
run: |
- # The `needs.django.result` will be 'success' only if all jobs in the matrix succeeded.
- # Otherwise, it will be 'failure'.
- if [[ "${{ needs.django.result }}" != "success" && "${{ needs.django.result }}" != "skipped" ]]; then
- echo "One or more jobs in the Django test matrix failed."
- exit 1
- fi
+ {
+ echo "### Backend CI dependency results"
+ echo "| Dependency | Result |"
+ echo "| --- | --- |"
+ echo "| django | ${{ needs.django.result }} |"
+ echo "| check-migrations | ${{ needs.check-migrations.result }} |"
+ echo "| async-migrations | ${{ needs.async-migrations.result }} |"
+ echo "| repo-checks | ${{ needs.repo-checks.result }} |"
+ echo "| turbo-discover | ${{ needs.turbo-discover.result }} |"
+ echo "| turbo-tests | ${{ needs.turbo-tests.result }} |"
+ } | tee -a "$GITHUB_STEP_SUMMARY"
- # Check migration validation - must pass for Django Tests to be green
- if [[ "${{ needs.check-migrations.result }}" != "success" && "${{ needs.check-migrations.result }}" != "skipped" ]]; then
- echo "Migration checks failed."
- exit 1
- fi
+ - name: Check dependency results
+ run: |
+ check_required_result() {
+ local label="$1"
+ local result="$2"
- # Check async migrations - must pass for Django Tests to be green
- if [[ "${{ needs.async-migrations.result }}" != "success" && "${{ needs.async-migrations.result }}" != "skipped" ]]; then
- echo "Async migrations tests failed."
- exit 1
- fi
+ if [[ "$result" == "success" || "$result" == "skipped" ]]; then
+ return
+ fi
- # Check repo checks (product lint, IDOR, operator parity, tach)
- if [[ "${{ needs.repo-checks.result }}" != "success" && "${{ needs.repo-checks.result }}" != "skipped" ]]; then
- echo "Repo checks failed."
- exit 1
- fi
+ if [[ "$result" == "cancelled" ]]; then
+ echo "::error::$label was cancelled or timed out."
+ else
+ echo "::error::$label failed with result '$result'."
+ fi
- # Check Turbo discover - must pass for Django Tests to be green
- if [[ "${{ needs.turbo-discover.result }}" != "success" && "${{ needs.turbo-discover.result }}" != "skipped" ]]; then
- echo "Turbo discover failed."
exit 1
- fi
+ }
- # Check Turbo tests (products) - must pass for Django Tests to be green
- if [[ "${{ needs.turbo-tests.result }}" != "success" && "${{ needs.turbo-tests.result }}" != "skipped" ]]; then
- echo "Turbo tests failed."
- exit 1
- fi
+ check_required_result "Django test matrix" "${{ needs.django.result }}"
+ check_required_result "Migration checks" "${{ needs.check-migrations.result }}"
+ check_required_result "Async migration tests" "${{ needs.async-migrations.result }}"
+ check_required_result "Repo checks" "${{ needs.repo-checks.result }}"
+ check_required_result "Turbo discover" "${{ needs.turbo-discover.result }}"
+ check_required_result "Product/Turbo tests" "${{ needs.turbo-tests.result }}"
- echo "All checks passed."
+ echo "All backend and product checks passed."
async-migrations:
name: Async migrations tests - ${{ matrix.clickhouse-server-image }} (depot-ubuntu-latest)
needs: [changes, turbo-discover, get_clickhouse_versions]
diff --git a/.github/workflows/ci-backend.yml b/.github/workflows/ci-backend.yml
index 033d1e4c4a29..4cef89b4b1a0 100644
--- a/.github/workflows/ci-backend.yml
+++ b/.github/workflows/ci-backend.yml
@@ -2287,50 +2287,48 @@ jobs:
timeout-minutes: 5
if: always()
steps:
- - name: Check matrix outcome
+ - name: Summarize dependency results
run: |
- # The `needs.django.result` will be 'success' only if all jobs in the matrix succeeded.
- # Otherwise, it will be 'failure'.
- if [[ "${{ needs.django.result }}" != "success" && "${{ needs.django.result }}" != "skipped" ]]; then
- echo "One or more jobs in the Django test matrix failed."
- exit 1
- fi
-
- # Check migration validation - must pass for Django Tests to be green
- if [[ "${{ needs.check-migrations.result }}" != "success" && "${{ needs.check-migrations.result }}" != "skipped" ]]; then
- echo "Migration checks failed."
- exit 1
- fi
-
- # Check OpenAPI type validation - must pass for Django Tests to be green
- if [[ "${{ needs.check-openapi-types.result }}" != "success" && "${{ needs.check-openapi-types.result }}" != "skipped" ]]; then
- echo "OpenAPI type checks failed."
- exit 1
- fi
+ {
+ echo "### Backend CI dependency results"
+ echo "| Dependency | Result |"
+ echo "| --- | --- |"
+ echo "| django | ${{ needs.django.result }} |"
+ echo "| check-migrations | ${{ needs.check-migrations.result }} |"
+ echo "| check-openapi-types | ${{ needs.check-openapi-types.result }} |"
+ echo "| async-migrations | ${{ needs.async-migrations.result }} |"
+ echo "| repo-checks | ${{ needs.repo-checks.result }} |"
+ echo "| turbo-discover | ${{ needs.turbo-discover.result }} |"
+ echo "| turbo-tests | ${{ needs.turbo-tests.result }} |"
+ echo "| handle-snapshots | ${{ needs.handle-snapshots.result }} |"
+ } | tee -a "$GITHUB_STEP_SUMMARY"
+
+ - name: Check dependency results
+ run: |
+ check_required_result() {
+ local label="$1"
+ local result="$2"
- # Check async migrations - must pass for Django Tests to be green
- if [[ "${{ needs.async-migrations.result }}" != "success" && "${{ needs.async-migrations.result }}" != "skipped" ]]; then
- echo "Async migrations tests failed."
- exit 1
- fi
+ if [[ "$result" == "success" || "$result" == "skipped" ]]; then
+ return
+ fi
- # Check repo checks (product lint, IDOR, operator parity, tach)
- if [[ "${{ needs.repo-checks.result }}" != "success" && "${{ needs.repo-checks.result }}" != "skipped" ]]; then
- echo "Repo checks failed."
- exit 1
- fi
+ if [[ "$result" == "cancelled" ]]; then
+ echo "::error::$label was cancelled or timed out."
+ else
+ echo "::error::$label failed with result '$result'."
+ fi
- # Check Turbo discover - must pass for Django Tests to be green
- if [[ "${{ needs.turbo-discover.result }}" != "success" && "${{ needs.turbo-discover.result }}" != "skipped" ]]; then
- echo "Turbo discover failed."
exit 1
- fi
+ }
- # Check Turbo tests (products) - must pass for Django Tests to be green
- if [[ "${{ needs.turbo-tests.result }}" != "success" && "${{ needs.turbo-tests.result }}" != "skipped" ]]; then
- echo "Turbo tests failed."
- exit 1
- fi
+ check_required_result "Django test matrix" "${{ needs.django.result }}"
+ check_required_result "Migration checks" "${{ needs.check-migrations.result }}"
+ check_required_result "OpenAPI type checks" "${{ needs.check-openapi-types.result }}"
+ check_required_result "Async migration tests" "${{ needs.async-migrations.result }}"
+ check_required_result "Repo checks" "${{ needs.repo-checks.result }}"
+ check_required_result "Turbo discover" "${{ needs.turbo-discover.result }}"
+ check_required_result "Product/Turbo tests" "${{ needs.turbo-tests.result }}"
# Check handle-snapshots result (OK if skipped, but fail if it failed)
if [[ "${{ needs.handle-snapshots.result }}" == "failure" ]]; then
@@ -2338,7 +2336,7 @@ jobs:
exit 1
fi
- echo "All checks passed."
+ echo "All backend and product checks passed."
test-selection-verdict:
needs: [django, turbo-tests, changes]
diff --git a/.github/workflows/container-images-cd.yml b/.github/workflows/container-images-cd.yml
index a10a576a1c2a..fb94293cb9df 100644
--- a/.github/workflows/container-images-cd.yml
+++ b/.github/workflows/container-images-cd.yml
@@ -146,7 +146,7 @@ jobs:
# A stale merge once shipped a red master commit to prod because the dispatch
# fired regardless of test results; this is the backstop. Cross-workflow
# check-waiting on the same SHA mirrors the pattern in ci-hobby.yml.
- - name: Wait for backend tests to pass
+ - name: Wait for backend/product checks to pass
# Only gate automatic master pushes. A manual workflow_dispatch is the
# break-glass: it skips the wait so an operator can force a deploy.
if: github.event_name == 'push'
@@ -162,23 +162,25 @@ jobs:
timeoutSeconds: 3300
intervalSeconds: 30
- - name: Block deploy if backend tests did not pass
+ - name: Block deploy if backend/product checks did not pass
if: github.event_name == 'push'
env:
BACKEND_CONCLUSION: ${{ steps.wait-for-backend.outputs.conclusion }}
+ BACKEND_CHECK_NAME: Django Tests Pass
run: |
conclusion="$BACKEND_CONCLUSION"
# `skipped` = the backend suite didn't run for this commit; nothing to gate on.
if [ "$conclusion" = "skipped" ]; then
- echo "Backend tests skipped for this commit — proceeding with deploy."
+ echo "Required backend check \"$BACKEND_CHECK_NAME\" skipped for this commit — proceeding with deploy."
exit 0
fi
if [ "$conclusion" != "success" ]; then
- echo "::error::Backend CI for this commit is '${conclusion:-incomplete/timed out}'. Not deploying."
- echo "Fix CI and re-run, or trigger this workflow via workflow_dispatch to override."
+ echo "::error::Required backend check \"$BACKEND_CHECK_NAME\" concluded \"${conclusion:-incomplete/timed out}\". Not deploying."
+ echo "Open the Backend CI aggregate check for dependency results; it lists failed, cancelled, and timed-out jobs separately."
+ echo "Fix CI and rerun, or trigger this workflow via workflow_dispatch to override."
exit 1
fi
- echo "Backend tests passed — proceeding with deploy."
+ echo "Required backend check \"$BACKEND_CHECK_NAME\" passed — proceeding with deploy."
- name: get deployer token
id: deployer