Skip to content

Commit

Permalink
🔨 Add tests (💚) and chores (🔨) categories to release notes
Browse files Browse the repository at this point in the history
  • Loading branch information
Cecile Robert-Michon committed Jun 24, 2021
1 parent 686aef6 commit 3843a24
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!-- please add a icon to the title of this PR (see https://sigs.k8s.io/cluster-api/VERSIONING.md), and delete this line and similar ones -->
<!-- the icon will be either ⚠️ (:warning:, major or breaking changes), ✨ (:sparkles:, feature additions), 🐛 (:bug:, patch and bugfixes), 📖 (:book:, documentation or proposals), or 🌱 (:seedling:, minor or other) -->
<!-- the icon will be either ⚠️ (:warning:, major or breaking changes), ✨ (:sparkles:, feature additions), 🐛 (:bug:, patch and bugfixes), 💚 (:green_heart:, adding, fixing, or improving tests), 📖 (:book:, documentation or proposals), 🔨 (:hammer:, chore or maintenance tasks), or 🌱 (:seedling:, minor or other) -->

**What this PR does / why we need it**:

Expand Down
12 changes: 7 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,13 @@ come up, including gaps in documentation!
1. Fork the desired repo, develop and test your code changes.
1. Submit a pull request.
1. All code PR must be labeled with one of
- ⚠️ (:warning:, major or breaking changes)
- ✨ (:sparkles:, feature additions)
- 🐛 (:bug:, patch and bugfixes)
- 📖 (:book:, documentation or proposals)
- 🌱 (:seedling:, minor or other)
- ⚠️ (`:warning:`, major or breaking changes)
- ✨ (`:sparkles:`, feature additions)
- 🐛 (`:bug:`, patch and bugfixes)
- 📖 (`:book:`, documentation or proposals)
- 🌱 (`:seedling:`, minor or other)
- 💚 (`:green_heart:`, tests)
- 🔨 (`:hammer:` chores, infra, maintenance - these will _not_ appear in release notes)

All changes must be code reviewed. Coding conventions and standards are explained in the official [developer
docs](https://git.k8s.io/community/contributors/devel). Expect reviewers to request that you
Expand Down
4 changes: 3 additions & 1 deletion VERSIONING.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ a:
- Non-breaking feature: :sparkles: (`:sparkles:`)
- Patch fix: :bug: (`:bug:`)
- Docs: :book: (`:book:`)
- Infra/Tests/Other: :seedling: (`:seedling:`)
- Tests: :green_heart: (`:green_heart:`)
- Minor/Other: :seedling: (`:seedling:`)
- Chores/Infra/Maintenance: :hammer: (`:hammer:`) - these will _not_ appear in release notes

You can also use the equivalent emoji directly, since GitHub doesn't
render the `:xyz:` aliases in PR titles.
Expand Down
10 changes: 10 additions & 0 deletions hack/tools/release/notes.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ const (
documentation = ":book: Documentation"
proposals = ":memo: Proposals"
warning = ":warning: Breaking Changes"
tests = ":green_heart: Testing"
other = ":seedling: Others"
unknown = ":question: Sort these by hand"
)
Expand All @@ -50,6 +51,7 @@ var (
warning,
features,
bugs,
tests,
other,
documentation,
unknown,
Expand Down Expand Up @@ -91,6 +93,7 @@ func run() int {
merges := map[string][]string{
features: {},
bugs: {},
tests: {},
documentation: {},
warning: {},
other: {},
Expand Down Expand Up @@ -124,6 +127,9 @@ func run() int {
body := strings.TrimSpace(c.body)
var key, prNumber, fork string
switch {
case strings.HasPrefix(body, ":hammer:"), strings.HasPrefix(body, "🔨"):
// do nothing for chores, we exclude them from release notes
continue
case strings.HasPrefix(body, ":sparkles:"), strings.HasPrefix(body, "✨"):
key = features
body = strings.TrimPrefix(body, ":sparkles:")
Expand All @@ -147,6 +153,10 @@ func run() int {
key = warning
body = strings.TrimPrefix(body, ":warning:")
body = strings.TrimPrefix(body, "⚠️")
case strings.HasPrefix(body, ":green_heart:"), strings.HasPrefix(body, "💚"):
key = tests
body = strings.TrimPrefix(body, ":green_heart:")
body = strings.TrimPrefix(body, "💚")
default:
key = unknown
}
Expand Down

0 comments on commit 3843a24

Please sign in to comment.