Skip to content

Commit e570274

Browse files
committed
wip - update release notes automation to use new markdown format
1 parent d7b8b72 commit e570274

File tree

7 files changed

+770
-260
lines changed

7 files changed

+770
-260
lines changed

build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/release/GenerateReleaseNotesTask.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,11 @@ public void executeTask() throws IOException {
139139
);
140140

141141
LOGGER.info("Generating breaking changes / deprecations notes...");
142-
BreakingChangesGenerator.update(
142+
ReleaseNotesGenerator.update(
143143
this.breakingChangesTemplate.get().getAsFile(),
144144
this.breakingChangesMigrationFile.get().getAsFile(),
145-
entries
145+
qualifiedVersion,
146+
changelogsByVersion.getOrDefault(qualifiedVersion, Set.of())
146147
);
147148

148149
LOGGER.info("Updating migration/index...");

build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/release/ReleaseNotesGenerator.java

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,11 @@ public class ReleaseNotesGenerator {
3939
TYPE_LABELS.put("breaking", "Breaking changes");
4040
TYPE_LABELS.put("breaking-java", "Breaking Java changes");
4141
TYPE_LABELS.put("bug", "Bug fixes");
42+
TYPE_LABELS.put("fixes", "Fixes");
4243
TYPE_LABELS.put("deprecation", "Deprecations");
4344
TYPE_LABELS.put("enhancement", "Enhancements");
4445
TYPE_LABELS.put("feature", "New features");
46+
TYPE_LABELS.put("features-enhancements", "Features and enhancements");
4547
TYPE_LABELS.put("new-aggregation", "New aggregation");
4648
TYPE_LABELS.put("regression", "Regressions");
4749
TYPE_LABELS.put("upgrade", "Upgrades");
@@ -63,16 +65,34 @@ static String generateFile(String template, QualifiedVersion version, Set<Change
6365
bindings.put("version", version);
6466
bindings.put("changelogsByTypeByArea", changelogsByTypeByArea);
6567
bindings.put("TYPE_LABELS", TYPE_LABELS);
68+
bindings.put("unqualifiedVersion", version.withoutQualifier());
69+
bindings.put("versionWithoutSeparator", version.withoutQualifier().toString().replaceAll("\\.", ""));
6670

6771
return TemplateUtils.render(template, bindings);
6872
}
6973

74+
private static String getTypeFromEntry(ChangelogEntry entry) {
75+
if (entry.getBreaking() != null) {
76+
return "breaking";
77+
}
78+
79+
if (entry.getType().equals("feature") || entry.getType().equals("enhancement")) {
80+
return "features-enhancements";
81+
}
82+
83+
if (entry.getType().equals("bug")) {
84+
return "fixes";
85+
}
86+
87+
return entry.getType();
88+
}
89+
7090
private static Map<String, Map<String, List<ChangelogEntry>>> buildChangelogBreakdown(Set<ChangelogEntry> changelogs) {
7191
Map<String, Map<String, List<ChangelogEntry>>> changelogsByTypeByArea = changelogs.stream()
7292
.collect(
7393
groupingBy(
7494
// Entries with breaking info are always put in the breaking section
75-
entry -> entry.getBreaking() == null ? entry.getType() : "breaking",
95+
entry -> getTypeFromEntry(entry),
7696
TreeMap::new,
7797
// Group changelogs for each type by their team area
7898
groupingBy(

build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/release/ReleaseToolsPlugin.java

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -80,26 +80,17 @@ public void apply(Project project) {
8080
task.setReleaseNotesIndexTemplate(projectDirectory.file(RESOURCES + "templates/release-notes-index.asciidoc"));
8181
task.setReleaseNotesIndexFile(projectDirectory.file("docs/reference/release-notes.asciidoc"));
8282

83-
task.setReleaseNotesTemplate(projectDirectory.file(RESOURCES + "templates/release-notes.asciidoc"));
83+
task.setReleaseNotesTemplate(projectDirectory.file(RESOURCES + "templates/release-notes.md"));
8484
task.setReleaseNotesFile(
85-
projectDirectory.file(
86-
String.format(
87-
"docs/reference/release-notes/%d.%d.%d.asciidoc",
88-
version.getMajor(),
89-
version.getMinor(),
90-
version.getRevision()
91-
)
92-
)
85+
projectDirectory.file("docs/release-notes/index.md")
9386
);
9487

9588
task.setReleaseHighlightsTemplate(projectDirectory.file(RESOURCES + "templates/release-highlights.asciidoc"));
9689
task.setReleaseHighlightsFile(projectDirectory.file("docs/reference/release-notes/highlights.asciidoc"));
9790

98-
task.setBreakingChangesTemplate(projectDirectory.file(RESOURCES + "templates/breaking-changes.asciidoc"));
91+
task.setBreakingChangesTemplate(projectDirectory.file(RESOURCES + "templates/breaking-changes.md"));
9992
task.setBreakingChangesMigrationFile(
100-
projectDirectory.file(
101-
String.format("docs/reference/migration/migrate_%d_%d.asciidoc", version.getMajor(), version.getMinor())
102-
)
93+
projectDirectory.file("docs/release-notes/breaking-changes.md")
10394
);
10495
task.setMigrationIndexTemplate(projectDirectory.file(RESOURCES + "templates/migration-index.asciidoc"));
10596
task.setMigrationIndexFile(projectDirectory.file("docs/reference/migration/index.asciidoc"));
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
navigation_title: "Elasticsearch"
3+
mapped_pages:
4+
- https://www.elastic.co/guide/en/elasticsearch/reference/current/breaking-changes.html
5+
---
6+
7+
# Elasticsearch breaking changes [elasticsearch-breaking-changes]
8+
Before you upgrade, carefully review the Elasticsearch breaking changes and take the necessary steps to mitigate any issues.
9+
10+
To learn how to upgrade, check out <uprade docs>.
11+
12+
% ## Next version [elasticsearch-nextversion-breaking-changes]
13+
% **Release date:** Month day, year
14+
15+
## ${unqualifiedVersion} [elasticsearch-${versionWithoutSeparator}-breaking-changes]
16+
**Release date:** April 01, 2025
17+
<% for (team in changelogsByTypeByArea['breaking'].keySet()) {
18+
print "\n${team}:\n";
19+
20+
for (change in changelogsByTypeByArea['breaking'][team]) {
21+
print "* ${change.summary} [#${change.pr}](https://github.com/elastic/elasticsearch/pull/${change.pr})"
22+
if (change.issues != null && change.issues.empty == false) {
23+
print change.issues.size() == 1 ? " (issue: " : " (issues: "
24+
print change.issues.collect { "{es-issue}${it}[#${it}]" }.join(", ")
25+
print ")"
26+
}
27+
print "\n"
28+
}
29+
}
30+
print "\n\n"
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
navigation_title: "Elasticsearch"
3+
mapped_pages:
4+
- https://www.elastic.co/guide/en/elasticsearch/reference/current/es-connectors-release-notes.html
5+
- https://www.elastic.co/guide/en/elasticsearch/reference/current/es-release-notes.html
6+
- https://www.elastic.co/guide/en/elasticsearch/reference/master/release-notes-${unqualifiedVersion}.html
7+
- https://www.elastic.co/guide/en/elasticsearch/reference/master/migrating-${version.major}.${version.minor}.html
8+
---
9+
10+
# Elasticsearch release notes [elasticsearch-release-notes]
11+
12+
Review the changes, fixes, and more in each version of Elasticsearch.
13+
14+
To check for security updates, go to [Security announcements for the Elastic stack](https://discuss.elastic.co/c/announcements/security-announcements/31).
15+
16+
% Release notes include only features, enhancements, and fixes. Add breaking changes, deprecations, and known issues to the applicable release notes sections.
17+
18+
% ## version.next [felasticsearch-next-release-notes]
19+
% **Release date:** Month day, year
20+
21+
% ### Features and enhancements [elasticsearch-next-features-enhancements]
22+
% *
23+
24+
% ### Fixes [elasticsearch-next-fixes]
25+
% *
26+
27+
## ${unqualifiedVersion} [elasticsearch-${versionWithoutSeparator}-release-notes]
28+
**Release date:** April 01, 2025
29+
<%
30+
for (changeType in changelogsByTypeByArea.keySet()) {
31+
%>
32+
### ${ TYPE_LABELS.getOrDefault(changeType, 'No mapping for TYPE_LABELS[' + changeType + ']') } [elasticsearch-${versionWithoutSeparator}-${changeType}]
33+
<% for (team in changelogsByTypeByArea[changeType].keySet()) {
34+
print "\n${team}:\n";
35+
36+
for (change in changelogsByTypeByArea[changeType][team]) {
37+
print "* ${change.summary} [#${change.pr}](https://github.com/elastic/elasticsearch/pull/${change.pr})"
38+
if (change.issues != null && change.issues.empty == false) {
39+
print change.issues.size() == 1 ? " (issue: " : " (issues: "
40+
print change.issues.collect { "{es-issue}${it}[#${it}]" }.join(", ")
41+
print ")"
42+
}
43+
print "\n"
44+
}
45+
}
46+
}
47+
print "\n\n"

docs/release-notes/breaking-changes.md

Lines changed: 67 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5,58 +5,99 @@ mapped_pages:
55
---
66

77
# Elasticsearch breaking changes [elasticsearch-breaking-changes]
8-
Before you upgrade, carefully review the Elasticsearch breaking changes and take the necessary steps to mitigate any issues.
8+
Before you upgrade, carefully review the Elasticsearch breaking changes and take the necessary steps to mitigate any issues.
99

1010
To learn how to upgrade, check out <uprade docs>.
1111

1212
% ## Next version [elasticsearch-nextversion-breaking-changes]
1313
% **Release date:** Month day, year
1414

15-
## 9.0.0 [elasticsearch-900-breaking-changes]
16-
**Release date:** March 25, 2025
15+
## 9.1.0 [elasticsearch-910-breaking-changes]
16+
**Release date:** April 01, 2025
1717

18-
Allocation
19-
: * Increase minimum threshold in shard balancer [#115831](https://github.com/elastic/elasticsearch/pull/115831)
18+
Aggregations:
19+
* Remove date histogram boolean support [#118484](https://github.com/elastic/elasticsearch/pull/118484)
20+
21+
Allocation:
22+
* Increase minimum threshold in shard balancer [#115831](https://github.com/elastic/elasticsearch/pull/115831)
2023
* Remove `cluster.routing.allocation.disk.watermark.enable_for_single_data_node` setting [#114207](https://github.com/elastic/elasticsearch/pull/114207)
21-
* Remove cluster state from `/_cluster/reroute` response [#114231](https://github.com/elastic/elasticsearch/pull/114231) (issue: [#88978](https://github.com/elastic/elasticsearch/issues/88978))
24+
* Remove cluster state from `/_cluster/reroute` response [#114231](https://github.com/elastic/elasticsearch/pull/114231) (issue: {es-issue}88978[#88978])
2225

23-
Analysis
24-
: * Snowball stemmers have been upgraded [#114146](https://github.com/elastic/elasticsearch/pull/114146)
25-
* The *german2* stemmer is now an alias for the *german* snowball stemmer [#113614](https://github.com/elastic/elasticsearch/pull/113614)
26-
* The *persian* analyzer has stemmer by default [#113482](https://github.com/elastic/elasticsearch/pull/113482) (issue: [#113050](https://github.com/elastic/elasticsearch/issues/113050))
26+
Analysis:
27+
* Snowball stemmers have been upgraded [#114146](https://github.com/elastic/elasticsearch/pull/114146)
28+
* The 'german2' stemmer is now an alias for the 'german' snowball stemmer [#113614](https://github.com/elastic/elasticsearch/pull/113614)
29+
* The 'persian' analyzer has stemmer by default [#113482](https://github.com/elastic/elasticsearch/pull/113482) (issue: {es-issue}113050[#113050])
2730
* The Korean dictionary for Nori has been updated [#114124](https://github.com/elastic/elasticsearch/pull/114124)
2831

32+
Authentication:
33+
* Configuring a bind DN in an LDAP or Active Directory (AD) realm without a corresponding bind password
34+
will prevent node from starting [#118366](https://github.com/elastic/elasticsearch/pull/118366)
2935

30-
Cluster Coordination
31-
: * Remove unsupported legacy value for `discovery.type` [#112903](https://github.com/elastic/elasticsearch/pull/112903)
36+
Cluster Coordination:
37+
* Remove unsupported legacy value for `discovery.type` [#112903](https://github.com/elastic/elasticsearch/pull/112903)
3238

39+
EQL:
40+
* Set allow_partial_search_results=true by default [#120267](https://github.com/elastic/elasticsearch/pull/120267)
3341

34-
Highlighting
35-
: * Remove support for deprecated `force_source` highlighting parameter [#116943](https://github.com/elastic/elasticsearch/pull/116943)
42+
Extract&Transform:
43+
* Restrict Connector APIs to manage/monitor_connector privileges [#119863](https://github.com/elastic/elasticsearch/pull/119863)
3644

45+
Highlighting:
46+
* Remove support for deprecated `force_source` highlighting parameter [#116943](https://github.com/elastic/elasticsearch/pull/116943)
3747

38-
Indices APIs
39-
: * Apply more strict parsing of actions in bulk API [#115923](https://github.com/elastic/elasticsearch/pull/115923)
48+
Indices APIs:
49+
* Apply more strict parsing of actions in bulk API [#115923](https://github.com/elastic/elasticsearch/pull/115923)
4050
* Remove deprecated local attribute from alias APIs [#115393](https://github.com/elastic/elasticsearch/pull/115393)
51+
* Remove the ability to read frozen indices [#120108](https://github.com/elastic/elasticsearch/pull/120108)
52+
* Remove unfreeze REST endpoint [#119227](https://github.com/elastic/elasticsearch/pull/119227)
53+
54+
Infra/Core:
55+
* Change Elasticsearch timeouts to 429 response instead of 5xx [#116026](https://github.com/elastic/elasticsearch/pull/116026)
56+
* Limit `ByteSizeUnit` to 2 decimals [#120142](https://github.com/elastic/elasticsearch/pull/120142)
57+
* Remove `client.type` setting [#118192](https://github.com/elastic/elasticsearch/pull/118192) (issue: {es-issue}104574[#104574])
58+
* Remove any references to org.elasticsearch.core.RestApiVersion#V_7 [#118103](https://github.com/elastic/elasticsearch/pull/118103)
4159

60+
Infra/Logging:
61+
* Change `deprecation.elasticsearch` keyword to `elasticsearch.deprecation` [#117933](https://github.com/elastic/elasticsearch/pull/117933) (issue: {es-issue}83251[#83251])
4262

43-
Infra/REST API
44-
: * Output a consistent format when generating error json [#90529](https://github.com/elastic/elasticsearch/pull/90529) (issue: [#89387](https://github.com/elastic/elasticsearch/issues/89387))
63+
Infra/Metrics:
64+
* Deprecated tracing.apm.* settings got removed. [#119926](https://github.com/elastic/elasticsearch/pull/119926)
4565

66+
Infra/REST API:
67+
* Output a consistent format when generating error json [#90529](https://github.com/elastic/elasticsearch/pull/90529) (issue: {es-issue}89387[#89387])
4668

47-
Ingest Node
48-
: * Remove `ecs` option on `user_agent` processor [#116077](https://github.com/elastic/elasticsearch/pull/116077)
69+
Ingest Node:
70+
* Remove `ecs` option on `user_agent` processor [#116077](https://github.com/elastic/elasticsearch/pull/116077)
4971
* Remove ignored fallback option on GeoIP processor [#116112](https://github.com/elastic/elasticsearch/pull/116112)
5072

73+
Logs:
74+
* Conditionally enable logsdb by default for data streams matching with logs-*-* pattern. [#121049](https://github.com/elastic/elasticsearch/pull/121049) (issue: {es-issue}106489[#106489])
75+
76+
Machine Learning:
77+
* Disable machine learning on macOS x86_64 [#104125](https://github.com/elastic/elasticsearch/pull/104125)
78+
79+
Mapping:
80+
* Remove support for type, fields, `copy_to` and boost in metadata field definition [#118825](https://github.com/elastic/elasticsearch/pull/118825)
81+
* Turn `_source` meta fieldmapper's mode attribute into a no-op [#119072](https://github.com/elastic/elasticsearch/pull/119072) (issue: {es-issue}118596[#118596])
82+
83+
Search:
84+
* Adjust `random_score` default field to `_seq_no` field [#118671](https://github.com/elastic/elasticsearch/pull/118671)
85+
* Change Semantic Text To Act Like A Normal Text Field [#120813](https://github.com/elastic/elasticsearch/pull/120813)
86+
* Remove legacy params from range query [#116970](https://github.com/elastic/elasticsearch/pull/116970)
87+
88+
Snapshot/Restore:
89+
* Remove deprecated `xpack.searchable.snapshot.allocate_on_rolling_restart` setting [#114202](https://github.com/elastic/elasticsearch/pull/114202)
5190

52-
Mapping
53-
: * Remove support for type, fields, `copy_to` and boost in metadata field definition [#116944](https://github.com/elastic/elasticsearch/pull/116944)
91+
TLS:
92+
* Remove TLSv1.1 from default protocols [#121731](https://github.com/elastic/elasticsearch/pull/121731)
5493

94+
Transform:
95+
* Remove `data_frame_transforms` roles [#117519](https://github.com/elastic/elasticsearch/pull/117519)
5596

56-
Search
57-
: * Remove legacy params from range query [#116970](https://github.com/elastic/elasticsearch/pull/116970)
97+
Vector Search:
98+
* Remove old `_knn_search` tech preview API in v9 [#118104](https://github.com/elastic/elasticsearch/pull/118104)
5899

100+
Watcher:
101+
* Removing support for types field in watcher search [#120748](https://github.com/elastic/elasticsearch/pull/120748)
59102

60-
Snapshot/Restore
61-
: * Remove deprecated `xpack.searchable.snapshot.allocate_on_rolling_restart` setting [#114202](https://github.com/elastic/elasticsearch/pull/114202)
62103

0 commit comments

Comments
 (0)