-
Bug
-
Resolution: Fixed
-
Minor
-
None
-
-
1.0-m10
Steps to Repro
- Create a folder, (e.g. name="folder1")
- Create a multi-branch pipeline (e.g. name="blueocean-pr-testing-2")
- Ensure it finishes indexing
Invoke the /search API and retrieve the JSON for the project:
{ "_class": "io.jenkins.blueocean.service.embedded.rest.MultiBranchPipelineImpl", "_links": { "self": { "_class": "io.jenkins.blueocean.rest.hal.Link", "href": "/blue/rest/organizations/jenkins/pipelines/blueocean-pr-testing-2/" }, "branches": { "_class": "io.jenkins.blueocean.rest.hal.Link", "href": "/blue/rest/organizations/jenkins/pipelines/blueocean-pr-testing-2/branches/" }, "actions": { "_class": "io.jenkins.blueocean.rest.hal.Link", "href": "/blue/rest/organizations/jenkins/pipelines/blueocean-pr-testing-2/actions/" }, "runs": { "_class": "io.jenkins.blueocean.rest.hal.Link", "href": "/blue/rest/organizations/jenkins/pipelines/blueocean-pr-testing-2/runs/" }, "queue": { "_class": "io.jenkins.blueocean.rest.hal.Link", "href": "/blue/rest/organizations/jenkins/pipelines/blueocean-pr-testing-2/queue/" } }, "actions": [], "displayName": "blueocean-pr-testing-2", "estimatedDurationInMillis": 1571, "fullName": "folder1/blueocean-pr-testing-2", "lastSuccessfulRun": null, "latestRun": null, "name": "blueocean-pr-testing-2", "organization": "jenkins", "weatherScore": 100, "branchNames": [ "feature%2Fyyy", "develop", "master", "feature%2Fcliff-1", "feature%2Fcliff-2", "feature%2Fxxx" ], "numberOfFailingBranches": 0, "numberOfFailingPullRequests": 0, "numberOfSuccessfulBranches": 6, "numberOfSuccessfulPullRequests": 0, "totalNumberOfBranches": 6, "totalNumberOfPullRequests": 0 }
The self link and child links all return a 404:
http://localhost:8080/jenkins/blue/rest/organizations/jenkins/pipelines/blueocean-pr-testing-2/
Adding the folder name immediately before returns 200:
http://localhost:8080/jenkins/blue/rest/organizations/jenkins/pipelines/folder1/blueocean-pr-testing-2/
Adding the folder name and using "pipelines" as a delimiter also returns 200:
http://localhost:8080/jenkins/blue/rest/organizations/jenkins/pipelines/folder1/pipelines/blueocean-pr-testing-2/
URI-encoding the "fullName" (folder path + job name) returns a 404, when either single or double URI-encoded:
http://localhost:8080/jenkins/blue/rest/organizations/jenkins/pipelines/folder1%2Fblueocean-pr-testing-2/
http://localhost:8080/jenkins/blue/rest/organizations/jenkins/pipelines/folder1%252Fblueocean-pr-testing-2/
Using the "fullName" as the project name seems fine, although it's odd from a consistency standpoint that the name should not be URI-encoded while the branch name should.
NOTE: This might only impact multi-branch pipelines nested in folders. A regular pipeline seems to be correct
For example, a pipeline nested in a single folder returns this self URL which returns 200:
http://localhost:8080/jenkins/blue/rest/organizations/jenkins/pipelines/folder1/pipelines/pipeline-1/
And a deeply-nested freestyle job also returns a valid self URL which returns 200:
http://localhost:8080/jenkins/blue/rest/organizations/jenkins/pipelines/folder1/pipelines/folder2/pipelines/folder3/pipelines/freestyle-3/