Skip to content

Commit 4294805

Browse files
committed
Add 🚀 as a valid prefix for release PRs
Signed-off-by: Michael Shen <[email protected]>
1 parent 482e922 commit 4294805

File tree

4 files changed

+13
-2
lines changed

4 files changed

+13
-2
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ specifying the kind of change:
8484
- Non-breaking feature: :sparkles: (`:sparkles:`)
8585
- Patch fix: :bug: (`:bug:`)
8686
- Docs: :book: (`:book:`)
87+
- Release: :rocket: (`:rocket:`)
8788
- Infra/Tests/Other: :seedling: (`:seedling:`)
8889

8990
See [the document](/VERSIONING.md) for more details.

notes/common/common_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ var _ = Describe("PR title parsing", func() {
5050
Entry("should match infra from :seedling:", ":seedling: Update Go mod version to 1.15", InfraPR, "Update Go mod version to 1.15"),
5151
Entry("should match infra from 🏃(deprecated)", "🏃 hack/setup-envtest.sh: follow-up from #1092", InfraPR, "hack/setup-envtest.sh: follow-up from #1092"),
5252
Entry("should match infra from :running: (deprecated)", ":running: Proposal to extract cluster-specifics out of the Manager", InfraPR, "Proposal to extract cluster-specifics out of the Manager"),
53+
Entry("should match release from :rocket:", ":rocket: release v0.0.1", ReleasePR, "release v0.0.1"),
54+
Entry("should match release from 🚀", "🚀 release v0.0.1", ReleasePR, "release v0.0.1"),
5355
Entry("should put anything else as uncategorized", "blah blah", UncategorizedPR, "blah blah"),
5456
)
5557

notes/common/prefix.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import (
2222
)
2323

2424
type PRType int
25+
2526
func (t PRType) Emoji() string {
2627
switch t {
2728
case UncategorizedPR:
@@ -55,7 +56,7 @@ func (t PRType) String() string {
5556
case InfraPR:
5657
return "infra"
5758
default:
58-
panic(fmt.Sprintf("unrecognized PR type %v", t))
59+
panic(fmt.Sprintf("unrecognized PR type %d", int(t)))
5960
}
6061
}
6162

@@ -66,6 +67,7 @@ const (
6667
BugfixPR
6768
DocsPR
6869
InfraPR
70+
ReleasePR
6971
)
7072

7173
// NB(directxman12): These are constants because some folks' dev environments like
@@ -80,6 +82,7 @@ const (
8082
emojiInfra = string('🌱')
8183
emojiBreaking = string('⚠')
8284
emojiInfraLegacy = string('🏃')
85+
emojiRelease = string('🚀')
8386
)
8487

8588
func PRTypeFromTitle(title string) (PRType, string) {
@@ -111,6 +114,10 @@ func PRTypeFromTitle(title string) (PRType, string) {
111114
title = strings.TrimPrefix(title, ":warning:")
112115
title = strings.TrimPrefix(title, emojiBreaking)
113116
prType = BreakingPR
117+
case strings.HasPrefix(title, ":rocket:"), strings.HasPrefix(title, emojiRelease):
118+
title = strings.TrimPrefix(title, ":rocket:")
119+
title = strings.TrimPrefix(title, emojiRelease)
120+
prType = ReleasePR
114121
case strings.HasPrefix(title, ":running:"), strings.HasPrefix(title, emojiInfraLegacy):
115122
// This has been deprecated in favor of :seedling:
116123
title = strings.TrimPrefix(title, ":running:")

verify/type.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,11 @@ You need to have one of these as the prefix of your PR title:
4848
- Non-breaking feature: ✨ (%#q)
4949
- Patch fix: 🐛 (%#q)
5050
- Docs: 📖 (%#q)
51+
- Release: 🚀 (%#q)
5152
- Infra/Tests/Other: 🌱 (%#q)
5253
5354
More details can be found at [sigs.k8s.io/kubebuilder-release-tools/VERSIONING.md](https://sigs.k8s.io/kubebuilder-release-tools/VERSIONING.md).`,
54-
e.title, ":warning:", ":sparkles:", ":bug:", ":book:", ":seedling:")
55+
e.title, ":warning:", ":sparkles:", ":bug:", ":book:", ":rocket:", ":seedling:")
5556
}
5657

5758
// verifyPRType checks that the PR title contains a prefix that defines its type

0 commit comments

Comments
 (0)