Configure structopt to report the right version #352

Merged
quentin merged 1 commits from bug/reported-version into main 2022-08-12 08:18:16 +00:00
Owner

By default, structopt reports the value provided by
the env var CARGO_PKG_VERSION, feeded by Cargo when reading
Cargo.toml. However for Garage we use a versioning based on git,
so we often report a version that is behind the real version.
In this commit, we create garage_util::version::garage() that
reports the right version and configure all structopt subcommands
to call this function instead of using the env var.

Fix #350

You can try it by yourself, I tagged this commit with v0.7.2_ci-test-2 in git and then:

$ wget garagehq.deuxfleurs.fr/_releases/v0.7.2_ci-test-2/x86_64-unknown-linux-musl/garage
$ chmod +x garage
$ ./garage --version
garage v0.7.2_ci-test-2
$ ./garage bucket list --version
garage-bucket-list v0.7.2_ci-test-2
By default, structopt reports the value provided by the env var CARGO_PKG_VERSION, feeded by Cargo when reading Cargo.toml. However for Garage we use a versioning based on git, so we often report a version that is behind the real version. In this commit, we create garage_util::version::garage() that reports the right version and configure all structopt subcommands to call this function instead of using the env var. Fix #350 You can try it by yourself, I tagged this commit with `v0.7.2_ci-test-2` in git and then: ``` $ wget garagehq.deuxfleurs.fr/_releases/v0.7.2_ci-test-2/x86_64-unknown-linux-musl/garage $ chmod +x garage $ ./garage --version garage v0.7.2_ci-test-2 $ ./garage bucket list --version garage-bucket-list v0.7.2_ci-test-2 ```
quentin force-pushed bug/reported-version from 6e58748545 to e9488683e0 2022-08-10 13:50:53 +00:00 Compare
quentin force-pushed bug/reported-version from e9488683e0 to e757bbe181 2022-08-10 13:56:34 +00:00 Compare
quentin force-pushed bug/reported-version from e757bbe181 to c2554d0953 2022-08-10 14:32:03 +00:00 Compare
quentin changed title from Configure structopt to report the right version to WIP: Configure structopt to report the right version 2022-08-10 18:12:30 +00:00
quentin force-pushed bug/reported-version from c2554d0953 to 4a693ff29e 2022-08-10 20:34:55 +00:00 Compare
quentin force-pushed bug/reported-version from 4a693ff29e to 2c7bae935a 2022-08-11 08:23:28 +00:00 Compare
quentin changed title from WIP: Configure structopt to report the right version to Configure structopt to report the right version 2022-08-11 10:02:39 +00:00
quentin merged commit 2c7bae935a into main 2022-08-12 08:18:16 +00:00
quentin deleted branch bug/reported-version 2022-08-12 08:18:18 +00:00
Sign in to join this conversation.
No description provided.