Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-63158

Replacement of slashes in workspace paths

XMLWordPrintable

      Hello,

      When using the bitbucket-branch-source-plugin, the plugin produces the following structure in Jenkins (example):

      Jenkins
      └─ (folder) BitbucketProjectName
              ├── (folder) RepoName
              │         ├── (job) aBranch
              |         └── (job) otherBranch
              ...
      

      The execution of a job produces the following workspaces:

      {JENKINS_HOME}/workspace/cketProjectName_RepoName_aBranch@libs
      {JENKINS_HOME}/workspace/ProjectName_RepoName_otherBranch@libs
      

      The resulting workspace paths are unexpected to me in multiple ways:

      1. The workspace paths are shortened
        The responsible limit which is responsible for the shortening can be found here: https://github.com/jenkinsci/branch-api-plugin/blob/branch-api-2.5.6/src/main/java/jenkins/branch/WorkspaceLocatorImpl.java#L100
        The
      2. The workspace paths do not use subfolders
        The responsible method can be found here: https://github.com/jenkinsci/branch-api-plugin/blob/branch-api-2.5.6/src/main/java/jenkins/branch/WorkspaceLocatorImpl.java#L360

      My issues with the observed behavior:
      Usually jobs in folders produce workspaces like {JENKINS_HOME}/workspace/aFolder/aSubFolder/aJob@libs. Why does the branch-api-plugin produce workspaces in a different way ?
      More precisely, why does the branch-api-plugin replace the slashes `/` with underscores `_` ?

      If the slashes were not replaced, the resulting workspace paths would simply leverage subfolders like other jobs in folders. So I wonder: Is this behavior really intended, or is this a bug ?

            Unassigned Unassigned
            shoelzle Stefan Hölzle
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: