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

multibranch issues if branch contains /

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Our repository contains a variant of the git-flow branch naming convention, where you will see
      branches such as dev/main or release/3.2

      Using multibranch, strange things happen:

      • dev/main gets displayed as dev%2Fmain, then on restart dev%252Fmain, then dev%25252Fmain and all history seems to be lost.

      This is likely down to / being a dodgy delimiter for a project name. I tried to fix this by adjusting WorkflowBranchProjectFactory thusly:

      -        WorkflowJob job = new WorkflowJob((WorkflowMultiBranchProject) getOwner(), branch.getName());
      +        String branchName = branch.getName().replace("/", "-");
      +        WorkflowJob job = new WorkflowJob((WorkflowMultiBranchProject) getOwner(), branchName);
      

      but it didn't seem to help.

      Happy to try to fix if I can get a pointer as to what to look at.

        Attachments

          Issue Links

            Activity

            Hide
            nemligtim Timothy Harris added a comment -

            Why is this issue closed? I mean any MSBuild run will fail with this conversion of "/". Many branching strategies include branch names that have a "/" in them. Pretty standard for Bitbucket installations as it defaults to.

            feature/

            hotfix/

            bugfix/

            release/

             

            Please reopen and convert to something less painful! 

            Show
            nemligtim Timothy Harris added a comment - Why is this issue closed? I mean any MSBuild run will fail with this conversion of "/". Many branching strategies include branch names that have a "/" in them. Pretty standard for Bitbucket installations as it defaults to. feature/ hotfix/ bugfix/ release/   Please reopen and convert to something less painful! 
            Hide
            markewaite Mark Waite added a comment -

            Timothy Harris please refer to the duplicate bug JENKINS-34564 which describes more details. This is a duplicate bug and the project prefers to close duplicates so that they don't clutter searches.

            Show
            markewaite Mark Waite added a comment - Timothy Harris please refer to the duplicate bug JENKINS-34564 which describes more details. This is a duplicate bug and the project prefers to close duplicates so that they don't clutter searches.
            Hide
            varun7447 Varun Reddy added a comment -

            The bug JENKINS-34564 also does not work for MSBuild. It fixes the longpath but not the issues with /

            Show
            varun7447 Varun Reddy added a comment - The bug JENKINS-34564 also does not work for MSBuild. It fixes the longpath but not the issues with /
            Hide
            nemligtim Timothy Harris added a comment - - edited

            I got around this by giving it a specific workspace.

            agent {
                node {
                    label 'windows'
                    // Todo: This s really bad but Jenkins Multibranch is being very bad with very long paths being generated!
                    customWorkspace "${JOB_NAME}"
                }
            }

            I got around the conversion of "/" by changing the branching strategy in Bitbucket to feature-, hotfix-, release- instead of feature/, hotfix/, release/.

            Both of these are pretty frustrating. Especially the "/". 

            Show
            nemligtim Timothy Harris added a comment - - edited I got around this by giving it a specific workspace. agent {     node {         label 'windows'         // Todo: This s really bad but Jenkins Multibranch is being very bad with very long paths being generated!         customWorkspace "${JOB_NAME}"     } } I got around the conversion of "/" by changing the branching strategy in Bitbucket to feature-, hotfix-, release- instead of feature/, hotfix/, release/. Both of these are pretty frustrating. Especially the "/". 
            Hide
            varun7447 Varun Reddy added a comment -

            I am currently using the Branching strategy to include - instead of / . But the default behavior in setting up git flow branches are / .

            Show
            varun7447 Varun Reddy added a comment - I am currently using the Branching strategy to include - instead of / . But the default behavior in setting up git flow branches are / .

              People

              • Assignee:
                jglick Jesse Glick
                Reporter:
                magnayn magnayn
              • Votes:
                14 Vote for this issue
                Watchers:
                47 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: