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

Want an option to encode slashes in branch names differently

      Original reporter kazssym

      As issue #11 wrote, slashes in branch names are currently stored as %2F on the file system, but some application containers (I use GlassFish) do not like it in a URL. So I request an enhancement to add an option to encode slashes (or other special characters) differently, such as replacing with safe characters like '_' or something like that.

          [JENKINS-32253] Want an option to encode slashes in branch names differently

          jorge alves added a comment -

          Requesting to change this report to major.

          MsBuild based builds are broken when using relative paths to reference files.

          Example: referencing the file "..\..\directory\assembly.dll" makes msbuild resolve it into an absolute path. If this absolute path contains "%xx" it will replace it with the corresponding ascii character. %2F will therefore be decoded to "/" and break the build.

          jorge alves added a comment - Requesting to change this report to major. MsBuild based builds are broken when using relative paths to reference files. Example: referencing the file "..\..\directory\assembly.dll" makes msbuild resolve it into an absolute path. If this absolute path contains "%xx" it will replace it with the corresponding ascii character. %2F will therefore be decoded to "/" and break the build.

          brice maron added a comment -

          it seems that this issue is affecting a bunch of users as 4 of the 5 Pull-request are about this kind of problems with the "/" encoded in the directory name.

          might want to do smth here.

          brice maron added a comment - it seems that this issue is affecting a bunch of users as 4 of the 5 Pull-request are about this kind of problems with the "/" encoded in the directory name. might want to do smth here.

          Matt Hamilton added a comment -

          This is affecting me too. The %2f encoding of slashes is breaking something in the xcode build process. I think it is actually clang itself that is breaking. It would be great to be able to substitute the slash for an underscore or similar. Example of error message as a result of this below:

          Testing failed:
          Could not acquire lock file for module 'UIKit'
          Could not acquire lock file for module 'SwiftShims'
          Missing required module 'SwiftShims'

            • TEST FAILED **

          The following build commands failed:
          CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler
          CompileSwift normal x86_64 /Users/iosbuilds/.jenkins_slave/workspace/ios-enquos-nutrition/feature%2Fjenkins2/Nutrition/Pods/CryptoSwift/CryptoSwift/Foundation/AES+Foundation.swift
          CompileSwift normal x86_64 /Users/iosbuilds/.jenkins_slave/workspace/ios-enquos-nutrition/feature%2Fjenkins2/Nutrition/Pods/CryptoSwift/CryptoSwift/AES.swift
          CompileSwift normal x86_64 /Users/iosbuilds/.jenkins_slave/workspace/ios-enquos-nutrition/feature%2Fjenkins2/Nutrition/Pods/CryptoSwift/CryptoSwift/Array+Extension.swift
          CompileSwift normal x86_64 /Users/iosbuilds/.jenkins_slave/workspace/ios-enquos-nutrition/feature%2Fjenkins2/Nutrition/Pods/CryptoSwift/CryptoSwift/Foundation/Array<UInt8>+Foundation.swift
          (5 failures)

          Matt Hamilton added a comment - This is affecting me too. The %2f encoding of slashes is breaking something in the xcode build process. I think it is actually clang itself that is breaking. It would be great to be able to substitute the slash for an underscore or similar. Example of error message as a result of this below: Testing failed: Could not acquire lock file for module 'UIKit' Could not acquire lock file for module 'SwiftShims' Missing required module 'SwiftShims' TEST FAILED ** The following build commands failed: CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler CompileSwift normal x86_64 /Users/iosbuilds/.jenkins_slave/workspace/ios-enquos-nutrition/feature%2Fjenkins2/Nutrition/Pods/CryptoSwift/CryptoSwift/Foundation/AES+Foundation.swift CompileSwift normal x86_64 /Users/iosbuilds/.jenkins_slave/workspace/ios-enquos-nutrition/feature%2Fjenkins2/Nutrition/Pods/CryptoSwift/CryptoSwift/AES.swift CompileSwift normal x86_64 /Users/iosbuilds/.jenkins_slave/workspace/ios-enquos-nutrition/feature%2Fjenkins2/Nutrition/Pods/CryptoSwift/CryptoSwift/Array+Extension.swift CompileSwift normal x86_64 /Users/iosbuilds/.jenkins_slave/workspace/ios-enquos-nutrition/feature%2Fjenkins2/Nutrition/Pods/CryptoSwift/CryptoSwift/Foundation/Array<UInt8>+Foundation.swift (5 failures)

          Dmitriy Belyaev added a comment - - edited

          Affects me to.

          Running jenkins on windows7-x64 machine an using Git Worflow (generates branches like 'release/v1.0.0' and 'feature/test') will encode slash in branch name into "%2F" which will then broke Msbuild builds cause of those encoded slash will not be resolved correctly.

          Need an option to replace symbols in branch name to something safe instead of encoding them. Something like: replace "/" with "_" or similiar as option entry (or regexp match pattern).

          Dmitriy Belyaev added a comment - - edited Affects me to. Running jenkins on windows7-x64 machine an using Git Worflow (generates branches like ' release/v1.0.0 ' and ' feature/test ') will encode slash in branch name into " %2F " which will then broke Msbuild builds cause of those encoded slash will not be resolved correctly. Need an option to replace symbols in branch name to something safe instead of encoding them. Something like: replace "/" with "_" or similiar as option entry (or regexp match pattern).

          David Aldrich added a comment -

          Also affects us. We are still using version 0.3 so that our MSBuild jobs will work.

          Can it be simply fixed by pulling: https://github.com/jenkinsci/multi-branch-project-plugin/pull/129 ?

          David Aldrich added a comment - Also affects us. We are still using version 0.3 so that our MSBuild jobs will work. Can it be simply fixed by pulling: https://github.com/jenkinsci/multi-branch-project-plugin/pull/129 ?

          Dmitriy Belyaev added a comment - - edited

          davida2009 just tried to compile my custom version of multibranch plugin with pull request you mentioned included – looks like it does not work with the latest version of sources, I suppose as developer already switched to BRANCH API making this hotfix obsolete (see comment done by mjdetullio commented on Mar 15 to pull request on Github).

          Dmitriy Belyaev added a comment - - edited davida2009 just tried to compile my custom version of multibranch plugin with pull request you mentioned included – looks like it does not work with the latest version of sources, I suppose as developer already switched to BRANCH API making this hotfix obsolete (see comment done by mjdetullio commented on Mar 15 to pull request on Github).

          David Aldrich added a comment -

          John, thanks for testing. I don't know how this issue can be moved forward. I don't have the skills to modify the plugin myself. I guess we have to wait for the developer to do it, or appeal on the mailing list for a variant of this plugin.

          David Aldrich added a comment - John, thanks for testing. I don't know how this issue can be moved forward. I don't have the skills to modify the plugin myself. I guess we have to wait for the developer to do it, or appeal on the mailing list for a variant of this plugin.

          Dmitriy Belyaev added a comment - - edited

          davida2009 ok, so currently multi-branch-project-plugin uses branch-api plugin to obtain branch names. So, I tried to add the same changes in code as it is done it Pull Request you mentioned and it works fine (pull request on branch-api plugin: https://github.com/jenkinsci/branch-api-plugin/pull/44).

          It works well – jenkins and my msbuild jobs are up and running, but it looks ugly in code and just a fast workaround on existing code.

          I think, It is now a defect (or feature request) for developers of branch-api plugin, so I will change project on which this issue is registered.

          I suppose we can create feature request for developers of branch-api to add configurable option to replace symbols in branch names.

          Dmitriy Belyaev added a comment - - edited davida2009 ok, so currently multi-branch-project-plugin uses branch-api plugin to obtain branch names. So, I tried to add the same changes in code as it is done it Pull Request you mentioned and it works fine (pull request on branch-api plugin: https://github.com/jenkinsci/branch-api-plugin/pull/44 ). It works well – jenkins and my msbuild jobs are up and running, but it looks ugly in code and just a fast workaround on existing code. I think, It is now a defect (or feature request) for developers of branch-api plugin, so I will change project on which this issue is registered. I suppose we can create feature request for developers of branch-api to add configurable option to replace symbols in branch names.

          The code for the Multi-Branch Project Plugin using the Branch API has not yet been released... the encoding issue will exist in both places until that release.

          There are likely already duplicates of this issue for the Branch API or possibly Pipeline.

          Matthew DeTullio added a comment - The code for the Multi-Branch Project Plugin using the Branch API has not yet been released... the encoding issue will exist in both places until that release. There are likely already duplicates of this issue for the Branch API or possibly Pipeline.

          mjdetullio just checked – no such issue registered on branch-api plugin.

          Dmitriy Belyaev added a comment - mjdetullio just checked – no such issue registered on branch-api plugin.

            mjdetullio Matthew DeTullio
            mjdetullio Matthew DeTullio
            Votes:
            8 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated:
              Resolved: