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

multibranch streams don't allow lightweight checkout?

      I might have misconfigured my job, given this piece of documentation https://github.com/jenkinsci/p4-plugin/blob/master/docs/MULTI.md

      >Lightweight checkout is automatically applied by Jenkins to MultiBranch jobs

      However I'm running a multibranch job that is polling //depot/... to find streams. The actual sync for this project should be a very small subset of the matched stream, while the whole stream is many gigabytes worth of data.

      I have the following code in the Jenkinsfile

      pipeline {
          agent any
          stages {
              stage('Sync') {
                  steps {
                      checkout perforce(
                          credential: 'credentialname',
                          populate: autoClean(),
                          workspace: manualSpec(
                              charset: 'utf8',
                              name: "jenkins-${NODE_NAME}-${JOB_NAME}-${EXECUTOR_NUMBER}",
                              spec: clientSpec(
                                  allwrite: true,
                                  view: """\
              //depot/${env.BRANCH_NAME}/ServerCode/... //\${P4_CLIENT}/ServerCode/...
              //depot/${env.BRANCH_NAME}/ApplicationCode/SubDir/... //\${P4_CLIENT}/ApplicationCode/SubDir/...
              """,
                                  streamName: "//depot/${env.BRANCH_NAME}"
                              )
                          )
                      )
                  }
              }
          }
      }
      

      but my console log shows a full sync of //depot/StreamName/... before this stage runs. Adding "options { skipDefaultCheckout() }" doesn't have any effect.

          [JENKINS-60251] multibranch streams don't allow lightweight checkout?

          Karl Wirth added a comment -

          Hi asmith_pipeworks -Thanks for your interest in the plugin.

          A couple of questions....

          Can you please send me a screenshot of the 'Branch Sources' section of your multibranch job configuration page. For  a streams depot I would expect something like:

          Also just to double check. Have you changed the name of your depot in the above Jenkinsfile? Perforce by default comes with a 'classic' depot called 'depot' that you cannot create streams under. Streams can only be created under a depot of type 'stream'. You can check this by running 'p4 depots'.

          The reason I'm pointing this out is that we use different code for streams and classic depots. If the code for a streams was used against a classic depot we would sync everything.

          Finally can you send me the version of p4-plugin and Jenkins you are using.

          Thanks in advance,

          Karl

           

           

          Karl Wirth added a comment - Hi asmith_pipeworks -Thanks for your interest in the plugin. A couple of questions.... Can you please send me a screenshot of the 'Branch Sources' section of your multibranch job configuration page. For  a streams depot I would expect something like: Also just to double check. Have you changed the name of your depot in the above Jenkinsfile? Perforce by default comes with a 'classic' depot called 'depot' that you cannot create streams under. Streams can only be created under a depot of type 'stream'. You can check this by running 'p4 depots'. The reason I'm pointing this out is that we use different code for streams and classic depots. If the code for a streams was used against a classic depot we would sync everything. Finally can you send me the version of p4-plugin and Jenkins you are using. Thanks in advance, Karl    

          Adam Smith added a comment -

          Good morning Karl,

          I apologize for taking your time on this. I discovered my own misconfiguration late this same night and planned to update the ticket this morning. You beat me to the punch! Under the "Advanced" dropdown, I selected "Preview Only" as the populate option which produced my desired behavior.

          I'll close this now.

          Adam Smith added a comment - Good morning Karl, I apologize for taking your time on this. I discovered my own misconfiguration late this same night and planned to update the ticket this morning. You beat me to the punch! Under the "Advanced" dropdown, I selected "Preview Only" as the populate option which produced my desired behavior. I'll close this now.

          Karl Wirth added a comment -

          HI asmith_pipeworks - No need to aologise and great that you solved it. If there's anything else we can do to help, please let us know.

          Karl Wirth added a comment - HI asmith_pipeworks - No need to aologise and great that you solved it. If there's anything else we can do to help, please let us know.

            p4karl Karl Wirth
            asmith_pipeworks Adam Smith
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: