Skip to content

Commit

Permalink
Merge pull request #323 from pivotal-cf/fix/issue_filter
Browse files Browse the repository at this point in the history
fix: default regex for IssueTitle
  • Loading branch information
syslxg committed Jul 24, 2022
2 parents f973113 + 9e12e5f commit 5b51e5c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion internal/release/notes_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
1 change: 1 addition & 0 deletions internal/release/notes_data_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down

0 comments on commit 5b51e5c

Please sign in to comment.