Stringhtened migration drift checks across environmtents#781
Open
aboyejirebecca-prog wants to merge 1 commit into
Open
Stringhtened migration drift checks across environmtents#781aboyejirebecca-prog wants to merge 1 commit into
aboyejirebecca-prog wants to merge 1 commit into
Conversation
|
@aboyejirebecca-prog Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Author
|
Ready for review! All tests pass. Happy to make changes if needed. |
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.
Summary
--env <label>flag tocheck-migration-drift.jsso every check output (console and JSON) is tagged with its environment (local,ci-remote, etc.), making cross-environment comparison unambiguousmigration-drift-check.yml— was readingprocess.env.STATUS(never set), so always showed "❌ Drift detected!" regardless of result; now captures--jsonoutput and renders actual issue list ([duplicate],[conflict],[unapplied_migration],[orphaned_migration]) into the comment bodyverify-local-databaseCI job tomigration-drift-check.yml— spins up a local Supabase stack on every PR, applies all migrations, runs--verify-db --env local, and posts a dedicated PR comment with applied/filesystem counts and any issues founddatabase.yml— after migrations are applied to the local stack, runs--verify-db --env local --jsonand fails the job with per-issue output if state diverges from filesystemEnvironment-Aware OutputandConflicting Migration History Detectiontest suites covering env field in JSON output, local vs ci-remote label distinction, cross-environment count divergence, and orphaned issue timestampsMIGRATION_REMEDIATION.mdCase 6 (Cross-Environment Divergence) with CI job references and new--envcommands; add Case 7 for CI-remote-only orphaned migrationsTest plan
node scripts/check-migration-drift.js --json— verify"env": "unknown"appears in outputnode scripts/check-migration-drift.js --env local --json— verify"env": "local"in outputnpm run test:migrations— all existing tests pass, newEnvironment-Aware OutputandConflicting Migration History Detectionsuites passsupabase/migrations/— confirm three PR comments appear:🔍 Migration Drift Check,🖥️ Local Database Drift Check,📊 CI Remote Database Drift Check🔍 Migration Drift Checkcomment lists actual[duplicate]/[conflict]items when drift exists, not just pass/faildatabase.ymlworkflow fails with❌ Local database drift detected: [unapplied_migration] ...when a migration file is present but not appliedCloses
Fixes #657
Backlog: #63