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

Parametrize incremental build in freestyle jobs

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      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
       

        Attachments

          Activity

          Hide
          p4karl Karl Wirth added a comment -

          Daniel Jeznach- 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.

          Show
          p4karl Karl Wirth added a comment - Daniel Jeznach - 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.
          Hide
          daniel_jeznach_img 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).
           

          Show
          daniel_jeznach_img 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).  
          Hide
          p4karl Karl Wirth added a comment -

          Hi Daniel Jeznach - 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.

           

          Show
          p4karl Karl Wirth added a comment - Hi Daniel Jeznach - 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.  
          Hide
          daniel_jeznach_img Daniel Jeznach added a comment -

          I've created a pull request for this one. I tried to comply to all guidelines, I hope the code will meet your standards.

          Show
          daniel_jeznach_img Daniel Jeznach added a comment - I've created a pull request for this one. I tried to comply to all guidelines, I hope the code will meet your standards.
          Hide
          p4karl Karl Wirth added a comment -
          Show
          p4karl Karl Wirth added a comment - Daniel Jeznach - Thanks. FYI Paul Allen Pull request - https://github.com/jenkinsci/p4-plugin/pull/129  
          Hide
          p4paul Paul Allen added a comment -

          Released in 1.11.6

          Show
          p4paul Paul Allen added a comment - Released in 1.11.6

            People

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

              Dates

              Created:
              Updated:
              Resolved: