feat(bump_rule): add BumpRule, VersionIncrement, Prerelease Enum
Related issue: #129 Original PR: #1431
Description
Please see bump_rule.py, bump.py, cz/base.py, version_scheme.py and commands/bump.py (~350 lines).
The rest 1000+ lines are just tests and renaming.
- Rewrote the bump pattern matching mechanism to make the algorithm more strict and maintainable.
- Maintained backward compatibility with
CustomBumpRule. - ~~Simplified code.~~
- Added a new Enum class
SemVerIncrementand replaceMAJOR,MINOR,PATCHwith the Enum. - Now
Prereleaseis Enum. - Simplify
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
- [x] I have read the contributing guidelines
Code Changes
- [x] Add test cases to all the changes you introduce
- [x] Run
poetry alllocally to ensure this change passes linter check and tests - [ ] Manually test the changes:
- [ ] Verify the feature/bug fix works as expected in real-world scenarios
- [ ] Test edge cases and error conditions
- [x] Ensure backward compatibility is maintained
- [ ] Document any manual testing steps performed
- [x] Update the documentation for the changes
Documentation Changes
- [x] Run
poetry doclocally to ensure the documentation pages renders correctly
Expected Behavior
Steps to Test This Pull Request
Additional Context
Codecov Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 98.71%. Comparing base (120d514) to head (9644e1a).
:warning: Report is 842 commits behind head on master.
Additional details and impacted files
@@ Coverage Diff @@
## master #1518 +/- ##
==========================================
+ Coverage 97.33% 98.71% +1.37%
==========================================
Files 42 61 +19
Lines 2104 2722 +618
==========================================
+ Hits 2048 2687 +639
+ Misses 56 35 -21
| Flag | Coverage Δ | |
|---|---|---|
| unittests | 98.71% <100.00%> (+1.37%) |
:arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
Can we do squash rebase on this PR when it is ready for merge?
Can we do squash rebase on this PR when it is ready for merge?
yep, I can do that
What are the next steps for this PR? If there are backward compatibility issues, I can adjust it so that this PR can be checked in. Thanks
We can get back to this PR after #1598
@Lee-W It would be great if we can complete this big PR. I can fix those backward-compatibility issues, but I need more details so I can address the issues.
(I've resolved merge conflicts for several times for this PR)
This would fall into 4.11.0. Let's foucs on merging the non-features PRs first and then get back to this one.