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

[changelog] Generate changelog from issues and / or pull requests #816

Open
knutwannheden opened this issue Apr 16, 2022 · 9 comments
Open
Labels
enhancement New feature or request

Comments

@knutwannheden
Copy link

Is your feature request related to a problem? Please describe.
Generating the changelog / release notes from the commits is a very universal approach and simplifies a lot of things. But for platforms like GitHub and GitLab I think it would make sense to allow generating the release notes from a list of closed issues and / or merged PRs (aka MRs in GitLab) since the last release. This offers the advantage (YMMV...) that:

  • the issue (or PR) description can be modified "after the fact", so that the issue / PR can be recategorized when necessary (e.g. by adjusting the labels)
  • a issue / PR can be declared as breaking after the fact (this is basically the same as the bullet above)
  • the commit messages don't need to follow strict conventions (again, YMMV)

I think a lot of GitHub projects already somehow automatically generate the release notes based on issue / PR queries. Examples that come to mind are Quarkus and HashiCorp repos like Terraform.

I suppose the actual list of issues / PRs that comprise a release largely depends on the project's release strategy and how they organize their issues using milestones (in GitHub) and tags.

Describe the solution you'd like
I don't know JReleaser very well, so I can't really comment on this yet. I suppose that it should somehow be possible, however, to generate the changelog based on some issue and / or PR (MR) query for platforms like GitHub and GitLab and then extract the title, description, labels, milestone from there to drive the changelog generation. The user would have to supply a query or query template and of course also the details required to categorize the issues / PRs.

Describe alternatives you've considered
If manual workarounds exist which still leverage JReleaser, then I am very interested!

@knutwannheden knutwannheden added the enhancement New feature or request label Apr 16, 2022
@aalmiray
Copy link
Member

@knutwannheden thank you for the suggestion. This particular feature has been proposed a few times but we decided to wait after 1.0.0 to tackle it. Now is a good time to discuss ideas and implement it 😄

While you wait, I can recommend you release-drafter which served as inspiration for JReleaser's changelog capabilities https://github.com/marketplace/actions/release-drafter

@knutwannheden
Copy link
Author

Thanks for the pointer. I went through your open issues, but couldn't find anything similar to this issue. Feel free to close it, if you already track this elsewhere.

@aalmiray
Copy link
Member

Oh no, I explained myself badly. The idea has been discussed somewhere else and we were missing a ticket to track it. Thank you for opening a ticket for it 😅

@aalmiray aalmiray changed the title Changelog from issues and / or pull requests [changelog] Generate changelog from issues and / or pull requests Apr 27, 2022
@lppedd
Copy link

lppedd commented Apr 9, 2023

Hey there!
Any plan to integrate this? If not, is there any way I can customize the changelog behavior using the Maven plugin?

@aalmiray
Copy link
Member

aalmiray commented Apr 9, 2023

JReleaser already supports generating a changelog using Github's native release notes feature. We don't [yet] support custom changelog generation based on issues/PRs/MRs as we do with commit messages.

There are several ways to customize the changelog based on commit messages https://jreleaser.org/guide/latest/reference/release/changelog.html

@lppedd
Copy link

lppedd commented Apr 9, 2023

@aalmiray currently our releases' notes, published in GitHub Enterprise 3.4.5, are handled through GitHub's defaults (a list of merged PRs between tags). Seems like I can give it a go then. Thanks!

@aalmiray
Copy link
Member

aalmiray commented Apr 9, 2023

Use the releaseNotes property of the Github releaser https://jreleaser.org/guide/latest/reference/release/github.html

@zakkak
Copy link

zakkak commented Jul 19, 2023

As discussed in graalvm/mandrel-packaging#350 (comment) to replicate the current release notes used in Mandrel releases we rely on this feature being implemented. I am willing to give it a try, but will need some guidance (and I might need to drop the effort if it turns out too time consuming).

Describe the solution you'd like:

At a bare minimum it looks like we would need a new option to instruct JReleaser to use PRs (and issues at some point?) instead of commits. As a second step we might also need to add an option to filter PRs (or issues) based on the milestone.

As the end user I would like to be able to use a configuration like the following:

changelog:
  formatted: ALWAYS
  contentTemplate: ./changelog.tpl
  skipMergeCommits: true
  usePRsInsteadOfCommits: true     # <--------- new option
  includeMilestones:               # <--------- new option
    - mandrel-23.0.0.0-Final
  excludeMilestones:               # <--------- new option (not sure what would be the use case of this TBH)
    - non-release-milestone
  includeLabels:
    - backport
    - release/noteworthy-feature
  categories:
    - title: 'Noteworthy'
      # Used for identifying the category
      key: 'noteworthy'
      labels:
        - 'release/noteworthy-feature'
      order: 1
    - title: 'Backports'
      key: 'backport'
      labels:
        - 'backport'
      order: 2

@aalmiray
Copy link
Member

This is a good start, though I'd suggest adding a new section to changelog instead of 3 properties at the same level as existing ones.

Also, there might be some that would like to parse both commits and remote PR/Issues thus this option should not be exclusive (PRsInsteadOfCommits) but rather an opt-in with some sort of tristate enum include with NO, YES, EXCLUSIVELY. This new section also contains includedMilestones (assumes the current one based on patterns) and excludedMilestones (empty by default).

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

No branches or pull requests

4 participants