Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Make the view regex a bit more restrictive to prevent collissions #79

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/groovy/com/entagen/jenkins/JenkinsApi.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class JenkinsApi {
println "creating view - viewName:${viewName}, nestedView:${nestedWithinView}"
post(buildViewPath("createView", nestedWithinView), body)

String regex = viewRegex ? viewRegex.replaceAll("master", branchView.safeBranchName) : "${branchView.templateJobPrefix}.*${branchView.safeBranchName}"
String regex = viewRegex ? viewRegex.replaceAll("master", branchView.safeBranchName) : "${branchView.templateJobPrefix}-[a-zA-Z0-9]*-${branchView.safeBranchName}"
body = [useincluderegex: 'on', includeRegex: regex, name: viewName, json: '{"name": "' + viewName + '","useincluderegex": {"includeRegex": "' + regex + '"},' + VIEW_COLUMNS_JSON + '}']
println "configuring view ${viewName}"
post(buildViewPath("configSubmit", nestedWithinView, viewName), body)
Expand Down