Repository navigation
Generate release notes and changelogs from PR titles - #776
Conversation
This comment has been minimized.
This comment has been minimized.
23b18de to
dd08403
Compare
| 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) |
There was a problem hiding this comment.
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_optionsfor the implementation ofself.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
| 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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Indeed, yeah, can be. I was surprised it works (or worked?) 🤔
Co-authored-by: Olivier Halligon <olivier.halligon@automattic.com>
|
Nice! |
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, usingget_prs_between_tagswith two explicit output formats:format: :release_notes(default): underlined version headings inRELEASE-NOTES.txt.format: :changelog: numeric## <version>headings in a file such asCHANGELOG.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: truepreviews 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
bundle exec rubocopto test for code style violations and recommendations.specs/*_spec.rb) if applicable.bundle exec rspecto run the whole test suite and ensure all your tests pass.CHANGELOG.mdfile to describe your changes under the appropriate existing###subsection of the existing## Trunksection.MIGRATION.mdfile 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.