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

"Poll Exclude File(s)" option doesn't handle build parameters

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: perforce-plugin
    • Labels:
      None
    • Environment:
      Perforce plugin 1.36, Jenkins 1.439
    • Similar Issues:

      Description

      Hi there,

      It appears the "Poll Exclude File(s)" section of the Perforce plugin doesn't support build parameters. In my Perforce view configuration I'm quite happily using something like:

      //mydepot/${branch}/Engine/Include/Macros.h "//workspace/Engine/Include/Macros.h"

      where "branch" is a string parameter specified under the "This build is parameterized" option.

      However, if I enter the following in "Poll Exclude File(s)":

      //mydepot/${branch}/Engine/Tools/Source/StripELF/Readme_e.txt

      I get:

      ERROR: Failed to record SCM polling
      java.util.regex.PatternSyntaxException: Illegal repetition near index 8
      //mydepot/${branch}/Engine/Tools/Source/StripELF/Readme_e.txt
                ^
      	at java.util.regex.Pattern.error(Unknown Source)
      	at java.util.regex.Pattern.closure(Unknown Source)
      	at java.util.regex.Pattern.sequence(Unknown Source)
      	at java.util.regex.Pattern.expr(Unknown Source)
      	at java.util.regex.Pattern.compile(Unknown Source)
      	at java.util.regex.Pattern.<init>(Unknown Source)
      	at java.util.regex.Pattern.compile(Unknown Source)
      	at hudson.plugins.perforce.PerforceSCM.doesFilenameMatchP4Pattern(PerforceSCM.java:1112)
      	at hudson.plugins.perforce.PerforceSCM.doesFilenameMatchAnyP4Pattern(PerforceSCM.java:1100)
      	at hudson.plugins.perforce.PerforceSCM.isChangelistExcluded(PerforceSCM.java:1079)
      	at hudson.plugins.perforce.PerforceSCM.getCurrentDepotRevisionState(PerforceSCM.java:1020)
      	at hudson.plugins.perforce.PerforceSCM.compareRemoteRevisionWith(PerforceSCM.java:900)
      	at hudson.scm.SCM._compareRemoteRevisionWith(SCM.java:356)
      	at hudson.scm.SCM.poll(SCM.java:373)
      	at hudson.model.AbstractProject.poll(AbstractProject.java:1326)
      	at hudson.triggers.SCMTrigger$Runner.runPolling(SCMTrigger.java:420)
      	at hudson.triggers.SCMTrigger$Runner.run(SCMTrigger.java:449)
      	at hudson.util.SequentialExecutionQueue$QueueEntry.run(SequentialExecutionQueue.java:118)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
      	at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
      	at java.util.concurrent.FutureTask.run(Unknown Source)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      	at java.lang.Thread.run(Unknown Source)
      

      Can this be fixed please?

      Regards,
      Tom.

        Attachments

          Activity

          Hide
          rpetti Rob Petti added a comment -

          I thought it worked fine? I might be able to fix the validation, but I kinship of doubt it, since the user may be using parameters that have not yet been saved in the configuration.

          – Posted from Bugbox for Android

          Show
          rpetti Rob Petti added a comment - I thought it worked fine? I might be able to fix the validation, but I kinship of doubt it, since the user may be using parameters that have not yet been saved in the configuration. – Posted from Bugbox for Android
          Hide
          tfields Thomas Fields added a comment -

          It does work fine. It just looks odd when it throws up that warning. I don't get the same warning when i use the ${} syntax in the View mapping.

          Cheers,
          Tom.

          Show
          tfields Thomas Fields added a comment - It does work fine. It just looks odd when it throws up that warning. I don't get the same warning when i use the ${} syntax in the View mapping. Cheers, Tom.
          Hide
          rpetti Rob Petti added a comment -

          The main difference there is that the View map is not a regex. The exclude files and users options are validated by parsing the regex, which fails in this instance because the parameters are not replaced when doing so. I could attempt to replace them with the default values, but you'll still run into the situation where unsaved parameters are not replaced during validation, which will result in the same error.

          Show
          rpetti Rob Petti added a comment - The main difference there is that the View map is not a regex. The exclude files and users options are validated by parsing the regex, which fails in this instance because the parameters are not replaced when doing so. I could attempt to replace them with the default values, but you'll still run into the situation where unsaved parameters are not replaced during validation, which will result in the same error.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Rob Petti
          Path:
          src/main/java/hudson/plugins/perforce/PerforceSCM.java
          http://jenkins-ci.org/commit/perforce-plugin/106e85b309ab4d82c93656e980eb5302a70c15eb
          Log:
          [FIXED JENKINS-12202] fixed validation on exclude fields

          we're now assuming that all ${} constructs are valid variables, and thus replacing them with a dummy value before attempting to validate

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Rob Petti Path: src/main/java/hudson/plugins/perforce/PerforceSCM.java http://jenkins-ci.org/commit/perforce-plugin/106e85b309ab4d82c93656e980eb5302a70c15eb Log: [FIXED JENKINS-12202] fixed validation on exclude fields we're now assuming that all ${} constructs are valid variables, and thus replacing them with a dummy value before attempting to validate
          Hide
          dogfood dogfood added a comment -

          Integrated in plugins_perforce #174
          [FIXED JENKINS-12202] fixed validation on exclude fields (Revision 106e85b309ab4d82c93656e980eb5302a70c15eb)

          Result = SUCCESS
          Rob Petti :
          Files :

          • src/main/java/hudson/plugins/perforce/PerforceSCM.java
          Show
          dogfood dogfood added a comment - Integrated in plugins_perforce #174 [FIXED JENKINS-12202] fixed validation on exclude fields (Revision 106e85b309ab4d82c93656e980eb5302a70c15eb) Result = SUCCESS Rob Petti : Files : src/main/java/hudson/plugins/perforce/PerforceSCM.java

            People

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

              Dates

              • Created:
                Updated:
                Resolved: