Skip to content

Conversation

@zimmermannJakob
Copy link
Contributor

@zimmermannJakob zimmermannJakob commented Dec 7, 2025

Description

This PR solves issue #1694.

Checklist

Code Changes

  • Add test cases to all the changes you introduce
  • Run poetry all locally to ensure this change passes linter check and tests (Some error out on mac. I will investigate if they fail in ci)
  • Manually test the changes:
    • Verify the feature/bug fix works as expected in real-world scenarios
    • Test edge cases and error conditions (I thought about breaking changes and starting an empty changelog with prereleases.)
    • Ensure backward compatibility is maintained
    • Document any manual testing steps performed
      - [ ] Update the documentation for the changes (I do not think this applies. It works now as documented.)

### Documentation Changes

- [ ] Run poetry doc locally to ensure the documentation pages renders correctly
- [ ] Check and fix any broken links (internal or external) in the documentation

When running poetry doc, any broken internal documentation links will be reported in the console output like this:

INFO    -  Doc file 'config.md' contains a link 'commands/bump.md#-post_bump_hooks', but the doc 'commands/bump.md' does not contain an anchor '#-post_bump_hooks'.

Expected Behavior

See issue #1694.

Steps to Test This Pull Request

  1. build the changes on the branch. poetry build.
  2. Take the resulting .wheel file from dist/
  3. Install the file in a separate python environment:
  • python3 -m venv .venv && source .venv/bin/activate
  • verify env: which pip
  • pip install commitizen-4.10.0-py3-none-any.whl
  1. Go through the steps in the issue description and try reproducing the bug.

Additional Context

Known issue: When the changelog only contains pre-releases, the old behavior can still be observed. (Fixed)

@codecov
Copy link

codecov bot commented Dec 9, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.95%. Comparing base (193859b) to head (67cccef).
⚠️ Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1700      +/-   ##
==========================================
+ Coverage   97.93%   97.95%   +0.02%     
==========================================
  Files          60       60              
  Lines        2611     2646      +35     
==========================================
+ Hits         2557     2592      +35     
  Misses         54       54              

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

@zimmermannJakob zimmermannJakob marked this pull request as ready for review December 13, 2025 14:29
Copy link
Member

@woile woile left a comment

Choose a reason for hiding this comment

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

Very nice, thanks!

@zimmermannJakob
Copy link
Contributor Author

@woile @bearomorphism Thank you for your reviews!
@bearomorphism I applied your suggestions, but left the conversations open for you to verify. Where I disagreed with a suggestion, I stated why.

@bearomorphism
Copy link
Collaborator

The latest commit should not be chore. I'd suggest you to rebase the commits and adjust the commit messages, so the commit history will be cleaner after merging

@bearomorphism
Copy link
Collaborator

I believe there is a way to mock the datetime in your new tests

@bearomorphism
Copy link
Collaborator

bearomorphism commented Dec 16, 2025

I remember git commit timestamp can be specified

Thanks!🙏

@zimmermannJakob zimmermannJakob force-pushed the 1694-fix-changelog_merge_prerelease-not-working-on-cz-bump branch from 646cc6c to a16ff63 Compare December 20, 2025 14:58
@zimmermannJakob zimmermannJakob marked this pull request as draft December 20, 2025 15:00
@zimmermannJakob
Copy link
Contributor Author

@bearomorphism Thanks again for the review!

I believe there is a way to mock the datetime in your new tests

I used freezegun to set a fixed time.

I'd suggest you to rebase the commits and adjust the commit messages, so the commit history will be cleaner after merging

I tried that, but it shows a large diff now. Locally, if I do git diff upstream/master I see only my changes (changes.txt), so I am not sure why it shows the diff here on the PR. I used git reset --soft HEAD~7 to squash the commits. What did I do wrong? Any help is appreciated.

@bearomorphism bearomorphism changed the base branch from master to v4-11-0 December 20, 2025 17:38
@bearomorphism
Copy link
Collaborator

@zimmermannJakob could you try to rebase to v4-11-0? Thanks.

@zimmermannJakob zimmermannJakob force-pushed the 1694-fix-changelog_merge_prerelease-not-working-on-cz-bump branch 2 times, most recently from 9cb370d to e9f5ba9 Compare December 20, 2025 20:42
@zimmermannJakob zimmermannJakob marked this pull request as ready for review December 20, 2025 20:49
@zimmermannJakob
Copy link
Contributor Author

@bearomorphism Thank you, the diff looks good now!
Just out of curiosity, do you know what the issue was?
What is the etiquette surrounding open discussions? Should I close them if I deem them addressed, or do you close them as the creator of the discussion?

Anyway, the PR is good to go from my side.

@bearomorphism
Copy link
Collaborator

What is the etiquette surrounding open discussions? Should I close them if I deem them addressed, or do you close them as the creator of the discussion?

I would say it depends. I think PR creators can close the discussion themselves once they think the issue is resolved, but I also have seen in some cultures it's the reviewers closing the discussion.

Another option is to simply reply "fixed", but there are also people think it looks verbose if under every discussion there is a "fixed" comment.

@zimmermannJakob zimmermannJakob force-pushed the 1694-fix-changelog_merge_prerelease-not-working-on-cz-bump branch from e9f5ba9 to 976a55c Compare December 22, 2025 20:42
@bearomorphism bearomorphism changed the base branch from v4-11-0 to master December 29, 2025 11:14
@bearomorphism
Copy link
Collaborator

Changing the target branch to master to prevent the PR from auto closing. I think this PR is ready to merge but need rebasing.

@zimmermannJakob zimmermannJakob force-pushed the 1694-fix-changelog_merge_prerelease-not-working-on-cz-bump branch from 976a55c to f4a92bb Compare December 31, 2025 15:44
@bearomorphism
Copy link
Collaborator

Hi @zimmermannJakob ,

Could you help to resolve the pipeline failure? Thanks!

@zimmermannJakob zimmermannJakob force-pushed the 1694-fix-changelog_merge_prerelease-not-working-on-cz-bump branch from f4a92bb to 67cccef Compare January 13, 2026 06:38
@zimmermannJakob
Copy link
Contributor Author

Hi @bearomorphism!
Thank you for your patience. I updated this PR.

@bearomorphism bearomorphism changed the title fix(1694): changelog_merge_prerelease not working on cz bump fix(bump): fix the issue that changelog_merge_prerelease not working on cz bump Jan 13, 2026
@bearomorphism bearomorphism merged commit 370ac9d into commitizen-tools:master Jan 13, 2026
20 checks passed
@bearomorphism
Copy link
Collaborator

Thanks!

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants