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

Helix branches do not recurse when defining multibranch pipeline

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • p4-plugin

      If I have a multibranch pipeline and set Helix Branch as the source, and provide it with //depot/… as my branch to include, it only seems to scan one layer deep (it picks up //depot/project/Jenksinfile , but does not pick up //depot/project/dev/username/Jenkinsfile).

      The help tip for this input claims that "A List of Perforce Depot paths (separated by new lines). The plugin will recursively search for a Jenkinsfile (or defined item) using the last directory name for the multi-branch name."

      This does not seem to be true.

      I can trick it by defining separate entries for each depth of hierarchy I might expect:

      //depot/*
      //depot/*/*
      //depot/*/*/*
      etc
      

      I care about this because I want to use a single job definition for all of my client projects, each of which is free to use a Jenkinsfile of their choosing, to reduce maintenance. Not all projects follow an identical depth of hierarchy.

          [JENKINS-52605] Helix branches do not recurse when defining multibranch pipeline

          Paul Allen added a comment -

          Relates to https://github.com/p4paul/p4-jenkins/issues/35; specifically to the reference to using a 'separate folder in Jenkins for each level of hierarchy found'.

          Paul Allen added a comment - Relates to  https://github.com/p4paul/p4-jenkins/issues/35 ; specifically to the reference to using a 'separate folder in Jenkins for each level of hierarchy found'.

          Karl Wirth added a comment -

          Needs documentation that this is expected behavior.

          Built in bubble help  currently states it's recursive:

          The plugin will recursively search for a Jenkinsfile (or defined item) using the last directory name for the multi-branch name.
          	For example: //depot/...
          
          

          And online doc is not explicit that it is not recursive:

          https://github.com/jenkinsci/p4-plugin/blob/master/docs/MULTI.md#helix-branches

           

          Additionally the folder name is the unique identifier so doc should state that branch names must be unique.  For example if you use the mapping:
           
          //depot/BaseProj/Proj*/...
           
          or the mapping:
           
          //depot/BaseProj/ProjA/...
          //depot/BaseProj/ProjB/...

          And the directories are:

          //depot/BaseProj/ProjA/01
          //depot/BaseProj/ProjA/02

          //depot/BaseProj/ProjB/01  **
          //depot/BaseProj/ProjB/02
            ** 
          //depot/BaseProj/ProjB/03
          //depot/BaseProj/ProjB/04

          You will end up with the following branches because '01' and '02' are not unique:

          01 (from ProjA)
          02 (from ProjA)

          04 (from ProjB)
          05
          (from ProjB)

           

          Karl Wirth added a comment - Needs documentation that this is expected behavior. Built in bubble help  currently states it's recursive: The plugin will recursively search for a Jenkinsfile (or defined item) using the last directory name for the multi-branch name. For example: //depot/... And online doc is not explicit that it is not recursive: https://github.com/jenkinsci/p4-plugin/blob/master/docs/MULTI.md#helix-branches   Additionally the folder name is the unique identifier so doc should state that branch names must be unique.  For example if you use the mapping:   //depot/BaseProj/Proj*/...   or the mapping:   //depot/BaseProj/ProjA/... //depot/BaseProj/ProjB/... And the directories are: //depot/BaseProj/ProjA/01 //depot/BaseProj/ProjA/02 //depot/BaseProj/ProjB/01  ** //depot/BaseProj/ProjB/02   **   //depot/BaseProj/ProjB/03 //depot/BaseProj/ProjB/04 You will end up with the following branches because '01' and '02' are not unique: 01 (from ProjA) 02 (from ProjA) 04 (from ProjB) 05 (from ProjB)  

          Bubble help is fixed in the latest release (1.9.2). 

          Online doc is  in progress. 

          Kevin Williamson added a comment - Bubble help is fixed in the latest release (1.9.2).  Online doc is  in progress. 

          Paul Allen added a comment -

          Updated in docs (soon to be released)

          Paul Allen added a comment - Updated in docs (soon to be released)

            p4kevin Kevin Williamson
            pollockm Matt Pollock
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: