Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat(bump_rule): add BumpRule, VersionIncrement, Prerelease Enum#1518

Draft
bearomorphism wants to merge 1 commit intocommitizen-tools:masterfrom
bearomorphism:bump-rule-interface
Draft

feat(bump_rule): add BumpRule, VersionIncrement, Prerelease Enum#1518
bearomorphism wants to merge 1 commit intocommitizen-tools:masterfrom
bearomorphism:bump-rule-interface

Conversation

@bearomorphism
Copy link
Collaborator

Related issue:#129
Original PR:#1431

Description

Please seebump_rule.py,bump.py,cz/base.py,version_scheme.py andcommands/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 withCustomBumpRule.
  • Simplified code.
  • Added a new Enum classSemVerIncrement and replaceMAJOR,MINOR,PATCH with the Enum.
  • NowPrerelease is Enum.
  • Simplifyfind_increment logic inSemVerIncrement.get_highest_by_messages.
    • find_increment was 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

  • Add test cases to all the changes you introduce
  • Runpoetry all locally 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
    • Ensure backward compatibility is maintained
    • Document any manual testing steps performed
  • Update the documentation for the changes

Documentation Changes

  • Runpoetry doc locally to ensure the documentation pages renders correctly

Expected Behavior

Steps to Test This Pull Request

Additional Context

@codecov
Copy link

codecovbot commentedJun 9, 2025
edited
Loading

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.71%. Comparing base (120d514) to head (9644e1a).
⚠️ 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
FlagCoverage Δ
unittests98.71% <100.00%> (+1.37%)⬆️

Flags with carried forward coverage won't be shown.Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report?Share it here.

🚀 New features to boost your workflow:
  • ❄️Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Lee-WLee-W changed the base branch frommaster tov4-9-0-testJune 10, 2025 02:59
Copy link
Member

@Lee-WLee-W left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This is definitely a great pull request that cleans up a lot of legacy code. However, we need to be cautious about maintaining backward compatibility. We can likely add some of the logic incrementally while keeping compatibility for a few minor versions. After that, we can bump the major version and remove the compatibility handling code.

return bump.find_increment(commits, regex=bump_pattern, increments_map=bump_map)
return VersionIncrement.get_highest_by_messages(
(commit.message for commit in commits),
lambda x: self.cz.bump_rule.get_increment(x, is_major_version_zero),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

this might be a breaking change for other non-standardczs

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

We'll need a way to keep backward compatibility or move it to 5.0.0 instead (but that would be a pity since the PR looks os good)

Copy link
CollaboratorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Could you provide more details about why this might be a breaking change for non-standardcz s? I am not familiar with non-standard cz. Thanks

@bearomorphism
Copy link
CollaboratorAuthor

Can we do squash rebase on this PR when it is ready for merge?

@Lee-W
Copy link
Member

Can we do squash rebase on this PR when it is ready for merge?

yep, I can do that

@bearomorphism
Copy link
CollaboratorAuthor

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

@Lee-WLee-W modified the milestones:4.9.0,4.10.0Sep 9, 2025
@Lee-WLee-W deleted the branchcommitizen-tools:masterSeptember 9, 2025 06:09
@Lee-WLee-W closed thisSep 9, 2025
@Lee-WLee-W reopened thisSep 9, 2025
@Lee-WLee-W changed the base branch fromv4-9-0-test tomasterSeptember 9, 2025 06:19
Copy link
CollaboratorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Core feature change

@bearomorphism
Copy link
CollaboratorAuthor

We can get back to this PR after#1598

@bearomorphism
Copy link
CollaboratorAuthor

@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.

@bearomorphism
Copy link
CollaboratorAuthor

(I've resolved merge conflicts for several times for this PR)

@Lee-W
Copy link
Member

This would fall into4.11.0. Let's foucs on merging the non-features PRs first and then get back to this one.

@bearomorphism
Copy link
CollaboratorAuthor

A lot of conflicts... I will probably create another branch and do the change again...

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@Lee-WLee-WLee-W left review comments

@woilewoileAwaiting requested review from woilewoile is a code owner

@noirbizarrenoirbizarreAwaiting requested review from noirbizarrenoirbizarre is a code owner

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

Projects

None yet

Milestone

4.11.0

Development

Successfully merging this pull request may close these issues.

2 participants

@bearomorphism@Lee-W

[8]ページ先頭

©2009-2026 Movatter.jp