Skip to content

Commit 930a41a

Browse files
Merge pull request #313 from metal3-cherrypick-bot/cherry-pick-310-to-release-1.3
📖 improve release notes tool
2 parents 011e855 + a6da90c commit 930a41a

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)