Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Support adding a WIP prefix to the title as understood by prow #26

Merged
merged 1 commit into from Dec 2, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions notes/verify/title.go
Expand Up @@ -18,10 +18,14 @@ package verify

import (
"fmt"
"regexp"

"sigs.k8s.io/kubebuilder-release-tools/notes/common"
)

// Extracted from kubernetes/test-infra/prow/plugins/wip/wip-label.go
var wipRegex = regexp.MustCompile(`(?i)^\W?WIP\W`)

type prTitleError struct {
title string
}
Expand All @@ -47,6 +51,9 @@ More details can be found at [sigs.k8s.io/controller-runtime/VERSIONING.md](http
// returning a message describing what was found on success, and a special
// error (with more detailed help via .Help) on failure.
func VerifyPRTitle(title string) (string, error) {
// Remove the WIP prefix if found
title = wipRegex.ReplaceAllString(title, "")

prType, finalTitle := common.PRTypeFromTitle(title)
if prType == common.UncategorizedPR {
return "", &prTitleError{title: title}
Expand Down