jenkinsci / jenkinsci/branch-api-plugin
[JENKINS-54869] Multibranch project truncates cloudbees folder workspace paths
- Dominant language
- Java
- Stars
- 39
- Forks
- 154
- PR merge metrics
- No merged PRs in 30d
Description
With recent updates, the branch API plugin appears to truncate the cloudbees folder workspace paths. For example, we relocate the Jenkins workspace in the config.xml using
D:/builds/workspace/${ITEM_FULLNAME}
Our jobs are within multiple folders, ie ProjectBlue/Developer. This has always resulted in a build workspace at a well known location. For example, with a multibranch project client_developer, running a job from branch APS-1137, that location would be:
D:/builds/workspace/ProjectBlue/Developer/client_developer/APS-1137
However, with the latest update to branch api 2.1.1, we are seeing truncation of the path to:
D:/builds/workspace/eloper_client_developer_APS-1137
The workspaces.txt file shows this truncation:
```
1: ProjectBlue/Developer/client_developer/9X_DotNetTool
2: r_client_developer_9X_DotNetTool
3: ProjectBlue/Developer/client_developer/APS-1137
4: eloper_client_developer_APS-1137
5: ProjectBlue/Developer/client_developer/APS-1145-Apr
6: er_client_developer_APS-1145-Apr
```
I see that a bunch of work lately has been dealing with slashes, percents, et.al. in workspace paths (JENKINS-38706">JENKINS-38706,[JENKINS-30744">JENKINS-30744,JENKINS-39251">JENKINS-39251), but I cannot find one that exactly matches the issue described.
It would be nice to have some way to override or disable this truncation, restoring functionality of the full path, as this affects a great deal of downstream jobs that expect well known paths.
---
Originally reported by kansasmann, imported from: Multibranch project truncates cloudbees folder workspace paths
rsandell
Raw content of original issue
With recent updates, the branch API plugin appears to truncate the cloudbees folder workspace paths. For example, we relocate the Jenkins workspace in the config.xml using
<workspaceDir>D:/builds/workspace/${ITEM_FULLNAME}</workspaceDir>Our jobs are within multiple folders, ie ProjectBlue/Developer. This has always resulted in a build workspace at a well known location. For example, with a multibranch project client_developer, running a job from branch APS-1137, that location would be:
D:/builds/workspace/ProjectBlue/Developer/client_developer/APS-1137However, with the latest update to branch api 2.1.1, we are seeing truncation of the path to:
D:/builds/workspace/eloper_client_developer_APS-1137The workspaces.txt file shows this truncation:
1: ProjectBlue/Developer/client_developer/9X_DotNetTool
2: r_client_developer_9X_DotNetTool
3: ProjectBlue/Developer/client_developer/APS-1137
4: eloper_client_developer_APS-1137
5: ProjectBlue/Developer/client_developer/APS-1145-Apr
6: er_client_developer_APS-1145-AprI see that a bunch of work lately has been dealing with slashes, percents, et.al. in workspace paths (
JENKINS-38706,[JENKINS-30744,JENKINS-39251), but I cannot find one that exactly matches the issue described.It would be nice to have some way to override or disable this truncation, restoring functionality of the full path, as this affects a great deal of downstream jobs that expect well known paths.
- environment:
Windows Server 2008 R2 Enterprise, Jenkins 2.153, branch Api Plugin 2.1.1
Contributor guide
Research direction
Start in the branch-api-plugin workspace-path handling, using the reported workspaceDir value with ${ITEM_FULLNAME} and the Windows Server 2008 R2, Jenkins 2.153, and Branch API 2.1.1 environment. Reproduce the foldered multibranch examples and compare the resulting path and workspaces.txt entries; done means the full ProjectBlue/Developer path is preserved or truncation can be disabled.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100