Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected prerelease behaviour with Changelog containing markdown links #369

Closed
TSNoble opened this issue Apr 10, 2021 · 2 comments
Closed

Comments

@TSNoble
Copy link

TSNoble commented Apr 10, 2021

I'm having some issues running prerelease with a Changelog that looks like the following:

Changelog
===
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).


0.0.1 (unreleased)
-------------------

- foo.

Expected Outcome:

Changelog
===
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).


0.0.1 (2021-04-10)
-------------------

- foo.

Actual Outcome:

Changelog
===
0.0.1 (2021-04-10)


0.0.1 (unreleased)
-------------------

- foo.


Additional notes:

Removing the links fixes the issue. I suspect it may be due to the fact that they use parentheses, which I think zest uses to determine which line needs updating. Perhaps the logic could be updated to specifically look for "(unreleased)"? Happy to raise a PR if the change sounds sensible

@mauritsvanrees
Copy link
Member

Confirmed. I tried adding an extra line of white space, and fixing the underlines to have the same length as their headers, but that did not help. Putting the notes above the Changelog header did not help either.

Specifically looking for "(unreleased)" may help for prerelease, but in postrelease we would expect to only find a date. So that way to fix it seems hard.

In general, I think we do not handle MarkDown changelogs well, especially not the hashes for headers.
I tried with this (copied and adapted from https://keepachangelog.com/en/1.0.0/, which I did not yet know, but I like it):

# Changelog

## [1.1.0] - unreleased
### Added
- A test.

## [1.0.0] - 2017-06-20
### Added
- Blah

prerelease turned this into:

# Changelog

1.1.0 (2021-05-04)
### Added
- A test.

## [1.0.0] - 2017-06-20
### Added
- Blah

So the hashes in front of 1.1.0 are lost.
(Note: we always put the date in brackets, we do not try to adapt to the existing style, here with a dash, as we probably thought that too complicated.)

So a PR would probably need to do be a bigger change for supporting MarkDown in general. Preferably without a hard dependency on a package for reading MarkDown.

If you can figure out a smaller change, that would be fine too. But it would need to work for both prerelease and postrelease to be consistent.

@mauritsvanrees
Copy link
Member

MarkDown support was added today in PR #398.
Released in zest.releaser = 7.2.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants