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

[P4 Plugin] Add optional member to Populate types to explicitly specify the CL to sync

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Fixed
    • Icon: Major Major
    • p4-plugin

      The pin property is difficult to work with because it affects polling. Add an additional String property such as buildChange or change to the Populate class that can be set via a @DataBoundSetter. Update CheckoutTask#getBuildChange to also consider this value (if set) to determine the build change.

      This will at least allow pipelines to easily sync to specific changelists / labels / counters that come from job parameters.

      Example (assuming String parameter 'Changelist' exists):

      checkout(
          perforce(
              credential: 'credential',
              populate: syncOnly(
                  change: params.Changelist,
                  force: false,
                  have: true,
                  modtime: false,
                  parallel: [enable: false, minbytes: '1024', minfiles: '1', threads: '4'],
                  pin: '',
                  quiet: false,
                  revert: false
              ),
              workspace: streamSpec(
                  charset: 'none',
                  format: 'jenkins-${NODE_NAME}-${JOB_NAME}',
                  pinHost: true,
                  streamName: '//depot/path'
              )
          )
      )
      

            p4paul Paul Allen
            stuartrowe Stuart Rowe
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: