Skip to content

Commit

Permalink
Update to vergen 5, add branch, commit time, and build target to the …
Browse files Browse the repository at this point in the history
…panic metadata, automatically update app version from crate version (#2029)

* build(deps): bump vergen from 3.2.0 to 5.1.1

* fix hardcoded version for Tracing struct

* add additional metadata

* remove extra allocations for metadata

* Remove zebrad code version from release checklist

The zebrad code automatically uses the crate version now.

* Sort panic metadata into rough categories

Co-authored-by: teor <teor@riseup.net>
  • Loading branch information
fanatid and teor2345 authored Apr 19, 2021
1 parent 2cecd52 commit 43e792b
Show file tree
Hide file tree
Showing 7 changed files with 182 additions and 123 deletions.
3 changes: 1 addition & 2 deletions .github/PULL_REQUEST_TEMPLATE/release-checklist.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ what's changed.

- [ ] Increment the crates that have new commits since the last version update
- [ ] Increment any crates that depend on crates that have changed
- [ ] Use the `zebrad` crate version in the `zebrad` app code and `zebra-network` user agent
- [ ] Use the `zebrad` crate version in the `zebra-network` user agent string
- [ ] Use the latest git tag in `README.md`

### How to Increment Versions
Expand Down Expand Up @@ -57,7 +57,6 @@ Increment the first version component in this list, and reset the other componen
Once you know which versions you want to increment, you can find them in the:
- [ ] zebra* `Cargo.toml`s
- [ ] tower-* `Cargo.toml`s
- [ ] `zebrad` app code: https://github.com/ZcashFoundation/zebra/blob/main/zebrad/src/components/tracing/component.rs
- [ ] `zebra-network` protocol user agent: https://github.com/ZcashFoundation/zebra/blob/main/zebra-network/src/constants.rs
- [ ] `README.md`
- [ ] `Cargo.lock`: automatically generated by `cargo build`
Expand Down
157 changes: 150 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 11 additions & 5 deletions zebra-chain/src/parameters/network.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::fmt;
use std::{convert::From, fmt};

#[cfg(any(test, feature = "proptest-impl"))]
use proptest_derive::Arbitrary;
Expand All @@ -13,12 +13,18 @@ pub enum Network {
Testnet,
}

impl From<&Network> for &'static str {
fn from(network: &Network) -> &'static str {
match network {
Network::Mainnet => "Mainnet",
Network::Testnet => "Testnet",
}
}
}

impl fmt::Display for Network {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
Network::Mainnet => f.write_str("Mainnet"),
Network::Testnet => f.write_str("Testnet"),
}
f.write_str(self.into())
}
}

Expand Down
2 changes: 1 addition & 1 deletion zebrad/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ sentry = { version = "0.21.0", default-features = false, features = ["backtrace"
sentry-tracing = { git = "https://github.com/kellpossible/sentry-tracing.git", rev = "f1a4a4a16b5ff1022ae60be779eb3fb928ce9b0f" }

[build-dependencies]
vergen = "3.2.0"
vergen = { version = "5.1.1", default-features = false, features = ["cargo", "git"] }

[dev-dependencies]
abscissa_core = { version = "0.5", features = ["testing"] }
Expand Down
Loading

0 comments on commit 43e792b

Please sign in to comment.