cargo-release icon indicating copy to clipboard operation
cargo-release copied to clipboard

wrong commit message when cargo release --workspace is run with single crate

Open psandana opened this issue 1 year ago • 0 comments

Summary

If a virtual workspace only contains a single crate, and the following line is run:

cargo release patch --workspace --execute

It produces the following commit message:

chore: Release {{crate_name}} version 0.0.1

Expected

The expectation would be to use the single crate name, or, the list of crates and versions.

Root-cause

The following line introduces the issue: https://github.com/crate-ci/cargo-release/blob/9a4e0ce535666db01a8014793ed62993eb488cac/src/config.rs#L460 It assumes if there is single crate, even if the user in purpose provided the --workspace argument, that will use the single crate mode, but it does not fetches the crate name correctly.

Expected fixes

  • Honour the --workspace argument and do not default to crate mode if len is 1, or,
  • Provide the name of the crate correctly in the commit message.

Extras:

Ideally, the --workspace argument should generate a commit listing all packages and their versions.

psandana avatar Sep 06 '23 14:09 psandana