-
Notifications
You must be signed in to change notification settings - Fork 329
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
Add CLI git hash #1101
Add CLI git hash #1101
Conversation
Very nice, thanks @hu55a1n1! One request: is there a way we can ensure that binaries built on CI and uploaded to the GitHub release show just the version without the |
Thanks for reviewing the PR @romac! Otherwise, is it an option to change the regex in fn start_no_args() {
// ...
let mut runner = RUNNER.clone();
let mut cmd = runner.capture_stdout().run();
cmd.stdout().expect_regex(
format!(
"^[^ ]*{} {}", // <-------------------------- remove the trailing `$`?
env!("CARGO_PKG_NAME"),
env!("CARGO_PKG_VERSION")
)
.as_str(),
);
// ...
} |
Yes, I actually did that in d3c5360, which has fixed the test. But now the CI is still broken because Rust 1.53 was just released, and comes with new clippy lints. I think we can disregard these failures for now. I will fix them in a separate PR. |
Looks like there's a bunch of them, not sure which one we should use. Perhaps we can check for |
Should be good now, merged #1102 and merged master here. |
I just noticed that the new version doesn't appear for |
Linking #590 here, because it describes the problem in more detail. Although here, the chances of breaking cargo workflow are quite low since we're not overwriting the version for CI builds. |
@hu55a1n1 What's the status on this PR? |
Tagged with "backburner" until Shoaib returns from holidays to look at this again. |
The acceptance test for the CLI was failing because it didn't escape regular expression meta characters in the |
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.
Nice work, this is going to be very useful!
* Export HERMES_VERSION env var from build.rs * Override CLI version to use exported HERMES_VERSION * Fix CLI integration test which checks the version number * Move git stuff into it's own module * Don't add version meta for CI release builds * Fix git dirty command * Overwrite CARGO_PKG_VERSION instead of setting HERMES_VERSION * Minor refactoring * Fix check for GITHUB_JOB * Escape regex meta for acceptance test * Add regex as dev-dep * Changelog Co-authored-by: Romain Ruetschi <romain@informal.systems> Co-authored-by: Adi Seredinschi <adi@informal.systems>
Closes: #1094
Description
Export a env var (i.e.
HERMES_VERSION
) from build.rs and use it as the CLI's version string.The newer version string is a valid semver string of the form ->
<pkg-version>+<git-branch>-<git commit hash>
. There's also an optional suffix-dirty
which is added if the git repo is dirty. e.g. ->0.4.0+cli-git-hash-760270a8-dirty
For contributor use:
docs/
) and code comments.Files changed
in the Github PR explorer.