• Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Minor Minor
    • p4-plugin
    • Jenkins 2.321, P4 Plugin 1.11.6, Swarm 2020.2

      Is it a matter of configuration to get the multibranch source using Helix Swarm to populate jobs using perforce streams?

      When the Jenkins Helix Swarm source syncs a stream, it syncs it as if it was a classic branch, ignoring the stream view (import, etc..). Only the non-imported files are synced.

      I ran into a similar result when I accidentally tried using the Helix Branches source with a stream path. I discovered I needed to add a Helix Streams source instead. It seems like Helix Swarm sources similarly only support classic depot branches?

          [JENKINS-67177] Helix Swarm source configured with streams

          Karl Wirth added a comment - - edited

          Hi cjtallman

          I think the problem is that Swarm doesnt actually know about streams. When you define a branch in Swarm its a fixed path. For example:

          Therefore it doesnt include the imports just the main stream. When you use Helix Swarm as the branch source you are passed just that one path.

          You can explicitly include the imports as seperate paths under the branch but that may have the unwanted side effect that your project includes reviews of the import paths or the mappings may be wrong.

          I think the better solution is to define the multibranch source as 'Helix Streams' but there are a lot of caveats:

          (1) The branch name in the project in Swarm must be 100% the same as the name of the stream. For example if the stream path is '//stream/Dev1' but the stream name is 'dev' then the branch name in the project must be 'dev'.

          (2) There can be no spaces or characters in the branch name that would be URL encoded in the Jenkins job URL.

          (3) When triggering from Swarm you call the 'Review' end point for the job passing in the '

          {branchName}' in the URL. For example:

          http://USER:API-TOKEN@JENKINS-SERVER:8080/job/swarmmultibranch/job/{branchName}

          /review/build

           

          Regards,

          Karl

           

           

          Karl Wirth added a comment - - edited Hi cjtallman I think the problem is that Swarm doesnt actually know about streams. When you define a branch in Swarm its a fixed path. For example: Therefore it doesnt include the imports just the main stream. When you use Helix Swarm as the branch source you are passed just that one path. You can explicitly include the imports as seperate paths under the branch but that may have the unwanted side effect that your project includes reviews of the import paths or the mappings may be wrong. I think the better solution is to define the multibranch source as 'Helix Streams' but there are a lot of caveats: (1) The branch name in the project in Swarm must be 100% the same as the name of the stream. For example if the stream path is '//stream/Dev1' but the stream name is 'dev' then the branch name in the project must be 'dev'. (2) There can be no spaces or characters in the branch name that would be URL encoded in the Jenkins job URL. (3) When triggering from Swarm you call the 'Review' end point for the job passing in the ' {branchName}' in the URL. For example: http://USER:API-TOKEN@JENKINS-SERVER:8080/job/swarmmultibranch/job/ {branchName} /review/build   Regards, Karl    

          Chris Tallman added a comment -

          Thanks for that additional confirmation and clarity. I think we will need to keep using the "Helix Streams" as our primary job source configuration. We were hoping to have Swarm manage the branch/stream lists for our projects, but it sounds like the lack of support is more on the Swarm side instead of the P4Jenkins side. In the future, it would be nice to be able to centralize our project workflows under one definition, but we'll deal with the current segmented approach for now. Thanks again. 

          Chris Tallman added a comment - Thanks for that additional confirmation and clarity. I think we will need to keep using the "Helix Streams" as our primary job source configuration. We were hoping to have Swarm manage the branch/stream lists for our projects, but it sounds like the lack of support is more on the Swarm side instead of the P4Jenkins side. In the future, it would be nice to be able to centralize our project workflows under one definition, but we'll deal with the current segmented approach for now. Thanks again. 

          Karl Wirth added a comment -

          Hi cjtallman - Sorry for the delay in responding and thanks. I already have some internal enhancement requests raised for issues related to this.

           

          Karl Wirth added a comment - Hi cjtallman - Sorry for the delay in responding and thanks. I already have some internal enhancement requests raised for issues related to this.  

            p4karl Karl Wirth
            cjtallman Chris Tallman
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: