Uh oh!
There was an error while loading. Please reload this page.
feat(bump_rule): add BumpRule, VersionIncrement, Prerelease Enum - #1431
feat(bump_rule): add BumpRule, VersionIncrement, Prerelease Enum#1431bearomorphism wants to merge 1 commit into
Conversation
566e8ec to
03aa596CompareCodecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@## refactors #1431 +/- ##
=============================================
+ Coverage 97.92% 97.97% +0.04%
=============================================
Files 58 59 +1 Lines 2704 2770 +66 =============================================
+ Hits 2648 2714 +66
Misses 56 56
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
4a0b84d to
be7cb23Comparedeae807 to
88efb61CompareUh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| self._BREAKING_CHANGE, | ||
| "fix", | ||
| "feat", | ||
| "docs", | ||
| "style", | ||
| "refactor", | ||
| "perf", | ||
| "test", | ||
| "build", | ||
| "ci", |
There was a problem hiding this comment.
This makes the pattern matching more strict.
| # TODO: deprecate these | ||
| bump_pattern: str | None = None | ||
| bump_map: dict[str, str] | None = None | ||
| bump_map_major_version_zero: dict[str, str] | None = None |
There was a problem hiding this comment.
Not sure how to address these fields if we decide to check in the bump_rule change.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| if new_increment is None: | ||
| logger.debug( | ||
| f"no increment needed for '{found_keyword}' in '{message}'" | ||
| ) | ||
| if VERSION_TYPES.index(increment) < VERSION_TYPES.index(new_increment): | ||
| logger.debug( | ||
| f"increment detected is '{new_increment}' due to '{found_keyword}' in '{message}'" | ||
| ) | ||
| increment = new_increment |
There was a problem hiding this comment.
I don't think we need these logs. The algorithm can be very simple as the current implementation of get_highest_by_messages
bearomorphism
commented
May 18, 2025
The tests finally passed... |
ecac37b to
83d6bdeCompare| 'MINOR' | ||
| """ | ||
| return SemVerIncrement.get_highest( | ||
| get_increment(line) |
There was a problem hiding this comment.
I don't think we need these logs. The algorithm can be very simple as the current implementation of
find_increment_by_callable
We can log the traces in get_increment though.
| try: | ||
| if ret := SemVerIncrement.get_highest( | ||
| (increment for name, increment in bump_map.items() if m.group(name)), | ||
| ): | ||
| return ret | ||
| except IndexError: | ||
| # Fallback to old school bump rule | ||
| pass |
There was a problem hiding this comment.
This addresses the problem mentioned in #129
BumpRule, enum SemVerIncrement and Prerelease81d0457 to
2eaf52cComparebearomorphism
commented
May 19, 2025
Hope the doc string make it easier to review |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
2eaf52c to
2e090b4Compare2e090b4 to
ffdaa62CompareBumpRule, enum SemVerIncrement and Prereleaseffdaa62 to
4f32a7fCompare4f32a7f to
52acd60Comparebaee83e to
a9cd957Comparefc31bee to
4279a25CompareUh oh!
There was an error while loading. Please reload this page.
6e3caa5 to
8c7e2d3Compare8c7e2d3 to
9c3421cCompare
Closes#129
Description
Please see
bump_rule.py,bump.py,cz/base.py,version_scheme.pyandcommands/bump.py(~350 lines).The rest 1000+ lines are just tests and renaming.
CustomBumpRule.Simplified code.SemVerIncrementand replaceMAJOR,MINOR,PATCHwith the Enum.Prereleaseis Enum.find_incrementlogic inSemVerIncrement.get_highest_by_messages.find_incrementwas the combination of 2 features: "finding the highest semantic version increment" and "parsing the semantic version increment from each git commit message".Checklist
Code Changes
poetry alllocally to ensure this change passes linter check and testsDocumentation Changes
poetry doclocally to ensure the documentation pages renders correctlyExpected Behavior
Steps to Test This Pull Request
Additional Context