[JENKINS-41124] Can't get a human readable job name anymore · Issue #637 · jenkinsci/branch-api-plugin · GitHub
Skip to content You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert [JENKINS-41124] Can't get a human readable job name anymore #637 New issue Copy link New issue Copy link Closed Bug Closed [JENKINS-41124] Can't get a human readable job name anymore #637 Bug Copy link Labels component:branch-api-plugin imported-jira-issue priority:critical resolution:fixed Description jenkins-infra-bot opened on Jan 17, 2017 Issue body actions Since the SCM 2.0 release, I can't find a way, in a pipeline, to get a human-readable job & branch name.
For example, if I had a BitBucket team called 'Foo', a repository called 'Bar' and a branch 'feature/KEY-Baz', it used to be possible to get a nearly human readable branch - env.BRANCH_NAME would be 'Foo/Bar%2FKEY-Baz', which was easy enough to escape to a human readable form. Now, however, it's a shortened form, with numbers in it - something like 'Foo/Bar.qxyz123/feature-KEY.abcd12345ghij-Baz'. And there appears to be no way to get the human readable version.
This has broken all of my build notification templates. Here's my 'build started' notification, for example: hipchatSend color: 'YELLOW' , credentialId: 'HipChat' , message: " '${env.BUILD_URL}' >${env.JOB_NAME.replace( '%2F' , '/' )} ${env.BUILD_NUMBER} Started", notify: true , room: 'Build Server Messages' , sendAs: 'Jenkins' , server: '', v2enabled: false Originally reported by twasink , imported from: Can't get a human readable job name anymore assignee : stephenconnolly status : Closed priority : Critical component(s) : branch-api-plugin resolution : Fixed resolved : 2017-01-23T21:09:59+00:00 votes : 0 watchers : 7 imported : 20251211-141027 Raw content of original issue Since the SCM 2.0 release, I can't find a way, in a pipeline, to get a human-readable job & branch name.
For example, if I had a BitBucket team called 'Foo', a repository called 'Bar' and a branch 'feature/KEY-Baz', it used to be possible to get a nearly human readable branch - env.BRANCH_NAME would be 'Foo/Bar%2FKEY-Baz', which was easy enough to escape to a human readable form. Now, however, it's a shortened form, with numbers in it - something like 'Foo/Bar.qxyz123/feature-KEY.abcd12345ghij-Baz'. And there appears to be no way to get the human readable version.
This has broken all of my build notification templates. Here's my 'build started' notification, for example: hipchatSend color: 'YELLOW' , credentialId: 'HipChat' , message: "<a href= '${env.BUILD_URL}' >${env.JOB_NAME.replace( '%2F' , '/' )} ${env.BUILD_NUMBER}</a> Started" , notify: true , room: 'Build Server Messages' , sendAs: 'Jenkins' , server: '', v2enabled: false environment : Jenkins 2.32.1, Bitbucket Branch Source Plugin 2.0.0 Activity Next jenkins-infra-bot commented on Jan 17, 2017 jenkins-infra-bot on Jan 17, 2017 Author More actions Remote links associated with this issue: branch-api-plugin#72 cloudbees-folder-plugin#82 CloudBees Internal OSS-1879 jenkins-infra-bot commented on Jan 17, 2017 jenkins-infra-bot on Jan 17, 2017 Author More actions twasink: Original comment link Raw content of original comment: Probably similar to JENKINS-41104 Probably similar to JENKINS-41104 "> JENKINS-41104 jenkins-infra-bot commented on Jan 17, 2017 jenkins-infra-bot on Jan 17, 2017 Author More actions twasink: Original comment link Raw content of original comment: This is also breaking my use of the S3BucketPublisher - It used to publish to S3 with a path prefix of (using the above) 'Foo/Bar/feature%2FBaz'.
It now publishes with 'Foo/Bar.qxyz123/feature-KEY.abcd12345ghij-Baz'. I could probably live with the suffix on the project name (though that sucks, it is at least consistent), but the mangling of the branch name is horrible, as it's non-deterministic. At this point, I'm about to rollback to my backup and stick with the v1.0 version; notification templates were painful, but this is a problem that completely breaks my ops infrastructure.
This is also breaking my use of the S3BucketPublisher - It used to publish to S3 with a path prefix of (using the above) 'Foo/Bar/feature%2FBaz'. It now publishes with 'Foo/Bar.qxyz123/feature-KEY.abcd12345ghij-Baz'. I could probably live with the suffix on the project name (though that sucks, it is at least consistent), but the mangling of the branch name is horrible, as it's non-deterministic. At this point, I'm about to rollback to my backup and stick with the v1.0 version; notification templates were painful, but this is a problem that completely breaks my ops infrastructure. jenkins-infra-bot commented on Jan 17, 2017 jenkins-infra-bot on Jan 17, 2017 Author More actions twasink: Original comment link Raw content of original comment: I know the mangling of the paths is there to ensure uniqueness - but it's causing problems for me like crazy.
An option to disable it would help a lot. I know the mangling of the paths is there to ensure uniqueness - but it's causing problems for me like crazy. An option to disable it would help a lot. jenkins-infra-bot commented on Jan 17, 2017 jenkins-infra-bot on Jan 17, 2017 Author More actions stephenconnolly: Original comment link Raw content of original comment: env.BRANCH_NAME should now be the plain unmangled name env.BRANCH_NAME should now be the plain unmangled name jenkins-infra-bot commented on Jan 17, 2017 jenkins-infra-bot on Jan 17, 2017 Author More actions jamesdumay: Original comment link Raw content of original comment: This should be BLOCKER.
We can't go about breaking peoples URLs. This should be BLOCKER. We can't go about breaking peoples URLs. jenkins-infra-bot commented on Jan 17, 2017 jenkins-infra-bot on Jan 17, 2017 Author More actions twasink: Original comment link Raw content of original comment: What about the job name? Is there a way to get an unmangled form of that? What about the job name? Is there a way to get an unmangled form of that? jenkins-infra-bot commented on Jan 17, 2017 jenkins-infra-bot on Jan 17, 2017 Author More actions twasink: Original comment link Raw content of original comment: The S3BucketPublisher, BTW, uses run.getParent().getFullName(); to determine the prefix.
If I can get an unmangled job name, I can do my own S3 uploads, but if I want to keep using this plugin, I need a way to make the parent's full name to be unmangled. The S3BucketPublisher, BTW, uses run.getParent().getFullName(); to determine the prefix. If I can get an unmangled job name, I can do my own S3 uploads, but if I want to keep using this plugin, I need a way to make the parent's full name to be unmangled. jenkins-infra-bot commented on Jan 17, 2017 jenkins-infra-bot on Jan 17, 2017 Author More actions recampbell: Original comment link Raw content of original comment: The impact of this issue is that previously users expected to be able to construct the expected URL on their own, but now it is generated using a non-transparent algorithm.
Mic says he's had 10 people in the last 24 hours mentioned that they are surprised by the new URL scheme. For example, here is a new URL: https://ci.blueocean.io/blue/organizations/jenkins/blueocean/detail/feature-J.hunjes6l7b7p.om-github/5/pipeline/ Which is not love-able. There is also external tooling which depends on this structure. The impact of this issue is that previously users expected to be able to construct the expected URL on their own, but now it is generated using a non-transparent algorithm.
Mic says he's had 10 people in the last 24 hours mentioned that they are surprised by the new URL scheme. For example, here is a new URL: https://ci.blueocean.io/blue/organizations/jenkins/blueocean/detail/feature-J.hunjes6l7b7p.om-github/5/pipeline/ Which is not love-able. There is also external tooling which depends on this structure. jenkins-infra-bot commented on Jan 17, 2017 jenkins-infra-bot on Jan 17, 2017 Aut
The rest of this page is on the live site.