Skip to content

Commit

Permalink
Merge pull request kubernetes#523 from timstclair/munger
Browse files Browse the repository at this point in the history
Tollerate issue URLs in rebuild requests
  • Loading branch information
eparis committed Mar 1, 2016
2 parents ed1fb4e + a37ced3 commit 56e18b1
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
6 changes: 5 additions & 1 deletion mungers/rebuild.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,13 @@ type RebuildMunger struct {
robots sets.String
}

const (
issueURLRe = "(?:https?://)?github.com/kubernetes/kubernetes/issues/[0-9]+"
)

var (
buildMatcher = regexp.MustCompile("@k8s-bot\\s+(?:e2e\\s+)?(?:unit\\s+)?test\\s+this.*")
issueMatcher = regexp.MustCompile("\\s+(?:github\\s+)?(issue|flake)\\:?\\s+#(?:IGNORE|[0-9]+)")
issueMatcher = regexp.MustCompile("\\s+(?:github\\s+)?(issue|flake)\\:?\\s+(?:#(?:IGNORE|[0-9]+)|" + issueURLRe + ")")
)

func init() {
Expand Down
12 changes: 12 additions & 0 deletions mungers/rebuild_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,18 @@ func TestRebuildMissingIssue(t *testing.T) {
value: "@k8s-bot test this please flake: #12345",
expectMissing: false,
},
{
value: "@k8s-bot test this please flake: https://github.com/kubernetes/kubernetes/issues/12345",
expectMissing: false,
},
{
value: "@k8s-bot test this please flake: https://github.com/kubernetes/kubernetes/issues/12345",
expectMissing: false,
},
{
value: "@k8s-bot test this please flake: github.com/kubernetes/kubernetes/issues/12345",
expectMissing: false,
},
}
for _, test := range tests {
comment := &githubapi.IssueComment{
Expand Down

0 comments on commit 56e18b1

Please sign in to comment.