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.

fix(ci): add error handling to prime cached schema steps in Dagster/MCP CI (#71989)

mendral-app[bot]41984a663308
diff --git a/.github/workflows/ci-dagster.yml b/.github/workflows/ci-dagster.yml
index a6ed72a24d61..3130087bc8a7 100644
--- a/.github/workflows/ci-dagster.yml
+++ b/.github/workflows/ci-dagster.yml
@@ -358,7 +358,11 @@ jobs:
fi
mkdir -p .postgres-backups
mv schema.sql.gz .postgres-backups/schema-latest.sql.gz
- ./bin/hogli db:restore-schema-fresh
+ if ! ./bin/hogli db:restore-schema-fresh; then
+ echo "::warning::Schema restore failed (stale/incompatible cached dump?) — falling through to full migrate"
+ python manage.py migrate
+ exit 0
+ fi
gunzip -c .postgres-backups/schema-latest.sql.gz | \
docker compose -f docker-compose.dev.yml exec -T db psql -q -U posthog posthog
diff --git a/.github/workflows/ci-mcp.yml b/.github/workflows/ci-mcp.yml
index 247a17a1b26a..cb33301d6209 100644
--- a/.github/workflows/ci-mcp.yml
+++ b/.github/workflows/ci-mcp.yml
@@ -438,7 +438,10 @@ jobs:
fi
mkdir -p .postgres-backups
mv schema.sql.gz .postgres-backups/schema-latest.sql.gz
- ./bin/hogli db:restore-test-db
+ if ! ./bin/hogli db:restore-test-db; then
+ echo "::warning::Schema restore failed (stale/incompatible cached dump?) — manage.py migrate will run from scratch"
+ exit 0
+ fi
# The dump is produced by ci-backend.yml, where TEST=1 activates
# ProductDBRouter and routes the apps in products/db_routing.yaml to
# separate databases: their tables are absent from the dump, but