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

Parametrize incremental build in freestyle jobs

      Hi,

      in my company we use old perforce plugin in freestyle jobs, they mostly run incremental builds (one perforce changelist at a time), but sometimes we need to wipe out workspace and build all pending changelist at once.

      Old (legacy) perforce plugin has "P4ONECHANGELIST" parameter support, which, when enabled, builds only the oldest, not yet build change returned by polling routine.

      This is supported by p4 plugin using "incremental" clause, but is available only in declarative pipelines.

      I'd like to have similar, parametrized feature in p4 plugin, but for freestyle jobs. I know there is "Polling per change" filter, but it's not parametrized in any way (or I can't find how to do it).

      I have attached a short diff, that acts as if "Polling per change" field was active, if there is P4_INCREMENTAL environment variable set to "true" or not defined at all, and inactive if P4_INCREMENTAL environment variable is "false" .

      I have attached diff file. Is it possible to include this change in p4 plugin release?

      Kind regards,

      Daniel Jeznach
       

          [JENKINS-66169] Parametrize incremental build in freestyle jobs

          Daniel Jeznach created issue -
          Karl Wirth made changes -
          Attachment New: image-2021-07-19-13-26-13-781.png [ 55214 ]

          Karl Wirth added a comment -

          daniel_jeznach_img- Thanks. I will highlight it onto the developers:

          Additional information:

          In pipeline it is possible to code the 'filter:[incremental(true)]' to take a variable instead of 'true' to control behavior on the fly. In Fresstyle you dont have this flexibility. The 'Enabled' tickbox is either always on or always off:

          This request is asking for an override as a paramater to the job.

          Karl Wirth added a comment - daniel_jeznach_img - Thanks. I will highlight it onto the developers: Additional information: In pipeline it is possible to code the 'filter: [incremental(true)] ' to take a variable instead of 'true' to control behavior on the fly. In Fresstyle you dont have this flexibility. The 'Enabled' tickbox is either always on or always off: This request is asking for an override as a paramater to the job.
          Karl Wirth made changes -
          Labels Original: incrementals polling New: P4_A P4_VERIFY incrementals polling
          Daniel Jeznach made changes -
          Attachment New: p4-onechangelist-1.diff [ 55215 ]
          Daniel Jeznach made changes -
          Attachment Original: p4-onechangelist.diff [ 55213 ]

          Daniel Jeznach added a comment - - edited

          Thank you for taking look at this. I know about "incremental" filter, however have not found a way how parametrize it in FreeStyleProjects.

          I have attached diff, it checks if current run is FreeStyleBuild, if so, it calls the same code as if "incremental" filter were used. This way it can be parametrized using "P4_INCREMENTAL build parameter (boolean).
           

          Daniel Jeznach added a comment - - edited Thank you for taking look at this. I know about "incremental" filter, however have not found a way how parametrize it in FreeStyleProjects. I have attached diff, it checks if current run is FreeStyleBuild, if so, it calls the same code as if "incremental" filter were used. This way it can be parametrized using "P4_INCREMENTAL build parameter (boolean).  

          Karl Wirth added a comment -

          Hi daniel_jeznach_img - Thanks. Just to confirm that my 'Additional Information' was for our developers and QA so they could easily see where the enhancement was required.

          If you would like to submit a shelve for the devlopers to review please feel free to:  https://github.com/jenkinsci/p4-plugin

          We are always looking for community contributoirs to help improve the project.

           

          Karl Wirth added a comment - Hi daniel_jeznach_img - Thanks. Just to confirm that my 'Additional Information' was for our developers and QA so they could easily see where the enhancement was required. If you would like to submit a shelve for the devlopers to review please feel free to:  https://github.com/jenkinsci/p4-plugin We are always looking for community contributoirs to help improve the project.  
          Daniel Jeznach made changes -
          Attachment New: p4-onechangelist.diff [ 55222 ]
          Daniel Jeznach made changes -
          Attachment Original: p4-onechangelist-1.diff [ 55215 ]

            Unassigned Unassigned
            daniel_jeznach_img Daniel Jeznach
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: