Skip to content

Commit 54873b4

Browse files
committed
Fix up release highlights, add tests
1 parent e579524 commit 54873b4

File tree

7 files changed

+303
-48
lines changed

7 files changed

+303
-48
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,9 @@ To check for security updates, go to [Security announcements for the Elastic sta
2626

2727
## ${unqualifiedVersion} [elasticsearch-${versionWithoutSeparator}-release-notes]
2828
**Release date:** April 01, 2025
29-
3029
<%
3130
if (!notableHighlights.isEmpty() || !nonNotableHighlights.isEmpty()) {
32-
print "### Highlights\n"
31+
print "\n### Highlights [elasticsearch-${versionWithoutSeparator}-highlights]\n"
3332
}
3433

3534
for (highlights in [notableHighlights, nonNotableHighlights]) {

build-tools-internal/src/test/java/org/elasticsearch/gradle/internal/release/ReleaseNotesGeneratorTest.java

Lines changed: 56 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import java.util.List;
2020
import java.util.Objects;
2121
import java.util.Set;
22+
import java.util.stream.Collectors;
2223

2324
import static org.hamcrest.Matchers.equalTo;
2425
import static org.junit.Assert.assertThat;
@@ -44,6 +45,21 @@ public void generateFile_index_rendersCorrectMarkup() throws Exception {
4445
testTemplate("index.md");
4546
}
4647

48+
@Test
49+
public void generateFile_index_noHighlights_rendersCorrectMarkup() throws Exception {
50+
Set<ChangelogEntry> entries = getEntries();
51+
entries = entries.stream().filter(e -> e.getHighlight() == null).collect(Collectors.toSet());
52+
53+
testTemplate("index.md", "index.no-highlights.md", entries);
54+
}
55+
56+
@Test
57+
public void generateFile_index_noChanges_rendersCorrectMarkup() throws Exception {
58+
Set<ChangelogEntry> entries = new HashSet<>();
59+
60+
testTemplate("index.md", "index.no-changes.md", entries);
61+
}
62+
4763
@Test
4864
public void generateFile_breakingChanges_rendersCorrectMarkup() throws Exception {
4965
testTemplate("breaking-changes.md");
@@ -55,13 +71,21 @@ public void generateFile_deprecations_rendersCorrectMarkup() throws Exception {
5571
}
5672

5773
public void testTemplate(String templateFilename) throws Exception {
74+
testTemplate(templateFilename, templateFilename, null);
75+
}
76+
77+
public void testTemplate(String templateFilename, String outputFilename) throws Exception {
78+
testTemplate(templateFilename, outputFilename, null);
79+
}
80+
81+
public void testTemplate(String templateFilename, String outputFilename, Set<ChangelogEntry> entries) throws Exception {
5882
// given:
5983
final String template = getResource("/templates/" + templateFilename);
60-
final String expectedOutput = getResource(
61-
"/org/elasticsearch/gradle/internal/release/ReleaseNotesGeneratorTest." + templateFilename
62-
);
84+
final String expectedOutput = getResource("/org/elasticsearch/gradle/internal/release/ReleaseNotesGeneratorTest." + outputFilename);
6385

64-
final Set<ChangelogEntry> entries = getEntries();
86+
if (entries == null) {
87+
entries = getEntries();
88+
}
6589

6690
// when:
6791
final String actualOutput = ReleaseNotesGenerator.generateFile(template, QualifiedVersion.of("8.2.0-SNAPSHOT"), entries);
@@ -76,6 +100,10 @@ private Set<ChangelogEntry> getEntries() {
76100
entries.addAll(buildEntries(i, 2));
77101
}
78102

103+
entries.add(makeHighlightsEntry(5001, false));
104+
entries.add(makeHighlightsEntry(5000, true));
105+
entries.add(makeHighlightsEntry(5002, true));
106+
79107
return entries;
80108
}
81109

@@ -110,6 +138,30 @@ private List<ChangelogEntry> buildEntries(int seed, int count) {
110138
return entries;
111139
}
112140

141+
private List<ChangelogEntry> getHighlightsEntries() {
142+
ChangelogEntry entry123 = makeHighlightsEntry(123, true);
143+
ChangelogEntry entry456 = makeHighlightsEntry(456, true);
144+
ChangelogEntry entry789 = makeHighlightsEntry(789, false);
145+
// Return unordered list, to test correct re-ordering
146+
return List.of(entry456, entry123, entry789);
147+
}
148+
149+
private ChangelogEntry makeHighlightsEntry(int pr, boolean notable) {
150+
ChangelogEntry entry = new ChangelogEntry();
151+
entry.setPr(pr);
152+
ChangelogEntry.Highlight highlight = new ChangelogEntry.Highlight();
153+
entry.setHighlight(highlight);
154+
155+
highlight.setNotable(notable);
156+
highlight.setTitle((notable ? "[Notable] " : "") + "Release highlight number " + pr);
157+
highlight.setBody("Release highlight body number " + pr);
158+
entry.setType("feature");
159+
entry.setArea("Search");
160+
entry.setSummary("");
161+
162+
return entry;
163+
}
164+
113165
private String getResource(String name) throws Exception {
114166
return Files.readString(Paths.get(Objects.requireNonNull(this.getClass().getResource(name)).toURI()), StandardCharsets.UTF_8);
115167
}

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

Lines changed: 39 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -27,42 +27,65 @@ To check for security updates, go to [Security announcements for the Elastic sta
2727
## 8.2.0 [elasticsearch-820-release-notes]
2828
**Release date:** April 01, 2025
2929

30+
### Highlights [elasticsearch-820-highlights]
31+
32+
::::{dropdown} [Notable] Release highlight number 5000
33+
Release highlight body number 5000
34+
35+
For more information, check [PR #5000](https://github.com/elastic/elasticsearch/pull/5000).
36+
::::
37+
38+
::::{dropdown} [Notable] Release highlight number 5002
39+
Release highlight body number 5002
40+
41+
For more information, check [PR #5002](https://github.com/elastic/elasticsearch/pull/5002).
42+
::::
43+
44+
::::{dropdown} Release highlight number 5001
45+
Release highlight body number 5001
46+
47+
For more information, check [PR #5001](https://github.com/elastic/elasticsearch/pull/5001).
48+
::::
49+
3050
### Features and enhancements [elasticsearch-820-features-enhancements]
3151

3252
Aggregation:
33-
* Test changelog entry 6_0 [#6000](https://github.com/elastic/elasticsearch/pull/6000) (issue: {es-issue}6001[#6001])
34-
* Test changelog entry 6_1 [#6002](https://github.com/elastic/elasticsearch/pull/6002) (issues: {es-issue}6003[#6003], {es-issue}6004[#6004])
53+
* Test changelog entry 6_0 [#6000](https://github.com/elastic/elasticsearch/pull/6000) (issue: [#6000](https://github.com/elastic/elasticsearch/pull/6000))
54+
* Test changelog entry 6_1 [#6002](https://github.com/elastic/elasticsearch/pull/6002) (issues: [#6002](https://github.com/elastic/elasticsearch/pull/6002), [#6002](https://github.com/elastic/elasticsearch/pull/6002))
3555

3656
Cluster:
37-
* Test changelog entry 7_0 [#7000](https://github.com/elastic/elasticsearch/pull/7000) (issue: {es-issue}7001[#7001])
38-
* Test changelog entry 7_1 [#7002](https://github.com/elastic/elasticsearch/pull/7002) (issues: {es-issue}7003[#7003], {es-issue}7004[#7004])
57+
* Test changelog entry 7_0 [#7000](https://github.com/elastic/elasticsearch/pull/7000) (issue: [#7000](https://github.com/elastic/elasticsearch/pull/7000))
58+
* Test changelog entry 7_1 [#7002](https://github.com/elastic/elasticsearch/pull/7002) (issues: [#7002](https://github.com/elastic/elasticsearch/pull/7002), [#7002](https://github.com/elastic/elasticsearch/pull/7002))
3959

4060
Indices:
41-
* Test changelog entry 8_0 [#8000](https://github.com/elastic/elasticsearch/pull/8000) (issue: {es-issue}8001[#8001])
42-
* Test changelog entry 8_1 [#8002](https://github.com/elastic/elasticsearch/pull/8002) (issues: {es-issue}8003[#8003], {es-issue}8004[#8004])
61+
* Test changelog entry 8_0 [#8000](https://github.com/elastic/elasticsearch/pull/8000) (issue: [#8000](https://github.com/elastic/elasticsearch/pull/8000))
62+
* Test changelog entry 8_1 [#8002](https://github.com/elastic/elasticsearch/pull/8002) (issues: [#8002](https://github.com/elastic/elasticsearch/pull/8002), [#8002](https://github.com/elastic/elasticsearch/pull/8002))
4363

4464
Search:
45-
* Test changelog entry 10_0 [#10000](https://github.com/elastic/elasticsearch/pull/10000) (issue: {es-issue}10001[#10001])
46-
* Test changelog entry 10_1 [#10002](https://github.com/elastic/elasticsearch/pull/10002) (issues: {es-issue}10003[#10003], {es-issue}10004[#10004])
65+
* [#5002](https://github.com/elastic/elasticsearch/pull/5002)
66+
* [#5000](https://github.com/elastic/elasticsearch/pull/5000)
67+
* [#5001](https://github.com/elastic/elasticsearch/pull/5001)
68+
* Test changelog entry 10_0 [#10000](https://github.com/elastic/elasticsearch/pull/10000) (issue: [#10000](https://github.com/elastic/elasticsearch/pull/10000))
69+
* Test changelog entry 10_1 [#10002](https://github.com/elastic/elasticsearch/pull/10002) (issues: [#10002](https://github.com/elastic/elasticsearch/pull/10002), [#10002](https://github.com/elastic/elasticsearch/pull/10002))
4770

4871
Security:
49-
* Test changelog entry 5_0 [#5000](https://github.com/elastic/elasticsearch/pull/5000) (issue: {es-issue}5001[#5001])
50-
* Test changelog entry 5_1 [#5002](https://github.com/elastic/elasticsearch/pull/5002) (issues: {es-issue}5003[#5003], {es-issue}5004[#5004])
72+
* Test changelog entry 5_0 [#5000](https://github.com/elastic/elasticsearch/pull/5000) (issue: [#5000](https://github.com/elastic/elasticsearch/pull/5000))
73+
* Test changelog entry 5_1 [#5002](https://github.com/elastic/elasticsearch/pull/5002) (issues: [#5002](https://github.com/elastic/elasticsearch/pull/5002), [#5002](https://github.com/elastic/elasticsearch/pull/5002))
5174

5275
### Fixes [elasticsearch-820-fixes]
5376

5477
Indices:
55-
* Test changelog entry 2_0 [#2000](https://github.com/elastic/elasticsearch/pull/2000) (issue: {es-issue}2001[#2001])
56-
* Test changelog entry 2_1 [#2002](https://github.com/elastic/elasticsearch/pull/2002) (issues: {es-issue}2003[#2003], {es-issue}2004[#2004])
78+
* Test changelog entry 2_0 [#2000](https://github.com/elastic/elasticsearch/pull/2000) (issue: [#2000](https://github.com/elastic/elasticsearch/pull/2000))
79+
* Test changelog entry 2_1 [#2002](https://github.com/elastic/elasticsearch/pull/2002) (issues: [#2002](https://github.com/elastic/elasticsearch/pull/2002), [#2002](https://github.com/elastic/elasticsearch/pull/2002))
5780

5881
Mappings:
59-
* Test changelog entry 3_0 [#3000](https://github.com/elastic/elasticsearch/pull/3000) (issue: {es-issue}3001[#3001])
60-
* Test changelog entry 3_1 [#3002](https://github.com/elastic/elasticsearch/pull/3002) (issues: {es-issue}3003[#3003], {es-issue}3004[#3004])
82+
* Test changelog entry 3_0 [#3000](https://github.com/elastic/elasticsearch/pull/3000) (issue: [#3000](https://github.com/elastic/elasticsearch/pull/3000))
83+
* Test changelog entry 3_1 [#3002](https://github.com/elastic/elasticsearch/pull/3002) (issues: [#3002](https://github.com/elastic/elasticsearch/pull/3002), [#3002](https://github.com/elastic/elasticsearch/pull/3002))
6184

6285
### Regressions [elasticsearch-820-regression]
6386

6487
Mappings:
65-
* Test changelog entry 9_0 [#9000](https://github.com/elastic/elasticsearch/pull/9000) (issue: {es-issue}9001[#9001])
66-
* Test changelog entry 9_1 [#9002](https://github.com/elastic/elasticsearch/pull/9002) (issues: {es-issue}9003[#9003], {es-issue}9004[#9004])
88+
* Test changelog entry 9_0 [#9000](https://github.com/elastic/elasticsearch/pull/9000) (issue: [#9000](https://github.com/elastic/elasticsearch/pull/9000))
89+
* Test changelog entry 9_1 [#9002](https://github.com/elastic/elasticsearch/pull/9002) (issues: [#9002](https://github.com/elastic/elasticsearch/pull/9002), [#9002](https://github.com/elastic/elasticsearch/pull/9002))
6790

6891

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/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-8.2.0.html
7+
- https://www.elastic.co/guide/en/elasticsearch/reference/master/migrating-8.2.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 [elasticsearch-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+
## 8.2.0 [elasticsearch-820-release-notes]
28+
**Release date:** April 01, 2025
29+
30+
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
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-8.2.0.html
7+
- https://www.elastic.co/guide/en/elasticsearch/reference/master/migrating-8.2.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 [elasticsearch-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+
## 8.2.0 [elasticsearch-820-release-notes]
28+
**Release date:** April 01, 2025
29+
30+
### Features and enhancements [elasticsearch-820-features-enhancements]
31+
32+
Aggregation:
33+
* Test changelog entry 6_0 [#6000](https://github.com/elastic/elasticsearch/pull/6000) (issue: [#6000](https://github.com/elastic/elasticsearch/pull/6000))
34+
* Test changelog entry 6_1 [#6002](https://github.com/elastic/elasticsearch/pull/6002) (issues: [#6002](https://github.com/elastic/elasticsearch/pull/6002), [#6002](https://github.com/elastic/elasticsearch/pull/6002))
35+
36+
Cluster:
37+
* Test changelog entry 7_0 [#7000](https://github.com/elastic/elasticsearch/pull/7000) (issue: [#7000](https://github.com/elastic/elasticsearch/pull/7000))
38+
* Test changelog entry 7_1 [#7002](https://github.com/elastic/elasticsearch/pull/7002) (issues: [#7002](https://github.com/elastic/elasticsearch/pull/7002), [#7002](https://github.com/elastic/elasticsearch/pull/7002))
39+
40+
Indices:
41+
* Test changelog entry 8_0 [#8000](https://github.com/elastic/elasticsearch/pull/8000) (issue: [#8000](https://github.com/elastic/elasticsearch/pull/8000))
42+
* Test changelog entry 8_1 [#8002](https://github.com/elastic/elasticsearch/pull/8002) (issues: [#8002](https://github.com/elastic/elasticsearch/pull/8002), [#8002](https://github.com/elastic/elasticsearch/pull/8002))
43+
44+
Search:
45+
* Test changelog entry 10_0 [#10000](https://github.com/elastic/elasticsearch/pull/10000) (issue: [#10000](https://github.com/elastic/elasticsearch/pull/10000))
46+
* Test changelog entry 10_1 [#10002](https://github.com/elastic/elasticsearch/pull/10002) (issues: [#10002](https://github.com/elastic/elasticsearch/pull/10002), [#10002](https://github.com/elastic/elasticsearch/pull/10002))
47+
48+
Security:
49+
* Test changelog entry 5_0 [#5000](https://github.com/elastic/elasticsearch/pull/5000) (issue: [#5000](https://github.com/elastic/elasticsearch/pull/5000))
50+
* Test changelog entry 5_1 [#5002](https://github.com/elastic/elasticsearch/pull/5002) (issues: [#5002](https://github.com/elastic/elasticsearch/pull/5002), [#5002](https://github.com/elastic/elasticsearch/pull/5002))
51+
52+
### Fixes [elasticsearch-820-fixes]
53+
54+
Indices:
55+
* Test changelog entry 2_0 [#2000](https://github.com/elastic/elasticsearch/pull/2000) (issue: [#2000](https://github.com/elastic/elasticsearch/pull/2000))
56+
* Test changelog entry 2_1 [#2002](https://github.com/elastic/elasticsearch/pull/2002) (issues: [#2002](https://github.com/elastic/elasticsearch/pull/2002), [#2002](https://github.com/elastic/elasticsearch/pull/2002))
57+
58+
Mappings:
59+
* Test changelog entry 3_0 [#3000](https://github.com/elastic/elasticsearch/pull/3000) (issue: [#3000](https://github.com/elastic/elasticsearch/pull/3000))
60+
* Test changelog entry 3_1 [#3002](https://github.com/elastic/elasticsearch/pull/3002) (issues: [#3002](https://github.com/elastic/elasticsearch/pull/3002), [#3002](https://github.com/elastic/elasticsearch/pull/3002))
61+
62+
### Regressions [elasticsearch-820-regression]
63+
64+
Mappings:
65+
* Test changelog entry 9_0 [#9000](https://github.com/elastic/elasticsearch/pull/9000) (issue: [#9000](https://github.com/elastic/elasticsearch/pull/9000))
66+
* Test changelog entry 9_1 [#9002](https://github.com/elastic/elasticsearch/pull/9002) (issues: [#9002](https://github.com/elastic/elasticsearch/pull/9002), [#9002](https://github.com/elastic/elasticsearch/pull/9002))
67+
68+

docs/release-notes/breaking-changes.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ To learn how to upgrade, check out <upgrade docs>.
1515
## 9.1.0 [elasticsearch-910-breaking-changes]
1616
**Release date:** April 01, 2025
1717

18+
Discovery-Plugins:
19+
* Upgrade `discovery-ec2` to AWS SDK v2 [#122062](https://github.com/elastic/elasticsearch/pull/122062)
20+
1821
TLS:
1922
* Drop `TLS_RSA` cipher support for JDK 24 [#123600](https://github.com/elastic/elasticsearch/pull/123600)
2023

0 commit comments

Comments
 (0)