-
Bug
-
Resolution: Fixed
-
Minor
-
None
-
jenkins-war:2.176.1
branch-api-plugin: 2.5.2
-
-
branch-api-2.5.3
Apparently, some of our workspaces for specific branch names are mangled in a way that the directories start with a "-" (or multiple!). This would require some special handling in scripts and we would like to avoid that.
There also have been some discussions about this special case in the now obsolete implementation in JENKINS-38706:
I had a look and it seems to happen here:
It can be tested with this small java program:
import org.apache.commons.lang3.StringUtils; public class Test { public static void main(String args[]) { int MAX_LENGTH=32; String fullName= "JIRA-1054_rename_1234_to_abcdef_try2"; String mnemonic = mnemonicOf(fullName); String path = StringUtils.right(mnemonic, MAX_LENGTH); System.out.println(path); } private static String mnemonicOf(String name) { // Do not need the complexity of NameMangler here, since we uniquify as needed. return name.replaceAll("(%[0-9A-F]{2}|[^a-zA-Z0-9-_.])+", "_"); } }
For the moment i have increased MAX_LENGTH on our jenkins, but I would really love to see this fixed in Jenkins.
jglick maybe you could have a look at it or share your opinion, as you have worked on
JENKINS-2111.