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

Programmatic control over Perforce options

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: perforce-plugin
    • Labels:
      None
    • Environment:
      Platform agnostic, but for the record, Windows Server 2003/2008
    • Similar Issues:

      Description

      As it stands, Perforce options set via the Hudson GUI are sticky/permanent. It would be nice to provide a programmatic way (perhaps one already exists) to dynamically modify Perforce options. For instance:

      -Clean Workspace Before Each Build
      -One Time Force Sync
      -Always Force Sync

      Suppose I run continuous testing (test A, B and C) on build X, I'd like to clean+onetime force sync only once, before my three tests run. When I kick of the same three tests on build Y, perform the clean+onetime force sync again for build Y. As it stands, all three tests for both builds would have clean+onetime force sync executed, unless I'm missing something.

      Thanks.

        Attachments

          Activity

          Hide
          rpetti Rob Petti added a comment -

          I'm not sure I follow your example. Shouldn't your three tests run as part of the same build, in which case it would only get cleaned and force synced once?

          In any case, I think that this is outside the scope of the perforce plugin. This should rather be a separate plugin that would allow for the ability to change job configurations of any kind on the fly.

          Show
          rpetti Rob Petti added a comment - I'm not sure I follow your example. Shouldn't your three tests run as part of the same build, in which case it would only get cleaned and force synced once? In any case, I think that this is outside the scope of the perforce plugin. This should rather be a separate plugin that would allow for the ability to change job configurations of any kind on the fly.
          Hide
          levante levante added a comment -

          Sorry for not being clear with terminology, I'll try and be a little bit more descriptive here:

          Suppose I have a set of defined jobs in Hudson that represent a logical test on a particular build X. I've added an automation layer which will run the logical test in a loop (imagine a performance test which requires trial runs to measure variability). If the first job in the logical test depends on Perforce to synchronize against the repository, I'd like to synchronize on the first iteration of the loop, but not the rest.

          > This should rather be a separate plugin that would allow for the ability to change job configurations of any kind on the fly.

          I was thinking there was a precedence already with Perforce since you now allow parameterized views with the Perforce plugin GUI. Basically adding a layer of indirection for some of the other options as well (i.e. clean workspace, force sync each time).

          I understand what I'm describing is a unique use case.

          Show
          levante levante added a comment - Sorry for not being clear with terminology, I'll try and be a little bit more descriptive here: Suppose I have a set of defined jobs in Hudson that represent a logical test on a particular build X. I've added an automation layer which will run the logical test in a loop (imagine a performance test which requires trial runs to measure variability). If the first job in the logical test depends on Perforce to synchronize against the repository, I'd like to synchronize on the first iteration of the loop, but not the rest. > This should rather be a separate plugin that would allow for the ability to change job configurations of any kind on the fly. I was thinking there was a precedence already with Perforce since you now allow parameterized views with the Perforce plugin GUI. Basically adding a layer of indirection for some of the other options as well (i.e. clean workspace, force sync each time). I understand what I'm describing is a unique use case.
          Hide
          rpetti Rob Petti added a comment -

          Ahhh. So just have the plugin look for boolean parameters like P4CLEANWORKSPACE and P4FORCESYNC? I think that'll be doable.

          Show
          rpetti Rob Petti added a comment - Ahhh. So just have the plugin look for boolean parameters like P4CLEANWORKSPACE and P4FORCESYNC? I think that'll be doable.
          Hide
          levante levante added a comment -

          Exactly!

          Show
          levante levante added a comment - Exactly!
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in hudson
          User: : rpetti
          Path:
          trunk/hudson/plugins/perforce/src/main/java/hudson/plugins/perforce/PerforceSCM.java
          trunk/hudson/plugins/perforce/src/main/webapp/help/forceSync.html
          trunk/hudson/plugins/perforce/src/main/webapp/help/wipeBeforeBuild.html
          http://jenkins-ci.org/commit/32670
          Log:
          [FIXED JENKINS-6526] adding programmatic control parameters P4FORCESYNC and P4CLEANWORKSPACE

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in hudson User: : rpetti Path: trunk/hudson/plugins/perforce/src/main/java/hudson/plugins/perforce/PerforceSCM.java trunk/hudson/plugins/perforce/src/main/webapp/help/forceSync.html trunk/hudson/plugins/perforce/src/main/webapp/help/wipeBeforeBuild.html http://jenkins-ci.org/commit/32670 Log: [FIXED JENKINS-6526] adding programmatic control parameters P4FORCESYNC and P4CLEANWORKSPACE

            People

            • Assignee:
              rpetti Rob Petti
              Reporter:
              levante levante
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: