Skip to content

Commit a6da90c

Browse files
tuminoidmetal3-cherrypick-bot
authored andcommitted
improve release notes tool
Improve release notes generation by adding empty section for superseded or reverted PRs, aligning empty line addition between image tag and thanking our contributors to same as BMO and CAPM3.
1 parent 011e855 commit a6da90c

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

hack/tools/release/notes.go

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
//go:build tools
12
// +build tools
23

34
/*
4-
Copyright 2019 The Kubernetes Authors.
5+
Copyright 2021 The Kubernetes Authors.
56
67
Licensed under the Apache License, Version 2.0 (the "License");
78
you may not use this file except in compliance with the License.
@@ -41,6 +42,7 @@ const (
4142
warning = ":warning: Breaking Changes"
4243
other = ":seedling: Others"
4344
unknown = ":question: Sort these by hand"
45+
superseded = ":recycle: Superseded or Reverted"
4446
)
4547

4648
var (
@@ -51,6 +53,7 @@ var (
5153
documentation,
5254
other,
5355
unknown,
56+
superseded,
5457
}
5558

5659
fromTag = flag.String("from", "", "The tag or commit to start from.")
@@ -92,8 +95,8 @@ func firstCommit() string {
9295
}
9396

9497
func run() int {
95-
latestTag := latestTag()
9698
lastTag := lastTag()
99+
latestTag := latestTag()
97100
cmd := exec.Command("git", "rev-list", lastTag+"..HEAD", "--merges", "--pretty=format:%B")
98101

99102
merges := map[string][]string{
@@ -103,6 +106,7 @@ func run() int {
103106
warning: {},
104107
other: {},
105108
unknown: {},
109+
superseded: {},
106110
}
107111
out, err := cmd.CombinedOutput()
108112
if err != nil {
@@ -170,6 +174,9 @@ func run() int {
170174
merges[key] = append(merges[key], formatMerge(body, prNumber))
171175
}
172176

177+
// Add empty superseded section
178+
merges[superseded] = append(merges[superseded], "- `<insert superseded bumps and reverts here>`")
179+
173180
// TODO Turn this into a link (requires knowing the project name + organization)
174181
fmt.Printf("Changes since %v\n---\n", lastTag)
175182

@@ -184,9 +191,8 @@ func run() int {
184191
}
185192
}
186193

187-
fmt.Printf("The image for this release is: %v\n", latestTag)
188-
fmt.Println("")
189-
fmt.Println("_Thanks to all our contributors!_ 😊")
194+
fmt.Printf("The container image for this release is: %v\n", latestTag)
195+
fmt.Println("\nThanks to all our contributors! 😊")
190196

191197
return 0
192198
}

0 commit comments

Comments
 (0)