From 4aa0c6ab0cce5327a4ba26665dc3863c25c04d45 Mon Sep 17 00:00:00 2001 From: Adrian Orive Date: Mon, 23 Nov 2020 11:38:11 +0100 Subject: [PATCH] Support adding a WIP prefix to the title as understood by prow Signed-off-by: Adrian Orive --- notes/verify/title.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/notes/verify/title.go b/notes/verify/title.go index 92522bf..3bd9e1c 100644 --- a/notes/verify/title.go +++ b/notes/verify/title.go @@ -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 } @@ -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}