From cd8d423e34b50ec6a7b233b4ef1726900f08029b Mon Sep 17 00:00:00 2001 From: Romain Ruetschi Date: Thu, 28 Sep 2023 11:12:07 +0200 Subject: [PATCH] Release v0.36.0 (#148) * Bump version to 0.36.0 * Release changelog * Fix invalid doc comment in generated Rust code * Add CI job to check that documentation builds succesfully --- .../147-fix-script-and-protos.md | 0 .changelog/v0.36.0/summary.md | 3 ++ .github/workflows/rust.yml | 16 ++++++++ CHANGELOG.md | 17 +++++++++ Cargo.toml | 2 +- src/prost/ibc.applications.transfer.v1.rs | 2 +- tools/proto-compiler/src/cmd/compile.rs | 38 ++++++++++++++----- 7 files changed, 66 insertions(+), 12 deletions(-) rename .changelog/{unreleased => v0.36.0}/breaking-changes/147-fix-script-and-protos.md (100%) create mode 100644 .changelog/v0.36.0/summary.md diff --git a/.changelog/unreleased/breaking-changes/147-fix-script-and-protos.md b/.changelog/v0.36.0/breaking-changes/147-fix-script-and-protos.md similarity index 100% rename from .changelog/unreleased/breaking-changes/147-fix-script-and-protos.md rename to .changelog/v0.36.0/breaking-changes/147-fix-script-and-protos.md diff --git a/.changelog/v0.36.0/summary.md b/.changelog/v0.36.0/summary.md new file mode 100644 index 0000000..813bd21 --- /dev/null +++ b/.changelog/v0.36.0/summary.md @@ -0,0 +1,3 @@ +*September 28th, 2023* + +Warning: This release downgrades the Protobuf definitions for IBC-Go, Cosmos SDK, and Interchain Security. diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index a42e35c..7154214 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -123,6 +123,22 @@ jobs: with: command: build + doc: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + - uses: Swatinem/rust-cache@v1 + - uses: actions-rs/cargo@v1 + env: + RUSTDOCFLAGS: "-D warnings" + with: + command: doc + args: --all-features + publish-dry-run: runs-on: ubuntu-latest steps: diff --git a/CHANGELOG.md b/CHANGELOG.md index 82d5968..6c3a567 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,22 @@ # CHANGELOG +## v0.36.0 + +*September 28th, 2023* + +Warning: This release downgrades the Protobuf definitions for IBC-Go, Cosmos SDK, and Interchain Security. + +### BREAKING CHANGES + +- Since ibc-proto v0.34.0, the script in charge of generating the Rust proto definitions + has been mistakenly checking out their latest version instead of the one + specified in the corresponding `src/*_COMMIT` file. This has now been fixed + and the protos have therefore been downgraded to their proper versions: + * IBC-Go: v7.3.0, + * Cosmos SDK: v0.47.5 + * Interchain Security: v3.1.0 + ([\#147](https://github.com/cosmos/ibc-proto-rs/pull/147)) + ## v0.35.0 *September 14th, 2023* diff --git a/Cargo.toml b/Cargo.toml index e484a84..ec5da08 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ibc-proto" -version = "0.35.0" +version = "0.36.0" authors = ["Informal Systems "] edition = "2021" license = "Apache-2.0" diff --git a/src/prost/ibc.applications.transfer.v1.rs b/src/prost/ibc.applications.transfer.v1.rs index 182655b..350106c 100644 --- a/src/prost/ibc.applications.transfer.v1.rs +++ b/src/prost/ibc.applications.transfer.v1.rs @@ -439,7 +439,7 @@ pub struct QueryParamsResponse { #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDenomHashRequest { - /// The denomination trace (\[port_id]/[channel_id])+/[denom\] + /// The denomination trace `(\[port_id]/[channel_id])+/[denom\]` #[prost(string, tag = "1")] pub trace: ::prost::alloc::string::String, } diff --git a/tools/proto-compiler/src/cmd/compile.rs b/tools/proto-compiler/src/cmd/compile.rs index c828d19..e193900 100644 --- a/tools/proto-compiler/src/cmd/compile.rs +++ b/tools/proto-compiler/src/cmd/compile.rs @@ -215,21 +215,39 @@ impl CompileCmd { out_dir.display() ); - { - println!("[info ] Patching cosmos.staking.v1beta1.rs..."); + const PATCHES: &[(&str, &[(&str, &str)])] = &[ + ( + "cosmos.staking.v1beta1.rs", + &[ + ("pub struct Validators", "pub struct ValidatorsVec"), + ("AllowList(Validators)", "AllowList(ValidatorsVec)"), + ("DenyList(Validators)", "DenyList(ValidatorsVec)"), + ], + ), + ( + "ibc.applications.transfer.v1.rs", + &[( + "The denomination trace (\\[port_id]/[channel_id])+/[denom\\]", + "The denomination trace `(\\[port_id]/[channel_id])+/[denom\\]`", + )], + ), + ]; + + for (file, patches) in PATCHES { + println!("[info ] Patching {file}..."); - let path = out_dir.join("cosmos.staking.v1beta1.rs"); - let contents = std::fs::read_to_string(&path)?; + let path = out_dir.join(file); + let original = std::fs::read_to_string(&path)?; + let mut patched = original.clone(); - let patched_contents = contents - .replace("pub struct Validators", "pub struct ValidatorsVec") - .replace("AllowList(Validators)", "AllowList(ValidatorsVec)") - .replace("DenyList(Validators)", "DenyList(ValidatorsVec)"); + for (before, after) in patches.iter() { + patched = patched.replace(before, after); + } - let diff = TextDiff::from_lines(&contents, &patched_contents); + let diff = TextDiff::from_lines(&original, &patched); println!("{}", diff.unified_diff().context_radius(3)); - std::fs::write(&path, patched_contents)?; + std::fs::write(&path, patched)?; } Ok(())