Skip to content

Generate release notes and changelogs from PR titles - #776

Merged
iangmaia merged 11 commits into
trunkfrom
iangmaia/generate-release-notes-from-prs
Nov 5, 2026
Merged

iangmaia merged 11 commits into
trunkfrom
iangmaia/generate-release-notes-from-prs

Conversation

@iangmaia

@iangmaia iangmaia commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

What does it do?

Moves release-note generation into release lanes so feature PRs can supply descriptive titles and labels without editing a shared changenote file (AINFRA-3084).

Adds generate_release_notes_file, using get_prs_between_tags with two explicit output formats:

  • format: :release_notes (default): underlined version headings in RELEASE-NOTES.txt.
  • format: :changelog: numeric ## <version> headings in a file such as CHANGELOG.md, with generated headings nested beneath the version.

Each call inserts or replaces one version section and preserves the introduction, pending sections in Markdown changelogs, other versions, and line endings. The existing file must contain at least one version section in the selected format. dry_run: true previews the generated section; API and parsing errors leave the file untouched. Linked, dated, and prerelease version headings and automatic promotion of Unreleased entries are outside this change.

GitHub configuration controls label exclusions and category grouping. Also corrects the API parameter to configuration_file_path, so the requested configuration is applied. Usage and format details.

The initial consumer is Woo Android #16630, which generates notes and a separate smoke-testing report during code freeze.

Checklist before requesting a review

  • Run bundle exec rubocop to test for code style violations and recommendations.
  • Add Unit Tests (aka specs/*_spec.rb) if applicable.
  • Run bundle exec rspec to run the whole test suite and ensure all your tests pass.
  • Make sure you added an entry in the CHANGELOG.md file to describe your changes under the appropriate existing ### subsection of the existing ## Trunk section.
  • If applicable, add an entry in the MIGRATION.md file to describe how the changes will affect the migration from the previous major version and what the clients will need to change and consider. Not applicable: no breaking changes.

@iangmaia iangmaia self-assigned this Sep 29, 2026
@dangermattic

This comment has been minimized.

This comment was marked as outdated.

@iangmaia
iangmaia force-pushed the iangmaia/generate-release-notes-from-prs branch from 23b18de to dd08403 Compare November 5, 2026 12:37
@iangmaia iangmaia changed the title Generate release notes files from PR titles Generate release notes and changelogs from PR titles Nov 5, 2026
@iangmaia
iangmaia requested a balanced review from Copilot November 5, 2026 14:27

This comment was marked as outdated.

@iangmaia
iangmaia marked this pull request as ready for review November 5, 2026 17:23
@iangmaia
iangmaia requested a review from a team November 5, 2026 17:23
Comment thread docs/Release Notes.md Resolved
path = params[:release_notes_file_path]
contents = File.read(path)
format = params[:format]
options = params.values.except(:version, :release_notes_file_path, :format, :dry_run)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nitpick: what about separating the custom options of this action into a dedicated def self.custom_options or similar, then:

  • Use self.custom_options.map(&:key) here instead of a hardcoded list of the keys
  • Use GetPrsBetweenTagsAction.available_options.reject { |option| option.key == :fail_on_error } + self.custom_options for the implementation of self.available_options

That would make the list of options specific to this action be DRY'd in a single source of truth instead of having to make sure we keep them in sync between here and lines 52–61

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Oh good one 👍 Done in d832a33

target_commitish: target_commitish, # Only used if no git tag named `tag_name` exists yet
previous_tag_name: previous_tag,
config_file_path: config_file_path
configuration_file_path: config_file_path

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Checked in the docs at https://docs.github.com/en/rest/releases/releases?apiVersion=2026-03-10#generate-release-notes-content-for-a-release and confirm configuration_file_path is the right name.

Not sure by what magic it was working before. Or maybe the GitHub API changed it but kept support for the old name for compatibility?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Indeed, yeah, can be. I was surprised it works (or worked?) 🤔

iangmaia and others added 2 commits November 5, 2026 20:47
Co-authored-by: Olivier Halligon <olivier.halligon@automattic.com>
@iangmaia
iangmaia merged commit 4f81f89 into trunk Nov 5, 2026
6 checks passed
@iangmaia
iangmaia deleted the iangmaia/generate-release-notes-from-prs branch November 5, 2026 19:56
@mokagio

mokagio commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Nice!

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

Successfully merging this pull request may close these issues.

5 participants