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

Workspace suffix should respect hudson.slaves.WorkspaceList

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • pipeline
    • Jenkins 1.6.11
      Perforce SCM

      CpsScmFlowDefinition.create() is hard coded to append the "@script" suffix onto workspace directories (line 94 of CpsScmFlowDefinition.java).

      This suffix string should at least respect the hudson.slaves.WorkspaceList separator character, or provide some other way to change this suffix string, as the @ symbol is often treated as a special character by various tools.

      Currently, it is entirely impossible to use the workflow plugin with Perforce due to this bug, as @ is an illegal character in Perforce paths. Trying to run a hello world script using "Groovy CPS DSL from SCM" results in:

      ERROR: failed to start build
      java.lang.InterruptedException: P4: Unable to setup workspace: com.perforce.p4java.exception.RequestException: Error in client specification.
      Embedded special characters (*, %%, #, @) not allowed in 'C:\Program Files (x86)\Jenkins\jobs\<redacted>\workspace@script'.

      at org.jenkinsci.plugins.p4.tasks.AbstractTask.setWorkspace(AbstractTask.java:63)
      at org.jenkinsci.plugins.p4.PerforceScm.checkout(PerforceScm.java:277)
      at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:106)
      at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:108)
      at org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:57)
      at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:181)
      at hudson.model.ResourceController.execute(ResourceController.java:98)
      at hudson.model.Executor.run(Executor.java:374)

            jglick Jesse Glick
            sumdumgai A C
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: