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

Workspace suffix should respect hudson.slaves.WorkspaceList

    XMLWordPrintable

Details

    Description

      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)

      Attachments

        Activity

          sumdumgai A C created issue -
          jglick Jesse Glick made changes -
          Field Original Value New Value
          Labels perforce workflow workspace perforce workspace
          jglick Jesse Glick made changes -
          Priority Blocker [ 1 ] Major [ 3 ]
          scm_issue_link SCM/JIRA link daemon made changes -
          Resolution Fixed [ 1 ]
          Status Open [ 1 ] Resolved [ 5 ]
          rtyler R. Tyler Croy made changes -
          Workflow JNJira [ 162897 ] JNJira + In-Review [ 197067 ]
          abayer Andrew Bayer made changes -
          Component/s pipeline-general [ 21692 ]
          abayer Andrew Bayer made changes -
          Component/s workflow-plugin [ 18820 ]

          People

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

            Dates

              Created:
              Updated:
              Resolved: