Repository navigation
feat: add migration drift gate to rowx check - #162
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Closes #147
What
Adds the migration drift gate to
rowx check(src/rowx/check/drift.py).[tool.rowx.migrate]is configured and the run has SQL to describe,checkvalidates the migration files, opens a read-only checker session (connect_checker), callsMigrator.info(honouring the configuredtable;create_schemasis passed through butinfocreates nothing), and closes the session on every path. This happens before any statement is described.pending,modified,missingordirtyrow exits 2 with one summary on stderr: counts per state in that order, up to five sorted versions per state (, ...beyond), and the help linerun `rowx migrate run`, or `rowx check --scratch`. No diagnostics are printed; in JSON mode stdout stays empty.--no-drift-checkskips the gate.--statisticsaddsmigrations checked: Nwhen the gate ran.[tool.rowx.migrate], behaviour is unchanged (existing goldens untouched).DriftError) skips redaction: it contains only versions, the configureddirand the help line, never the URL; redacting it would turn a short password such asrowxinto*** migrate run.New tests (named)
DB,
src/rowx/__tests__/integration/check/test_check_cli.py(goldens ingolden/drift_*.txt):test_drift_up_to_date_passes,test_drift_pending_exits_two,test_drift_partially_pending,test_drift_modified_exits_two,test_drift_missing_exits_two,test_drift_dirty_exits_two,test_drift_json_keeps_stdout_empty,test_no_drift_check_bypasses_the_gate,test_without_migrate_config_there_is_no_gate,test_drift_gate_skipped_when_nothing_is_described,test_drift_password_never_appears,test_history_is_read_in_a_read_only_session(a write in the same session fails with 25006).Unit,
src/rowx/__tests__/unit/check/test_drift.py:test_up_to_date_has_no_summary,test_summary_counts_each_state_in_a_fixed_order,test_summary_lists_at_most_five_versions_per_state,test_no_drift_check_flag.Wiring edits
src/rowx/check/cli.py:--no-drift-check, passes the gate torun_check, printsmigrations checked.src/rowx/check/runner.py:run_checktakes an optionalgate, run once after discovery and before describing;Statistics.migrations.Spec ambiguities
checker.md's example summary ("database is 2 migrations behindmigrations/: …") differs from feat: add migration drift gate to rowx check #147's format (counts per state, five versions each, help line). I followed feat: add migration drift gate to rowx check #147:database has drifted from/:then one line per state.[tool.rowx.migrate]. The design says the gate runs "before describing anything", so I read it as part of describing.connect_checkersession type.--scratchdoesn't exist yet, but the help line names it as feat: add migration drift gate to rowx check #147 requires.🤖 Generated with Claude Code