fix: get_current_release_version incorrectly parses commit message with version#444
fix: get_current_release_version incorrectly parses commit message with version#444ngshiheng wants to merge 3 commits intopython-semantic-release:masterfrom ngshiheng:fix/get-new-version
Conversation
|
I'm not sure why mypy failed here, any ideas? Update: the mypy failure seems to be related to python/typeshed#7724 and python/typeshed#7696. I'm skipping mypy check for that specific line for now. |
danth
left a comment
There was a problem hiding this comment.
When Python semantic release is not running under GitHub Actions, the commit author will be different. I don't see any obvious way of knowing what the author will be in these cases.
We could parse the local Git configuration, however, some people might be using their own account details for Python semantic release commits. It's also possible for the commit author to be changed at any point in the project's history.
Currently, these changes will stop versions from being detectable in a non-Actions setting.
|
first: sorry for introducing this issue. I wrote about this issue in context of the change-log here already #424 but somehow missed to to think about it in terms of the prerelease implementation. I see two options for quick solutions:
For the future, let's discuss here #424 if perhaps having only tags as version sources could make this package more robust and make changes / addons easier.... |
|
@danth makes sense. I didn't consider the fact that users could be using python-semantic-release without GitHub Actions. this PR won't work then. i'll go ahead and close this PR @jacksbox no worries! i'd go with quick solution 1 as i'd expect this bug to break lots of repositories' CI. however, take my words with a grain of salt; i'm sure the maintainers know a lot better I really appreciate you guys putting effort into this library, thank you! |
Context:
get_current_release_version_by_commitsseems to be parsing version incorrectly from commit messages2.13.8Main changes:
get_commit_lognow yields an additionalcommit.authorinfo to the returned tupleget_current_release_version_by_commitsnow checks thatcommit_author.name == "github-actions" and commit_author.email == "action@github.com"before returning version that matches regex in the commit messageDescription:
How has this been tested:
toxlocally and passes all test cases../python-semantic-release/semantic_release/.venv/bin/python -m semantic_release publish -v DEBUG --nooplocally on one of my repository that uses and failedpython-semantic-releaseaction recentlyLet me know if this works! I'm more than happy to work together to fix this!