python-semantic-release icon indicating copy to clipboard operation
python-semantic-release copied to clipboard

Changelog generation broken in tag mode

Open danth opened this issue 5 years ago • 3 comments

Splitting https://github.com/relekang/python-semantic-release/issues/109#issuecomment-586504170 off into a separate issue.

I'm having some trouble getting release notes to publish to GitHub. Here's the relevant section from the debug log:

Updating changelog
New release published
Wed, 12 Feb 2020 23:34:00 GMT semantic_release:hvcs 'get_hvcs: hvcs=' 'github' +7.1s
Wed, 12 Feb 2020 23:34:00 GMT semantic_release:history:logs 'generate_changelog("0.4.0", "1.0.0")' +7.1s
Wed, 12 Feb 2020 23:34:00 GMT semantic_release:history:logs 'markdown_changelog(version="1.0.0", header=False, changelog=...)' +4.2ms
Wed, 12 Feb 2020 23:34:00 GMT semantic_release:hvcs 'post_changelog(owner=AlphaMycelium, repository=numunit, version=1.0.0)' +4.4ms
Wed, 12 Feb 2020 23:34:00 GMT semantic_release:hvcs 'get_hvcs: hvcs=' 'github' +71.75us
Wed, 12 Feb 2020 23:34:00 GMT semantic_release:hvcs:github 'listing releases' +0.0us
Wed, 12 Feb 2020 23:34:01 GMT semantic_release:hvcs:github 'response #1, status_code=201, status=True' +235.7ms

The created release does not contain the Markdown changelog but instead just the version number.

danth avatar Feb 15 '20 15:02 danth

Found the cause of this bug. When version_source=tag, no new commits are created containing the version number. So, during generation of the changelog, we skip straight over where the version begins:

https://github.com/relekang/python-semantic-release/blob/e427658e33abf518191498c3142a0f18d3150e07/semantic_release/history/logs.py#L108-L111

Therefore the generated changelog is blank and GitHub replaces it with the tag message automatically.

danth avatar Feb 21 '20 10:02 danth

Any movement on this? I'm switching our CI to us semantic-release version with the tags option to avoid pushing commits from the pipeline. Currently, this defect means I'll just lose changelog generation. Not the end of the world, but not ideal either.

rpocase avatar Apr 21 '21 19:04 rpocase

This bug report has been labelled as help wanted since there has been no activity in the last 3 weeks. It will not be closed.

github-actions[bot] avatar May 13 '21 00:05 github-actions[bot]