MarcoIeni / release-plz

Publish Rust crates from CI with a Release PR.

Home Page:https://release-plz.ieni.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Release-plz reads the config, but the release PR does not contain the changelog as it is configured

sassman opened this issue · comments

Bug description

At cargo-generate I'm trying out release-plz, and have configured the git-cliff to look a bit different than usual. As from the CI Run you can see that release-plz does read the config file AND the right git-cliff config file. (You'll notice the emojis in the convential commit categories)

So far so good, however the release-pr that is created does not contain the CHANGELOG changes.

I was able once to get a CHANGELOG change in the PR, but this one did not correctly utilize the configuration provided by the git-cliff config in the repo.

  • Would you like to work on a fix? yes, but I have no idea where to look at.

To Reproduce

Steps to reproduce the behavior:

  1. create a release-plz config like this
  2. create a git-cliff config like this (as above)
  3. create a simple GH Pipeline like this
  4. see that the PR does not contain a CHANGELOG

Expected behavior

I would expect the CHANGELOG.md is updated and the change is in the release-pr.

Screenshots

Environment

  • OS: ubuntu-latest on GithubActions
  • release-plz version: release-plz-v0.3.33/linux-x64

Removing previous.version from the changelog works. We should populate this field and pass it to git-cliff somehow.

It's also bad that we are panicking:

thread 'main' panicked at crates/release_plz_core/src/changelog.rs:69:14:
cannot update changelog: TemplateRenderError("Variable `previous.version` not found in context while rendering 'template'")

Also, you can use release-plz update to test locally if you don't want to push commits

We can set previous here:


I will do it!

Thanks a lot for the swift reply and taking action.

Hey Sven, I just released a new version of release-plz.
I tested release-plz on it. The only issue I found is that the git tag link unfortunately doesn't work:

## [0.18.6] 2023-12-13

[0.18.6]: <REPO>/compare/0.18.5...0.18.6

For the default changelog, I set it manually:

pub fn with_release_link(self, release_link: impl Into<String>) -> Self {

Unfortunately, release-plz doesn't support git-cliff to 100% yet.

Thank you so much Marco,

looks already pretty good. I changed the body template a bit so that It accommodates for the missing link.

image

https://github.com/cargo-generate/cargo-generate/pull/1080/files#diff-06572a96a58dc510037d5efa622f9bec8519bc1beab13c9f251e97e657a9d4edR3

There is only one interesting (unrelated) issue with the diff of the CHANGELOG.md where the top header # Changelog is being appended in the diff at the bottom.

That is strange, but I will have a look and see if I can find the bug myself.

and BTW:

Also, you can use release-plz update to test locally if you don't want to push commits

This works, but it does not produce the same release version as it does on CI. Specifically it does not detect the breaking change and bumps the maj. version number, only the patch version number. Not sure if that is intended.

For that, you need to install cargo-semver-checks locally