Repository navigation
fix(ci): refuse schema dumps newer than the checkout - #131364
Conversation
The schema restore now reads the dump's django_migrations rows and refuses a dump that records migrations of our own apps the checkout does not have. Such a dump comes from newer code, such as the newest master dump restored for a stacked branch, and migrate cannot remove what that code added. Callers already treat a failed restore as a miss and run the full migrate. Squash-replaced names count as known, and product-routed apps are skipped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Generated-By: PostHog Desktop Task-Id: 7ae05f85-8f9b-432c-96f2-c0eb41c76f92
|
😎 Merged successfully - details. |
🤖 CI report
|
|
Risk: No findings The only change since the last review is a mechanical refactor of the migration-reference sets from tuples to a frozen ordered dataclass in the hogli schema-restore check; it is behavior-equivalent at every use site and introduces no new security surface. Sentinel reviewed |
Generated-By: PostHog Desktop Task-Id: 2cddad30-90ed-45de-bc3f-46315bd5b38c
|
Robot: Note 🤖 Automated comment by QA Swarm Verdict: ✅ APPROVE (round 2 @ 4149133)The named migration reference fixes the Semgrep failure. Unit tests and the pinned rule pass. The router and simplification pass found no further defects. Schema rejection still occurs before database changes. Post-merge savings need measurement. |
Problem
Backend contributors can see missing-table teardown failures when CI restores a schema newer than their checkout (report).
Why: Avoid schema failures and repeated CI runs.
Changes
How did you test this code?
Test rationale: Existing cases cover rejection, matching schemas, squashes, and routed apps.
Release status
Docs update
🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Agent: Claude Code, claude-opus-5-5; Codex CI repair, gpt-6.1-sol
Skills:
/authoring-ci-workflows,/writing-tests,/writing-code-comments,/writing-pr-descriptions,/writing-dataclasses,/verifying-changes,/running-ci-preflight,/pr-shepherd,/qa-swarm,/review-triage,/ci-shepherdMore context for AI agents
posthog.__init__in standalone hogli.prime-schema-cachecounts prefix matches as hits.ci-rust-flags-integration.ymluses rawpsql, so it does not get this guard._check_dump_is_not_newer_than_checkoutintools/hogli-commands/hogli_commands/db_schema.py. All hogli restore callers use this check.Created with PostHog Desktop