Daniel Beck commented on Bug JENKINS-25346

@Daniel, getWorkspaceFor() accepts only an implementation of TopLevelItem, so this will work in case of a free style project, what about other cases ? I tried Jenkins javadoc for some time but I couldn't get a clue.

All projects generally are top-level items. It won't cover matrix axes and similar cases though, where project types divide their workspaces further.

What you could try is to determine the TopLevelItem ancestor of the current build's project, and get the workspace of that on the current node (e.g. /jenkins/workspace/foo). If that's a prefix of the current actual workspace (/jenkins/workspace/foo/bar/baz), just append the rest (/bar/baz) to the workspace path on master

It seems to me that the design of this feature is broken if you need to know about details like that, and an approximation and/or specifically adding support for job types is the best you can do.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira

--
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to