This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Deprecate "paritydb-experimental" CLI in favour or "paritydb" #10975
Merged
paritytech-processbot
merged 2 commits into
master
from
a-deprecate-paritydb-experimental
Mar 4, 2022
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -201,8 +201,10 @@ pub enum Database { | |
/// ParityDb. <https://github.com/paritytech/parity-db/> | ||
ParityDb, | ||
/// Detect whether there is an existing database. Use it, if there is, if not, create new | ||
/// instance of paritydb | ||
/// instance of ParityDb | ||
Auto, | ||
/// ParityDb. <https://github.com/paritytech/parity-db/> | ||
ParityDbDeprecated, | ||
} | ||
|
||
impl std::str::FromStr for Database { | ||
|
@@ -212,6 +214,8 @@ impl std::str::FromStr for Database { | |
if s.eq_ignore_ascii_case("rocksdb") { | ||
Ok(Self::RocksDb) | ||
} else if s.eq_ignore_ascii_case("paritydb-experimental") { | ||
Ok(Self::ParityDbDeprecated) | ||
} else if s.eq_ignore_ascii_case("paritydb") { | ||
Ok(Self::ParityDb) | ||
} else if s.eq_ignore_ascii_case("auto") { | ||
Ok(Self::Auto) | ||
|
@@ -224,7 +228,7 @@ impl std::str::FromStr for Database { | |
impl Database { | ||
/// Returns all the variants of this enum to be shown in the cli. | ||
pub fn variants() -> &'static [&'static str] { | ||
&["rocksdb", "paritydb-experimental", "auto"] | ||
&["rocksdb", "paritydb", "paritydb-experimental", "auto"] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would just remove paritydb-experimental from the list (not sure if it is working). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It does not work. Clap produces an error if an unknown variant is used. |
||
} | ||
} | ||
|
||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -230,6 +230,13 @@ pub trait CliConfiguration<DCV: DefaultConfigurationValues = ()>: Sized { | |
Ok(match database { | ||
Database::RocksDb => DatabaseSource::RocksDb { path: rocksdb_path, cache_size }, | ||
Database::ParityDb => DatabaseSource::ParityDb { path: paritydb_path }, | ||
Database::ParityDbDeprecated => { | ||
eprintln!( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using |
||
"WARNING: \"paritydb-experimental\" database setting is deprecated and will be removed in future releases. \ | ||
Please update your setup to use the new value: \"paritydb\"." | ||
); | ||
DatabaseSource::ParityDb { path: paritydb_path } | ||
}, | ||
Database::Auto => DatabaseSource::Auto { paritydb_path, rocksdb_path, cache_size }, | ||
}) | ||
} | ||
|
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.
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.
This function gets called multiple times, so can't just print a warning here.
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.
We could only log it once using
OnceCell
for exampleThere 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.
Can't say I like this idea. Introducing global variable and yet another dependency for a trivial thing.