Repository navigation
ci(supabase): name the known cause when the drift audit exits non-zero - #573
Merged
Merged
Conversation
The CLI exits 1 on real drift as well as on infrastructure failures, and the exit-code guard runs before the pattern checks — so every out-of-order drift was reported as a generic 'investigate before assuming sync'. Verified on a probe PR (#572): dev fails with 'Found local migration files to be inserted before the last migration', because 337 was skipped while 338-345 were applied. That is accurate signal, and it will keep every migration PR red on dev until 337 is applied — which is blocked on the two Vault secrets in #564. The message now says exactly that instead of sending the reader looking.
This was referenced Aug 12, 2026
thinkclay
added a commit
that referenced
this pull request
Sep 10, 2026
… one failing (#726) #573 added a message so an out-of-order drift failure names the known cause instead of sending everyone to "investigate". It hardcodes one: On dev this is currently 337_notification_cron_vault.sql, which cannot be applied until the two Vault secrets exist (see issue #564). That text prints for every environment in the matrix. Prod and preview are currently failing on 348, 349 and 350 — none of them 337, none of them related to Vault secrets — and both are told to go read #564. A message that names the wrong migration is worse than "investigate", because it looks authoritative. Parse the pending list out of the CLI output and name what this environment is actually missing. The #564 hint is kept, but only when 337 is genuinely among them. Verified against both real outputs from the current run: prod -> "...: 348_role_assignments_unique_nulls_not_distinct.sql 349_content_reports_and_user_blocks.sql 350_move_user_feedback_to_core.sql." (no #564 hint) dev -> "...: 337_notification_cron_vault.sql 348_...sql. 337_... cannot be applied until the two Vault secrets exist — see #564." Also drops "Resolve that rather than re-running", which described 337 specifically, for the general truth: these sort before the last applied version and will never be picked up without a deliberate --include-all push. Co-authored-by: Claude Opus 5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to the drift-audit change in #571, from actually running it.
What the probe showed
I opened a throwaway migrations-only PR (#572) to verify the new
pull_requesttrigger fires rather than assume it. It does:Dev's failure is correct and specific:
337 was deliberately skipped (it schedules cron jobs against two Vault secrets that do not exist on dev — #564) while 338–345 were applied. That makes it permanently out of order, which is a genuine drift condition, not noise.
The change
The CLI exits 1 on real drift as well as on infrastructure failures, and the exit-code guard runs before the pattern checks below it — so this condition was being reported as a generic "investigate before assuming sync". It now names the cause and points at #564.
Consequence worth knowing
Every migration PR will show a red
drift-audit (dev)until 337 is applied. That is accurate signal rather than a bug, and softening it would repeat the mistake this whole epic has been about — a check that reports green while something is wrong. But it is a real cost, and resolving #564 (two Vault secrets on dev, a one-time human action) clears it.The
pull_requestnuance added in #571 — treating "Would push these migrations" as a notice rather than a failure, since a PR adding a migration is supposed to be unapplied — is not reachable on dev while this out-of-order condition exists. It will start applying once 337 is resolved.