You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
change log list is empty, Not created any chagelog.md file on existing repo #362
I don't know for sure yet, because I haven't had time to systematically investigate, but I think this behavior is fixed after you merge your branch to main/master on github. Once I merged one PR with the new python-semantic-release config in it, and made a tag, then everything seemed to work.
Again, haven't investigated systematically yet, just happened to notice it.
From what I understand, the code is reading the commit-messages and using the one containing the from_version as well as the one containing the to_version. So, if your commit-history does not contain any commit-messages (usually generated by python-semantic-release as well) containing these versions, the changelog cannot determine those commits and therefore does not report any commits.
Since the whole versioning is happing based on tags (if configured) this should be done for the changelog as well, if I understand this correctly. Can anybody confirm this?
@triplem, I can confirm your investigation. I came to the same conclusion. I dug through the code and noticed that the changelog code semantic_release.history.logs.generate_changelog():105 checks explicitly for a commit with the to_version number in the commit_message. If latest version is not found, then it burns through all the commits until there are no more. Since it is never found it returns with an empty changelog dictionary {"breaking": []}.
This definitely seems like a bug to me since this is incompatible with the semantic_release configuration options of version_source equals tag or tag_only. It seems to me this function was created based on the default option of version_source = "commit". My recommendation for a fix is to (1) integrate in the version_source configuration value as a control flow mechanism for how to find the latest commit or (2) use tags as the initial detection mechanism (it's more direct) and use commit parsing as secondary. In either case, to implement commit-finding with tags, the latest commit can be located via list(reversed(repo.tags)) -> "List[git.TagReference]". git.TagReference objects provide a commit parameter, which gives us the immediate rev hash. From here, the regular commit parsing should take place to build the changelog.
I think this behavior is fixed after you merge your branch to main/master on github
I did not see any code in the semantic_release.cli.changelog() process flow that would suggest that the generation of the changelog checks which branch it is on or the use of config.get('branch') configuration variable. If I missed something then please let me know.
@relekang / other maintainers, please let me know which method (1, 2, or alternative) you prefer and I'll try to find some spare time to create a PR.
This issue is stale because it has not been confirmed or planned by the maintainers and has been open 90 days with no recent activity. It will be closed in 7 days, if no further activity occurs. Thank you for your contributions.
Activity
github-actions commentedon Aug 24, 2021
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.
steven-murray commentedon Feb 1, 2022
I am also having this issue when running
semantic-release changeloglocally. Does anyone have a workaround?github-actions commentedon Feb 24, 2022
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.
neubi4 commentedon Apr 4, 2022
We also have this issue. I can reproduce this in an new repo:
setup.cfg
version.py
Command Output
So Changelog Output is empty. Am i missing some config?
Complete Test Changelog:
Python and PIP Packages versions
steven-murray commentedon Apr 4, 2022
I don't know for sure yet, because I haven't had time to systematically investigate, but I think this behavior is fixed after you merge your branch to main/master on github. Once I merged one PR with the new python-semantic-release config in it, and made a tag, then everything seemed to work.
Again, haven't investigated systematically yet, just happened to notice it.
github-actions commentedon Apr 26, 2022
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.
triplem commentedon May 20, 2022
Could it be, that the version is looked up in commit messages instead of tags?
triplem commentedon May 20, 2022
From what I understand, the code is reading the commit-messages and using the one containing the from_version as well as the one containing the to_version. So, if your commit-history does not contain any commit-messages (usually generated by python-semantic-release as well) containing these versions, the changelog cannot determine those commits and therefore does not report any commits.
Since the whole versioning is happing based on tags (if configured) this should be done for the changelog as well, if I understand this correctly. Can anybody confirm this?
github-actions commentedon Jun 12, 2022
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.
codejedi365 commentedon Jun 29, 2022
@triplem, I can confirm your investigation. I came to the same conclusion. I dug through the code and noticed that the changelog code
semantic_release.history.logs.generate_changelog():105checks explicitly for a commit with theto_versionnumber in the commit_message. If latest version is not found, then it burns through all the commits until there are no more. Since it is never found it returns with an empty changelog dictionary{"breaking": []}.This definitely seems like a bug to me since this is incompatible with the
semantic_releaseconfiguration options ofversion_sourceequalstagortag_only. It seems to me this function was created based on the default option ofversion_source = "commit". My recommendation for a fix is to (1) integrate in theversion_sourceconfiguration value as a control flow mechanism for how to find the latest commit or (2) use tags as the initial detection mechanism (it's more direct) and use commit parsing as secondary. In either case, to implement commit-finding with tags, the latest commit can be located vialist(reversed(repo.tags)) -> "List[git.TagReference]".git.TagReferenceobjects provide acommitparameter, which gives us the immediaterevhash. From here, the regular commit parsing should take place to build the changelog.I did not see any code in the
semantic_release.cli.changelog()process flow that would suggest that the generation of the changelog checks which branch it is on or the use ofconfig.get('branch')configuration variable. If I missed something then please let me know.@relekang / other maintainers, please let me know which method (1, 2, or alternative) you prefer and I'll try to find some spare time to create a PR.
github-actions commentedon Jul 23, 2022
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 commentedon Nov 14, 2022
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 commentedon Mar 27, 2024
This issue is stale because it has not been confirmed or planned by the maintainers and has been open 90 days with no recent activity. It will be closed in 7 days, if no further activity occurs. Thank you for your contributions.
codejedi365 commentedon Mar 30, 2024
Resolved by #362, and also obsolete as of
v8sinceversion_sourceis no longer a configuration option