From 9e12e5f694d06c5dbd8fc6ca5760112e79903ebb Mon Sep 17 00:00:00 2001 From: Gary Liu Date: Sun, 24 Jul 2022 12:03:45 -0700 Subject: [PATCH] fix: default regex for IssueTitle this fixs the bug [#182763807] Authored-by: Gary Liu --- internal/release/notes_data.go | 2 +- internal/release/notes_data_test.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/release/notes_data.go b/internal/release/notes_data.go index e3bc4219f..8f0860e49 100644 --- a/internal/release/notes_data.go +++ b/internal/release/notes_data.go @@ -88,7 +88,7 @@ type IssuesQuery struct { IssueIDs []string `long:"github-issue" short:"i" description:"a list of issues to include in the release notes; these are deduplicated with the issue results"` IssueMilestone string `long:"github-issue-milestone" short:"m" description:"issue milestone to use, it may be the milestone number or the milestone name"` IssueLabels []string `long:"github-issue-label" short:"l" description:"issue labels to add to issues query"` - IssueTitleExp string `long:"issues-title-exp" short:"x" description:"issues with title matching regular expression will be added. Issues must first be fetched with github-issue* flags. The default expression can be disabled by setting an empty string" default:"(?i)^\\*\\*\\[(security fix)|(feature)|(feature improvement)|(bug fix)\\]\\*\\*.*$"` + IssueTitleExp string `long:"issues-title-exp" short:"x" description:"issues with title matching regular expression will be added. Issues must first be fetched with github-issue* flags. The default expression can be disabled by setting an empty string" default:"(?i)^\\*\\*\\[(security fix|feature|feature improvement|bug fix)\\]\\*\\*.*$"` } func (q IssuesQuery) Exp() (*regexp.Regexp, error) { diff --git a/internal/release/notes_data_test.go b/internal/release/notes_data_test.go index d67801cfb..7c2eaae30 100644 --- a/internal/release/notes_data_test.go +++ b/internal/release/notes_data_test.go @@ -379,6 +379,7 @@ func TestReleaseNotes_Options_IssueTitleExp(t *testing.T) { please.Expect(exp.MatchString("**[security fix]** Lorem Ipsum")).To(Ω.BeTrue()) please.Expect(exp.MatchString("**[none]** Lorem Ipsum")).To(Ω.BeFalse()) + please.Expect(exp.MatchString("**[none]** feature bug fix security")).To(Ω.BeFalse()) please.Expect(exp.MatchString("Lorem Ipsum")).To(Ω.BeFalse()) please.Expect(exp.MatchString("")).To(Ω.BeFalse()) please.Expect(exp.MatchString("**[]**")).To(Ω.BeFalse())