-
Notifications
You must be signed in to change notification settings - Fork 138
Use latest version of the migrate dependency
#1914
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Use latest version of the migrate dependency
#1914
Conversation
Summary of ChangesHello @ViktorT-11, 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 upgrades the project's database migration system by integrating the latest version of the Highlights
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. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request updates the migrate dependency to a newer forked version, which introduces a separation between SQL and programmatic migrations. The changes refactor the existing 'post-migration checks' into first-class 'programmatic migrations', moving them to new, dedicated migration versions (50 and 51). The implementation includes robust testing for the new migration logic, including replay protection for users who have already run the previous migrations. The changes are logical and well-executed. I have a couple of minor suggestions to improve code clarity and maintainability.
Pull Request Test Coverage Report for Build 20794343742Details
💛 - Coveralls |
be079b5 to
eb54644
Compare
|
@ViktorT-11, remember to re-request review from reviewers when ready |
The TestMigration50ScriptKeyTypeReplay test previously executed both a SQL migration and a programmatic migration at the same migration version. With the new version of the `migrate` dependency, this dual execution is no longer supported. In preparation for updating `tapd` to use the new migrate dependency, this commit therefore updates the test to instead manually apply the programmatic migration to the db, after the SQL migration has been successfully executed. This therefore replicates the previous behavior of executing the both the SQL and programmatic migrations at the same migration version.
The TestMigration51BurnReplay test previously executed both a SQL migration and a programmatic migration at the same migration version. With the new version of the `migrate` dependency, this dual execution is no longer supported. In preparation for updating `tapd` to use the new migrate dependency, this commit therefore updates the test to instead manually apply the programmatic migration to the db, after the SQL migration has been successfully executed. This therefore replicates the previous behavior of executing the both the SQL and programmatic migrations at the same migration version.
The TestDirtySqliteVersion test previously relied on executing both a SQL migration and a programmatic migration at the same migration version for migration version 2 & the latest migration version. With the new version of the `migrate` dependency, this dual execution is no longer supported. In preparation for updating `tapd` to use the new migrate dependency, this commit therefore updates the test instead override the already existing programmatic migrations for version 50 & 51, and instead change their functionality to error when being executed, to trigger setting the database into a dirty state.
Bump the migrate dependency to use the latest version of the `ll-fork` branch. This main changes of this new version are: * SQL migrations & Programmatic migrations now need to be separated into different migration versions. * Programmatic migrations can now be configured to be re-run on the next startup if they error. This is done by setting the `ResetVersionOnError` flag to `true` for the specific Programmatic migration. See lightninglabs/migrate#3 for more details.
74c6bdf to
08cb17d
Compare
As the `litd` instance run in CI will use the latest `tapd`, and that `tapd` version requires the new migrate dependency, we need to update the `lit-setup` action to also replace migrate dependency, so that the new version is used. This can be removed once `litd` master has been updated to use the new migrate dependency.
08cb17d to
ed4e33f
Compare
Based on #1881
Bump the migrate dependency to use the latest version of the
ll-forkbranch.This main changes of this new version are:
ResetVersionOnErrorflag totruefor the specific Programmatic migration.See lightninglabs/migrate#3 for more details.