Skip to content

Commit 686aef6

Browse files
authored
Merge pull request #4850 from vincepri/improve-release-notes
🌱 Release notes gen categorize proposals and summarize doc changes
2 parents c920241 + ef5b247 commit 686aef6

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

hack/tools/release/notes.go

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,20 @@ const (
3838
features = ":sparkles: New Features"
3939
bugs = ":bug: Bug Fixes"
4040
documentation = ":book: Documentation"
41+
proposals = ":memo: Proposals"
4142
warning = ":warning: Breaking Changes"
4243
other = ":seedling: Others"
4344
unknown = ":question: Sort these by hand"
4445
)
4546

4647
var (
4748
outputOrder = []string{
49+
proposals,
4850
warning,
4951
features,
5052
bugs,
51-
documentation,
5253
other,
54+
documentation,
5355
unknown,
5456
}
5557

@@ -134,6 +136,9 @@ func run() int {
134136
key = documentation
135137
body = strings.TrimPrefix(body, ":book:")
136138
body = strings.TrimPrefix(body, "📖")
139+
if strings.Contains(body, "CAEP") || strings.Contains(body, "proposal") {
140+
key = proposals
141+
}
137142
case strings.HasPrefix(body, ":seedling:"), strings.HasPrefix(body, "🌱"):
138143
key = other
139144
body = strings.TrimPrefix(body, ":seedling:")
@@ -152,6 +157,10 @@ func run() int {
152157
}
153158
body = fmt.Sprintf("- %s", body)
154159
fmt.Sscanf(c.merge, "Merge pull request %s from %s", &prNumber, &fork)
160+
if key == documentation {
161+
merges[key] = append(merges[key], prNumber)
162+
continue
163+
}
155164
merges[key] = append(merges[key], formatMerge(body, prNumber))
156165
}
157166

@@ -160,13 +169,25 @@ func run() int {
160169

161170
for _, key := range outputOrder {
162171
mergeslice := merges[key]
163-
if len(mergeslice) > 0 {
172+
if len(mergeslice) == 0 {
173+
continue
174+
}
175+
176+
switch key {
177+
case documentation:
178+
fmt.Printf(
179+
":book: Additionally, there have been %d contributions to our documentation and book. (%s) \n\n",
180+
len(mergeslice),
181+
strings.Join(mergeslice, ", "),
182+
)
183+
default:
164184
fmt.Println("## " + key)
165185
for _, merge := range mergeslice {
166186
fmt.Println(merge)
167187
}
168188
fmt.Println()
169189
}
190+
170191
}
171192

172193
fmt.Println("")

0 commit comments

Comments
 (0)