-
Notifications
You must be signed in to change notification settings - Fork 211
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
fix: make single guardian devimint cli test backwards-compatible #4104
fix: make single guardian devimint cli test backwards-compatible #4104
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #4104 +/- ##
==========================================
- Coverage 58.35% 58.30% -0.06%
==========================================
Files 194 192 -2
Lines 42581 42740 +159
==========================================
+ Hits 24847 24918 +71
- Misses 17734 17822 +88 ☔ View full report in Codecov by Sentry. |
ee13d4a
to
df628a0
Compare
df628a0
to
3e480cd
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.
🎉
devimint/src/main.rs
Outdated
let fedimintd_version_res = cmd!(devimint::util::FedimintdCmd, "--version") | ||
.out_string() | ||
.await; | ||
if devimint::util::is_min_version(0, 3, 0, fedimintd_version_res) { |
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.
is_min_version
confuses me. Would expect is_version_at_least
or is_version_gt
kind of things.
Also 0, 3, 0
... looks weird.
devimint/src/util.rs
Outdated
/// min version provided. If there's an error parsing the version, returns | ||
/// false. | ||
pub fn is_min_version( | ||
min_major: u32, |
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.
If we have CrateVersion
why not use it here?
devimint/src/util.rs
Outdated
min_major: u32, | ||
min_minor: u32, | ||
min_patch: u32, | ||
version_res: Result<String, anyhow::Error>, |
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.
Taking Result<String, anyhow::Error>
here is odd and confusing.
If for some reason older versions didn't have --version
or something like that, then the version parsing function should default to some magic number (0.2.0? 0.1.0?) to unify all the cases.
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.
Without these issues, we can use some more natural version comparison (I'm not sure if cmp::Ordering
and operators like <=
could be used for semver, need more coffee).
BTW. https://docs.rs/semver/latest/semver/ exists and is not a heavy crate, maybe we should just use it?
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.
5bc44aa
to
1e367d2
Compare
1e367d2
to
029921d
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.
Fixes #4017
I verified locally against the full matrix of backwards-compatibility tests that
devimint_cli_test_single
succeeds (see: #4010).