lnd+itest: plug in graph SQL migration under test tag & add itest#10071
lnd+itest: plug in graph SQL migration under test tag & add itest#10071guggero merged 4 commits intolightningnetwork:masterfrom
Conversation
There was a problem hiding this comment.
Summary of Changes
Hello @ellemouton, 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 introduces the framework and an integration test for migrating the graph data from the existing KV database to a new native SQL database. The migration logic is conditionally compiled, ensuring it's only active in builds tagged for native SQL testing, preventing its inclusion in production releases.
Highlights
- Graph Data Migration Enablement: I've integrated the graph KVDB-to-SQL migration logic into the database builder, allowing
lndto migrate its graph data from the old key-value store to a native SQL database. - Test-Specific Activation: This graph migration is specifically enabled only when the
test_native_sqlbuild tag is present. This ensures that the migration code and its associated logic are compiled and active solely during testing scenarios, preventing its inclusion in standard production builds. - New Integration Test: A comprehensive integration test (
testGraphMigration) has been added to validate the graph migration process. This test covers scenarios like initial migration, idempotency (ensuring repeated migrations don't cause issues), and the correct handling of the migration tombstone. - Migration Registration: A new migration entry (version 9) for the KV graph migration has been registered within the development migration list, formalizing its place in the database migration sequence for test and development environments.
Using Gemini Code Assist
The 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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist is currently in preview and 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 to provide feedback.
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
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
bf1bb20 to
d5ce635
Compare
d5ce635 to
dd0425e
Compare
|
/gemini review |
| { | ||
| Name: "kv_graph_migration", | ||
| Version: 9, | ||
| SchemaVersion: 7, |
There was a problem hiding this comment.
Hmm, not sure how the SchemaVersion currently works. Since the graph migration above has version 8 I kind of would expect this to require version 8 too? cc @bhandras.
There was a problem hiding this comment.
So this just means that the custom migration will migrate the schema up to version 7 before we run it, while version is our global version which includes all migrations, schema and in-code as well.
This commit plugs in the graph kvdb-to-sql migration for builds containing the `test_native_sql` tag. This will allow us to perform local tests and write itests for the migration without exposing it to the production release build.
Refactor to make some of the invoice migration helpers re-usable so that we can use them for the graph migration itests.
This commit adds a basic itest that is run under the `test_native_sql` flag. It tests that the migration is idempotent and that the node cant be restarted without the `db.use-native-sql` flag once the graph migration has been run.
dd0425e to
a2ffa74
Compare
This commit plugs in the graph kvdb-to-sql migration for builds
containing the
test_native_sqltag. This will allow us to performlocal tests and write itests for the migration without exposing it to
the production release build.
A basic itests for the migration is also added.
Part of #9795