Skip to content

Conversation

donoghuc
Copy link
Member

@donoghuc donoghuc commented Oct 1, 2025

The regex for finding the latest release (as a fallback when current is not in the file) had a bug. This caused the generated docs to be inserted at the wrong place in the file (the end of the file) instead of the top. This commit fixes the logic such that we find the last release when the current is not found.

Closes #17952

The regex for finding the latest release (as a fallback when current is not in
the file) had a bug. This caused the generated docs to be inserted at the wrong
place in the file (the end of the file) instead of the top. This commit fixes
the logic such that we find the last release when the current is not found.
Copy link
Contributor

github-actions bot commented Oct 1, 2025

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

Copy link
Contributor

mergify bot commented Oct 1, 2025

This pull request does not have a backport label. Could you fix it @donoghuc? 🙏
To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-8./d is the label to automatically backport to the 8./d branch. /d is the digit.
  • If no backport is necessary, please add the backport-skip label

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

@donoghuc donoghuc added the backport-active-all Automated backport with mergify to all the active branches label Oct 1, 2025
@elasticmachine
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Copy link
Contributor

@kaisecheng kaisecheng left a comment

Choose a reason for hiding this comment

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

LGTM

@donoghuc donoghuc merged commit a3228e2 into elastic:main Oct 2, 2025
13 checks passed
Copy link
Contributor

github-actions bot commented Oct 2, 2025

@Mergifyio backport 8.18 8.19 9.0 9.1 9.2

Copy link
Contributor

mergify bot commented Oct 2, 2025

backport 8.18 8.19 9.0 9.1 9.2

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request Oct 2, 2025
The regex for finding the latest release (as a fallback when current is not in
the file) had a bug. This caused the generated docs to be inserted at the wrong
place in the file (the end of the file) instead of the top. This commit fixes
the logic such that we find the last release when the current is not found.

(cherry picked from commit a3228e2)

# Conflicts:
#	tools/release/generate_release_notes_md.rb
mergify bot pushed a commit that referenced this pull request Oct 2, 2025
The regex for finding the latest release (as a fallback when current is not in
the file) had a bug. This caused the generated docs to be inserted at the wrong
place in the file (the end of the file) instead of the top. This commit fixes
the logic such that we find the last release when the current is not found.

(cherry picked from commit a3228e2)
mergify bot pushed a commit that referenced this pull request Oct 2, 2025
The regex for finding the latest release (as a fallback when current is not in
the file) had a bug. This caused the generated docs to be inserted at the wrong
place in the file (the end of the file) instead of the top. This commit fixes
the logic such that we find the last release when the current is not found.

(cherry picked from commit a3228e2)

# Conflicts:
#	tools/release/generate_release_notes_md.rb
mergify bot pushed a commit that referenced this pull request Oct 2, 2025
The regex for finding the latest release (as a fallback when current is not in
the file) had a bug. This caused the generated docs to be inserted at the wrong
place in the file (the end of the file) instead of the top. This commit fixes
the logic such that we find the last release when the current is not found.

(cherry picked from commit a3228e2)
mergify bot pushed a commit that referenced this pull request Oct 2, 2025
The regex for finding the latest release (as a fallback when current is not in
the file) had a bug. This caused the generated docs to be inserted at the wrong
place in the file (the end of the file) instead of the top. This commit fixes
the logic such that we find the last release when the current is not found.

(cherry picked from commit a3228e2)
donoghuc added a commit that referenced this pull request Oct 6, 2025
The regex for finding the latest release (as a fallback when current is not in
the file) had a bug. This caused the generated docs to be inserted at the wrong
place in the file (the end of the file) instead of the top. This commit fixes
the logic such that we find the last release when the current is not found.

(cherry picked from commit a3228e2)

Co-authored-by: Cas Donoghue <[email protected]>
donoghuc added a commit that referenced this pull request Oct 6, 2025
The regex for finding the latest release (as a fallback when current is not in
the file) had a bug. This caused the generated docs to be inserted at the wrong
place in the file (the end of the file) instead of the top. This commit fixes
the logic such that we find the last release when the current is not found.

(cherry picked from commit a3228e2)

Co-authored-by: Cas Donoghue <[email protected]>
donoghuc added a commit that referenced this pull request Oct 6, 2025
The regex for finding the latest release (as a fallback when current is not in
the file) had a bug. This caused the generated docs to be inserted at the wrong
place in the file (the end of the file) instead of the top. This commit fixes
the logic such that we find the last release when the current is not found.

(cherry picked from commit a3228e2)

Co-authored-by: Cas Donoghue <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-active-all Automated backport with mergify to all the active branches
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Release Notes Draft workflow ordering issue
3 participants