-
Notifications
You must be signed in to change notification settings - Fork 256
fix(changelog): fixes PSR release commit exclusions for customized commit messages #1139
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
Merged
codejedi365
merged 6 commits into
python-semantic-release:master
from
codejedi365:fix/ignore-psr-version-commits
Jan 12, 2025
Merged
fix(changelog): fixes PSR release commit exclusions for customized commit messages #1139
codejedi365
merged 6 commits into
python-semantic-release:master
from
codejedi365:fix/ignore-psr-version-commits
Jan 12, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…are ignored in changelog
🎉 This PR has been published as part of Version 9.16.0 🎉You can find more information about this release on the GitHub Releases page. |
1 task
This was referenced Jan 31, 2025
This was referenced Feb 11, 2025
1 task
This was referenced Feb 22, 2025
Merged
1 task
1 task
1 task
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Purpose
Rationale
I came across this bug when looking into #1136. Although #1136 has a faulty configuration, it ends up I found that PSR was not safely escaping the custom release message prior to making it a regular expression. In this case we could of had a weird bug where the regular expression started to throw an error but most have been silent bugs. The more important situation to cover is when people have modified the commit message to strictly adhere to conventional commits even for their release commits. This can potential add characters for the scope that otherwise have special meanings in regular expressions which then leads to their commit not being ignored. This PR prevents that from happening.
Secondly, this PR also adds some regular expression validation into the configuration validation steps. This should help identify problems early for people.
How did you test?
Added unit tests to handle the validation verification both invalid and valid regular expressions to include different numbers of patterns. In the E2E tests, I added one test that rebuilds the last two releases with setting a custom commit message format. It is then validated that the changelog is the same as the original and does not have the release commit included in the changelog for the previous version. When reviewing the test verification steps below the the 2 init mode changelogs fail because the custom commit message failed to be excluded.
How to Verify