sqldb: fix migration config consistency coverage#10726
sqldb: fix migration config consistency coverage#10726Roasbeef merged 2 commits intolightningnetwork:masterfrom
Conversation
Add the 000014_payments_no_fail_reason_index migration to the main migration configuration so the global migration list stays in sync with the embedded SQL schema files.
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the robustness and consistency of the SQL database migration system. It ensures that the in-code migration configuration accurately reflects the embedded SQL migration files, prevents accidental schema version regressions, and enforces strict naming conventions, thereby improving the reliability of database schema evolution. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a new test, TestMigrationFilesAllRegistered, to ensure that all SQL migration files have corresponding entries in the Go migration configuration. It also enhances TestMigrationConfigConsistency by correcting the previous schema version calculation, enforcing monotonically increasing schema versions, and verifying that migration names in the configuration match their respective SQL file names. Furthermore, an existing migration entry is renamed, and a new migration for payments is added. There is no feedback to provide on the review comments as none were provided.
Strengthen migration consistency coverage by checking the reverse mapping from embedded SQL files to migrationConfig entries, deriving previous schema state from slice order instead of Version, rejecting schema version regressions, and asserting migration names match the embedded SQL file stems. Also fix the graph v2 migration config name to match the embedded migration filename.
5c25e09 to
bd7e950
Compare
PR Severity: CRITICAL
CRITICAL (1 file)
Low (2 files - excluded from scoring)
AnalysisThis PR touches The change is small (6 additions, 1 deletion in the non-test file) and is accompanied by new migration tests, which is good practice. However, database migrations carry inherent risk - a faulty migration can corrupt channel state or render a node unable to start. This warrants expert review to ensure:
To override, add a severity-override-{critical,high,medium,low} label. |
Summary
Testing