jenkinsci / plasticscm-plugin

A plugin for Jenkins to be able to use Plastic SCM
MIT License
16 stars 31 forks source link

Fixed workspace path when controller's OS differs from the agent's #55

Closed juliomaqueda closed 2 years ago

juliomaqueda commented 2 years ago

The initialization of a Workspace object uses the directory path obtained from the cm command cm workspace list --format={wkname}#{path}#{wkid}, whose format depends on the operative system of the node executing the build. That path is then used to build the internal field FilePath, representing the actual path of the workspace (either local or remote).

However, the FilePath object was constructed with a bare new File(path), and since the class File only covers local files, the resulting FilePath pointed to a path based on the controller's OS.

In a scenario where the controller runs on Windows and the agent on Linux/Mac, the workspace path is miscalculated, affecting subsequent cm commands where the workspace path is used.