Skip to content

Commit 678e4b9

Browse files
Update Elasticsearch release notes automation (#132930)
* Update breaking changes and deprecations * update release note tagging * revert tagging change * Update tests after template changes * [docs] Add support for overriding entries in the release notes (#133592) * [docs] Add support for overriding entries in the release notes * Update changelog bundles with overrides * Use ga instead of comming tag * Update tests after template change --------- Co-authored-by: Brian Seeders <[email protected]>
1 parent 04ea11b commit 678e4b9

File tree

12 files changed

+398
-57
lines changed

12 files changed

+398
-57
lines changed

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

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ public class ChangelogEntry {
4343
private Breaking breaking;
4444
private Highlight highlight;
4545
private Deprecation deprecation;
46+
private String entryOverride;
4647

4748
private static final ObjectMapper yamlMapper = new ObjectMapper(new YAMLFactory());
4849

@@ -125,6 +126,14 @@ public void setDeprecation(Deprecation deprecation) {
125126
this.deprecation = deprecation;
126127
}
127128

129+
public String getEntryOverride() {
130+
return entryOverride;
131+
}
132+
133+
public void setEntryOverride(String entryOverride) {
134+
this.entryOverride = entryOverride;
135+
}
136+
128137
@Override
129138
public boolean equals(Object o) {
130139
if (this == o) {
@@ -140,12 +149,13 @@ public boolean equals(Object o) {
140149
&& Objects.equals(type, that.type)
141150
&& Objects.equals(summary, that.summary)
142151
&& Objects.equals(highlight, that.highlight)
143-
&& Objects.equals(breaking, that.breaking);
152+
&& Objects.equals(breaking, that.breaking)
153+
&& Objects.equals(entryOverride, that.entryOverride);
144154
}
145155

146156
@Override
147157
public int hashCode() {
148-
return Objects.hash(pr, issues, area, type, summary, highlight, breaking);
158+
return Objects.hash(pr, issues, area, type, summary, highlight, breaking, entryOverride);
149159
}
150160

151161
@Override

build-tools-internal/src/main/resources/templates/breaking-changes.md

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,29 +22,35 @@ for(bundle in changelogBundles) {
2222
if (coming) {
2323
print "\n"
2424
print "```{applies_to}\n"
25-
print "stack: coming ${version}\n"
25+
print "stack: ga ${version}\n"
2626
print "```"
2727
}
2828
%>
2929
## ${unqualifiedVersion} [elasticsearch-${versionForIds}-breaking-changes]
30+
3031
<%
3132
if (!changelogsByTypeByArea['breaking']) {
32-
print "\nNo breaking changes in this version.\n"
33+
print "There are no breaking changes associated with this release.\n"
3334
} else {
3435
for (team in (changelogsByTypeByArea['breaking'] ?: [:]).keySet()) {
35-
print "\n${team}:\n";
36+
print "${team}:\n";
3637

3738
for (change in changelogsByTypeByArea['breaking'][team]) {
38-
print "* ${change.summary} [#${change.pr}](https://github.com/elastic/elasticsearch/pull/${change.pr})"
39-
if (change.issues != null && change.issues.empty == false) {
40-
print change.issues.size() == 1 ? " (issue: " : " (issues: "
41-
print change.issues.collect { "[#${it}](https://github.com/elastic/elasticsearch/issues/${it})" }.join(", ")
42-
print ")"
39+
if (!change.entryOverride) {
40+
print "* ${change.summary} [#${change.pr}](https://github.com/elastic/elasticsearch/pull/${change.pr})"
41+
if (change.issues != null && change.issues.empty == false) {
42+
print change.issues.size() == 1 ? " (issue: " : " (issues: "
43+
print change.issues.collect { "[#${it}](https://github.com/elastic/elasticsearch/issues/${it})" }.join(", ")
44+
print ")"
45+
}
46+
} else {
47+
print change.entryOverride;
4348
}
4449
print "\n"
4550
}
51+
print "\n"
4652
}
4753

48-
print "\n\n"
54+
print "\n"
4955
}
5056
}

build-tools-internal/src/main/resources/templates/deprecations.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ for(bundle in changelogBundles) {
2626
if (coming) {
2727
print "\n"
2828
print "```{applies_to}\n"
29-
print "stack: coming ${version}\n"
29+
print "stack: ga ${version}\n"
3030
print "```"
3131
}
3232
%>
3333
## ${unqualifiedVersion} [elasticsearch-${versionForIds}-deprecations]
3434
<%
3535
if (!changelogsByTypeByArea['deprecation']) {
36-
print "\nNo deprecations in this version.\n"
36+
print "\nThere are no deprecations associated with this release.\n"
3737
} else {
3838
for (team in (changelogsByTypeByArea['deprecation'] ?: [:]).keySet()) {
3939
print "\n${team}:\n";

build-tools-internal/src/main/resources/templates/index.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ for(bundle in changelogBundles) {
3434

3535
if (coming) {
3636
print "```{applies_to}\n"
37-
print "stack: coming ${version}\n"
37+
print "stack: ga ${version}\n"
3838
print "```"
3939
print "\n"
4040
}
@@ -59,18 +59,24 @@ for (changeType in ['features-enhancements', 'fixes', 'regression']) {
5959
}
6060
%>
6161
### ${ TYPE_LABELS.getOrDefault(changeType, 'No mapping for TYPE_LABELS[' + changeType + ']') } [elasticsearch-${versionForIds}-${changeType}]
62+
6263
<% for (team in changelogsByTypeByArea[changeType].keySet()) {
63-
print "\n${team}:\n";
64+
print "${team}:\n";
6465

6566
for (change in changelogsByTypeByArea[changeType][team]) {
66-
print "* ${change.summary} [#${change.pr}](https://github.com/elastic/elasticsearch/pull/${change.pr})"
67-
if (change.issues != null && change.issues.empty == false) {
68-
print change.issues.size() == 1 ? " (issue: " : " (issues: "
69-
print change.issues.collect { "[#${it}](https://github.com/elastic/elasticsearch/issues/${it})" }.join(", ")
70-
print ")"
67+
if (!change.entryOverride) {
68+
print "* ${change.summary} [#${change.pr}](https://github.com/elastic/elasticsearch/pull/${change.pr})"
69+
if (change.issues != null && change.issues.empty == false) {
70+
print change.issues.size() == 1 ? " (issue: " : " (issues: "
71+
print change.issues.collect { "[#${it}](https://github.com/elastic/elasticsearch/issues/${it})" }.join(", ")
72+
print ")"
73+
}
74+
} else {
75+
print change.entryOverride.trim();
7176
}
7277
print "\n"
7378
}
79+
print "\n"
7480
}
7581
}
7682
print "\n"

build-tools-internal/src/test/resources/org/elasticsearch/gradle/internal/release/ReleaseNotesGeneratorTest.breaking-changes.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,54 +13,54 @@ If you are migrating from a version prior to version 9.0, you must first upgrade
1313
% ## Next version [elasticsearch-nextversion-breaking-changes]
1414

1515
```{applies_to}
16-
stack: coming 9.1.0
16+
stack: ga 9.1.0
1717
```
1818
## 9.1.0 [elasticsearch-9.1.0-breaking-changes]
1919

20-
No breaking changes in this version.
20+
There are no breaking changes associated with this release.
2121

2222
```{applies_to}
23-
stack: coming 9.0.10
23+
stack: ga 9.0.10
2424
```
2525
## 9.0.10 [elasticsearch-9.0.10-breaking-changes]
2626

27-
No breaking changes in this version.
27+
There are no breaking changes associated with this release.
2828

2929
## 9.0.9 [elasticsearch-9.0.9-breaking-changes]
3030

31-
No breaking changes in this version.
31+
There are no breaking changes associated with this release.
3232

3333
## 9.0.8 [elasticsearch-9.0.8-breaking-changes]
3434

35-
No breaking changes in this version.
35+
There are no breaking changes associated with this release.
3636

3737
## 9.0.7 [elasticsearch-9.0.7-breaking-changes]
3838

39-
No breaking changes in this version.
39+
There are no breaking changes associated with this release.
4040

4141
## 9.0.6 [elasticsearch-9.0.6-breaking-changes]
4242

43-
No breaking changes in this version.
43+
There are no breaking changes associated with this release.
4444

4545
## 9.0.5 [elasticsearch-9.0.5-breaking-changes]
4646

47-
No breaking changes in this version.
47+
There are no breaking changes associated with this release.
4848

4949
## 9.0.4 [elasticsearch-9.0.4-breaking-changes]
5050

51-
No breaking changes in this version.
51+
There are no breaking changes associated with this release.
5252

5353
## 9.0.3 [elasticsearch-9.0.3-breaking-changes]
5454

55-
No breaking changes in this version.
55+
There are no breaking changes associated with this release.
5656

5757
## 9.0.2 [elasticsearch-9.0.2-breaking-changes]
5858

59-
No breaking changes in this version.
59+
There are no breaking changes associated with this release.
6060

6161
## 9.0.1 [elasticsearch-9.0.1-breaking-changes]
6262

63-
No breaking changes in this version.
63+
There are no breaking changes associated with this release.
6464

6565
## 9.0.0 [elasticsearch-900-breaking-changes]
6666

build-tools-internal/src/test/resources/org/elasticsearch/gradle/internal/release/ReleaseNotesGeneratorTest.deprecations.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,38 +17,38 @@ To give you insight into what deprecated features you’re using, {{es}}:
1717
% ## Next version [elasticsearch-nextversion-deprecations]
1818

1919
```{applies_to}
20-
stack: coming 9.1.0
20+
stack: ga 9.1.0
2121
```
2222
## 9.1.0 [elasticsearch-9.1.0-deprecations]
2323

24-
No deprecations in this version.
24+
There are no deprecations associated with this release.
2525

2626
```{applies_to}
27-
stack: coming 9.0.10
27+
stack: ga 9.0.10
2828
```
2929
## 9.0.10 [elasticsearch-9.0.10-deprecations]
3030

31-
No deprecations in this version.
31+
There are no deprecations associated with this release.
3232

3333
## 9.0.9 [elasticsearch-9.0.9-deprecations]
3434

35-
No deprecations in this version.
35+
There are no deprecations associated with this release.
3636

3737
## 9.0.8 [elasticsearch-9.0.8-deprecations]
3838

39-
No deprecations in this version.
39+
There are no deprecations associated with this release.
4040

4141
## 9.0.7 [elasticsearch-9.0.7-deprecations]
4242

43-
No deprecations in this version.
43+
There are no deprecations associated with this release.
4444

4545
## 9.0.6 [elasticsearch-9.0.6-deprecations]
4646

47-
No deprecations in this version.
47+
There are no deprecations associated with this release.
4848

4949
## 9.0.5 [elasticsearch-9.0.5-deprecations]
5050

51-
No deprecations in this version.
51+
There are no deprecations associated with this release.
5252

5353
## 9.0.4 [elasticsearch-9.0.4-deprecations]
5454

@@ -60,16 +60,16 @@ Search:
6060

6161
## 9.0.3 [elasticsearch-9.0.3-deprecations]
6262

63-
No deprecations in this version.
63+
There are no deprecations associated with this release.
6464

6565
## 9.0.2 [elasticsearch-9.0.2-deprecations]
6666

67-
No deprecations in this version.
67+
There are no deprecations associated with this release.
6868

6969
## 9.0.1 [elasticsearch-9.0.1-deprecations]
7070

71-
No deprecations in this version.
71+
There are no deprecations associated with this release.
7272

7373
## 9.0.0 [elasticsearch-900-deprecations]
7474

75-
No deprecations in this version.
75+
There are no deprecations associated with this release.

build-tools-internal/src/test/resources/org/elasticsearch/gradle/internal/release/ReleaseNotesGeneratorTest.index.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ To check for security updates, go to [Security announcements for the Elastic sta
2222

2323
## 9.1.0 [elasticsearch-9.1.0-release-notes]
2424
```{applies_to}
25-
stack: coming 9.1.0
25+
stack: ga 9.1.0
2626
```
2727

2828
### Highlights [elasticsearch-9.1.0-highlights]
@@ -47,9 +47,10 @@ Search:
4747
* [#52](https://github.com/elastic/elasticsearch/pull/52)
4848

4949

50+
5051
## 9.0.10 [elasticsearch-9.0.10-release-notes]
5152
```{applies_to}
52-
stack: coming 9.0.10
53+
stack: ga 9.0.10
5354
```
5455

5556
### Features and enhancements [elasticsearch-9.0.10-features-enhancements]
@@ -59,6 +60,7 @@ Search:
5960
* Test changelog entry 10_1 [#10002](https://github.com/elastic/elasticsearch/pull/10002) (issues: [#10003](https://github.com/elastic/elasticsearch/issues/10003), [#10004](https://github.com/elastic/elasticsearch/issues/10004))
6061

6162

63+
6264
## 9.0.9 [elasticsearch-9.0.9-release-notes]
6365

6466
### Regressions [elasticsearch-9.0.9-regression]
@@ -68,6 +70,7 @@ Mappings:
6870
* Test changelog entry 9_1 [#9002](https://github.com/elastic/elasticsearch/pull/9002) (issues: [#9003](https://github.com/elastic/elasticsearch/issues/9003), [#9004](https://github.com/elastic/elasticsearch/issues/9004))
6971

7072

73+
7174
## 9.0.8 [elasticsearch-9.0.8-release-notes]
7275

7376
### Features and enhancements [elasticsearch-9.0.8-features-enhancements]
@@ -77,6 +80,7 @@ Indices:
7780
* Test changelog entry 8_1 [#8002](https://github.com/elastic/elasticsearch/pull/8002) (issues: [#8003](https://github.com/elastic/elasticsearch/issues/8003), [#8004](https://github.com/elastic/elasticsearch/issues/8004))
7881

7982

83+
8084
## 9.0.7 [elasticsearch-9.0.7-release-notes]
8185

8286
### Features and enhancements [elasticsearch-9.0.7-features-enhancements]
@@ -86,6 +90,7 @@ Cluster:
8690
* Test changelog entry 7_1 [#7002](https://github.com/elastic/elasticsearch/pull/7002) (issues: [#7003](https://github.com/elastic/elasticsearch/issues/7003), [#7004](https://github.com/elastic/elasticsearch/issues/7004))
8791

8892

93+
8994
## 9.0.6 [elasticsearch-9.0.6-release-notes]
9095

9196
### Features and enhancements [elasticsearch-9.0.6-features-enhancements]
@@ -95,6 +100,7 @@ Aggregation:
95100
* Test changelog entry 6_1 [#6002](https://github.com/elastic/elasticsearch/pull/6002) (issues: [#6003](https://github.com/elastic/elasticsearch/issues/6003), [#6004](https://github.com/elastic/elasticsearch/issues/6004))
96101

97102

103+
98104
## 9.0.5 [elasticsearch-9.0.5-release-notes]
99105

100106
### Features and enhancements [elasticsearch-9.0.5-features-enhancements]
@@ -104,6 +110,7 @@ Security:
104110
* Test changelog entry 5_1 [#5002](https://github.com/elastic/elasticsearch/pull/5002) (issues: [#5003](https://github.com/elastic/elasticsearch/issues/5003), [#5004](https://github.com/elastic/elasticsearch/issues/5004))
105111

106112

113+
107114
## 9.0.4 [elasticsearch-9.0.4-release-notes]
108115

109116

@@ -116,6 +123,7 @@ Mappings:
116123
* Test changelog entry 3_1 [#3002](https://github.com/elastic/elasticsearch/pull/3002) (issues: [#3003](https://github.com/elastic/elasticsearch/issues/3003), [#3004](https://github.com/elastic/elasticsearch/issues/3004))
117124

118125

126+
119127
## 9.0.2 [elasticsearch-9.0.2-release-notes]
120128

121129
### Fixes [elasticsearch-9.0.2-fixes]
@@ -125,6 +133,7 @@ Indices:
125133
* Test changelog entry 2_1 [#2002](https://github.com/elastic/elasticsearch/pull/2002) (issues: [#2003](https://github.com/elastic/elasticsearch/issues/2003), [#2004](https://github.com/elastic/elasticsearch/issues/2004))
126134

127135

136+
128137
## 9.0.1 [elasticsearch-9.0.1-release-notes]
129138

130139

0 commit comments

Comments
 (0)