-
Notifications
You must be signed in to change notification settings - Fork 44
client-cli: merge cardano-database-v2 command into 'v1' command #2547
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
Conversation
703b404
to
fa06a11
Compare
fa06a11
to
f4f42be
Compare
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.
LGTM 🔥
a141119
to
aafcb05
Compare
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.
LGTM 🚀
8daa5dc
to
d775bfb
Compare
So it can be re-used easily in subcommands.
To avoid duplicating code
Using the new `--backend` parameter to allow to switch to `v2` (default to `v1`). V2 command still exist but call 'v1' code to avoid duplication.
for a cleaner separation between v1 and v2 code as there's much more code for that command in comparaison to `show` and `list`
Using the new `--backend` parameter to allow to switch to `v2` (default to `v1`). V2 command still exist but call 'v1' code to avoid duplication.
+ print thoses messages to stderr instead of stdout + move them from utils to the `cardano-db` command since there's now only one place were thoses messages must be print.
… `DeprecatedCommand`
…ep` mod Two steps affected: - `fetch_certificate_and_verifying_chain`: unchanged, the code was identical - `log_download_information`: changed to make the function parameters agnostics to the snapshot types.
d775bfb
to
0ce8ee5
Compare
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.
LGTM 🐴
0ce8ee5
to
eb5306c
Compare
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.
Pull Request Overview
This PR merges the previously separate cardano-database-v2 command into the cardano-database command via the new --backend option, deprecating the old cardano-db-v2 subcommand.
- Migrate v2 functionality into the existing cardano-database command with a new --backend [v1,v2] option
- Enforce that backend v2 usage requires the --unstable flag while maintaining legacy behavior for v1
- Update warning messages, deprecation handling, documentation, and tests accordingly
Reviewed Changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
src/utils/mod.rs | Added a JSON CAUTION key constant for structured warning messages |
src/utils/cardano_db.rs | Removed AncillaryLogMessage and updated warning message handling |
src/main.rs | Updated command handling to enforce unstable flag for v2 backend and print deprecation messages |
src/commands/deprecation.rs | Enhanced deprecation message formatting to include additional messages and aliases |
src/commands/cardano_db/* | Refactored the Cardano database commands to support the new --backend option (v1 default, v2 unstable) |
docs/website/... | Updated documentation to reflect deprecation of cardano-db-v2 and instructions for using --backend |
Comments suppressed due to low confidence (1)
mithril-client-cli/src/commands/cardano_db/show.rs:47
- [nitpick] Consider refactoring the common logic shared between the print_v1 and print_v2 methods into a helper function to reduce code duplication and simplify future maintenance.
match self.backend { CardanoDbCommandsBackend::V1 => self.print_v1(client).await?, CardanoDbCommandsBackend::V2 => self.print_v2(client).await?, }
eb5306c
to
1e2e5ee
Compare
1e2e5ee
to
58e31fb
Compare
58e31fb
to
e1125dc
Compare
e1125dc
to
a628374
Compare
a628374
to
45180d5
Compare
45180d5
to
f653b40
Compare
…k space we need to free disk space to avoid hitting the limit of 14Go on github hosted runners.
* mithril-client-cli from `0.12.8` to `0.12.9`
f653b40
to
135710c
Compare
Content
This PR merge in the client-cli the
cardano-database-v2
command into the 'v1'cardano-database
command, instead a new option is added in order to switch the backend:--backend [v1,v2]
.Changes
mithril-client-cli
cardano-database
:--backend
with two values,v1
andv2
v2
the--unstable
option is still mandatory, if missing the command stop with the usual warning messagedownload
sub-command:--start {number}
,--end {number}
, and--allow-override
: taken from thecardano-database-v2
command, ignored with a warning if the backend is not set tov2
cardano-database-v2
:cardano-db
command instead and pass the--backend v2
parametercardano-database
command, existing command are now only a indirection to thecardano-database
with a forcedv2
backendmain
toCommandContext
to re-use it in sub-commandsDeprecatedCommand
system to support old command alias and printing of additional messagePre-submit checklist
Issue(s)
Relates to #2493