Fix url encoding of job names in jenkins input plugin (#7211)
This commit is contained in:
@@ -73,7 +73,7 @@ const sampleConfig = `
|
||||
|
||||
## Optional Sub Job Per Layer
|
||||
## In workflow-multibranch-plugin, each branch will be created as a sub job.
|
||||
## This config will limit to call only the lasted branches in each layer,
|
||||
## This config will limit to call only the lasted branches in each layer,
|
||||
## empty will use default value 10
|
||||
# max_subjob_per_layer = 10
|
||||
|
||||
@@ -442,12 +442,20 @@ func (jr jobRequest) combined() []string {
|
||||
return append(jr.parents, jr.name)
|
||||
}
|
||||
|
||||
func (jr jobRequest) combinedEscaped() []string {
|
||||
jobs := jr.combined()
|
||||
for index, job := range jobs {
|
||||
jobs[index] = url.PathEscape(job)
|
||||
}
|
||||
return jobs
|
||||
}
|
||||
|
||||
func (jr jobRequest) URL() string {
|
||||
return "/job/" + strings.Join(jr.combined(), "/job/") + jobPath
|
||||
return "/job/" + strings.Join(jr.combinedEscaped(), "/job/") + jobPath
|
||||
}
|
||||
|
||||
func (jr jobRequest) buildURL(number int64) string {
|
||||
return "/job/" + strings.Join(jr.combined(), "/job/") + "/" + strconv.Itoa(int(number)) + jobPath
|
||||
return "/job/" + strings.Join(jr.combinedEscaped(), "/job/") + "/" + strconv.Itoa(int(number)) + jobPath
|
||||
}
|
||||
|
||||
func (jr jobRequest) hierarchyName() string {
|
||||
|
||||
Reference in New Issue
Block a user