Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tools/release/generate_release_notes_md.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@

coming_tag_index = release_notes.find_index {|line| line.match(/^## #{current_release} \[logstash-#{current_release}-release-notes\]$/) }
coming_tag_index += 1 if coming_tag_index
release_notes_entry_index = coming_tag_index || release_notes.find_index {|line| line.match(/\[logstash-\d+-release-notes\]$/) }
release_notes_entry_index = coming_tag_index || release_notes.find_index {|line| line.match(/^## .*\[logstash-.*-release-notes\]$/) }
Copy link
Member Author

@donoghuc donoghuc Oct 1, 2025

Choose a reason for hiding this comment

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

This is a "fallback" when the current version does not have an entry yet (IE no coming_tag_index). I quote "fallback" because this is actually the most likely case given our workflows. See below for irb session showing the bug and the fix

irb(main):025:0> release_notes.find_index {|line| line.match(/\[logstash-\d+-release-notes\]$/) }
=> 291
irb(main):030:0> release_notes.find_index {|line| line.match(/^## .*\[logstash-.*-release-notes\]$/) }
=> 23


unless coming_tag_index
report << "## #{current_release} [logstash-#{current_release}-release-notes]\n\n"
Expand Down