[chore] update ID format of release notes tool (#17636)

change the format of release version from `900` to `9.0.0`
for automated URL generation

Relates: elastic/docs-content#1152
This commit is contained in:
kaisecheng 2025-05-06 13:55:08 +01:00 committed by GitHub
parent 94b516968b
commit b9381aff69
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -37,17 +37,16 @@ report = []
`git checkout #{release_branch}`
current_release = YAML.load(IO.read("versions.yml"))["logstash"]
current_release_no_dot = current_release.tr(".", "")
release_notes = IO.read(RELEASE_NOTES_PATH).split("\n")
coming_tag_index = release_notes.find_index {|line| line.match(/^## #{current_release} \[logstash-#{current_release_no_dot}-release-notes\]$/) }
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\]$/) }
unless coming_tag_index
report << "## #{current_release} [logstash-#{current_release_no_dot}-release-notes]\n\n"
report << "### Features and enhancements [logstash-#{current_release_no_dot}-features-enhancements]\n"
report << "## #{current_release} [logstash-#{current_release}-release-notes]\n\n"
report << "### Features and enhancements [logstash-#{current_release}-features-enhancements]\n"
end
plugin_changes = {}
@ -87,7 +86,7 @@ report << "Changed plugin versions:"
plugin_changes.each {|p, v| report << "#{p}: #{v.first} -> #{v.last}" }
report << "---------- GENERATED CONTENT ENDS HERE ------------\n"
report << "### Plugins [logstash-plugin-#{current_release_no_dot}-changes]\n"
report << "### Plugins [logstash-plugin-#{current_release}-changes]\n"
plugin_changes.each do |plugin, versions|
_, type, name = plugin.split("-")