Skip to content
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

"merge" command to help bringing release notes from release branches back to the default branch #534

Open
mdellweg opened this issue Jul 12, 2023 · 6 comments

Comments

@mdellweg
Copy link
Contributor

It would be tremendously helpful if towncrier hat a merge command, where you could specify a second changes file (presumably a diverged version of the same on a different branch) and it would add all the missing versions release notes to the main changes file. Even more convenient, if you could just specify the other branch to get the changes from.
This would help in a scenario where you release the software only on release branches and still want all the bugfix releases of old branches to show up in the main branches changelog.
(Due to the nature of the context around the latest z on a branch, cherry-picks usually won't apply cleanly. Also this should not affect any changelog snippets.)

@adiroiban
Copy link
Member

Hi, Thanks for the report.

It is not clear how this merge command will work.

Can you provide the documentation for how this feature could work?

Feel free to send a PR with a proof of concept for this command.

Regards

@mdellweg
Copy link
Contributor Author

Let me try to explain by example.
There is CHANGES.txt on the default branch containing entries for versions 2.0.0, 1.0.0 and now you need to release 1.0.1, which you do on a release branch (release-1.0). You cherry-pick some changes with their snippets and now call towncrier on that branch generating an entry for version 1.0.1. There are now charges for 1.0.1, 1.0.0 .
Now I would want to switch back to the main branch and call ’towncrier merge --branch release-1.0’. I expect it to find the entry for 1.0.1 (and all other ones missing in the default branch) and fold it into the default branches CHANGES.txt, now containing 2.0.0, 1.0.1, 1.0.0 .

@adiroiban
Copy link
Member

I guess that you need to get some sort of support for maintenance releases.

An exact example with an exact list of fragments in each branch and the expected content for each branch would help.

I am still not sure I understand what is needed here and what is your expected result :)

But I think is best to try write the documentation for this feature.

It can server as the specification for any future change and can be of great help once someone want to implement this functionality.

Cheers

@mdellweg
Copy link
Contributor Author

@adiroiban I took a shot at the proof of concept, and hope some of it could be recycled into towncrier.
The thing I implemented is a bit more specific and collects from all suspicious branches, but I think it could be turned into a loop over towncrier merge --branch ${BRANCHNAME} or git show ${BRANCHNAME}:docs/CHANGES.md | towncrier merge --file - if you don't want to involve git.

https://github.com/mdellweg/pulp-cli/blob/release_workflow/.ci/scripts/collect_changes.py

@adiroiban
Copy link
Member

I get 404 on that page.

Feel free to send a PR.

As long as the functionality is well documented and tested it can be merged.


I am just helping maintain the package.
For me, towncrier does what I need since 2017 ... so I don't see much use in any other new feature :)

This is why I don't want to add my subjective opinion on whether something is needed or not.

Regards

@mdellweg
Copy link
Contributor Author

Right. This is what we use these days:

https://github.com/pulp/pulp-cli/blob/main/.ci/scripts/collect_changes.py

I hope, I will find the time soon to move it into a pr.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants