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

Can't get a human readable job name anymore

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Critical
    • Resolution: Fixed
    • Component/s: branch-api-plugin
    • Labels:
      None
    • Environment:
      Jenkins 2.32.1, Bitbucket Branch Source Plugin 2.0.0
    • Similar Issues:

      Description

      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
      

        Attachments

          Activity

          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Stephen Connolly
          Path:
          src/main/java/jenkins/branch/MultiBranchProjectFactory.java
          src/main/java/jenkins/branch/NameEncoder.java
          src/test/java/integration/BrandingTest.java
          src/test/java/integration/MigrationTest.java
          src/test/java/jenkins/branch/WorkspaceLocatorImplTest.java
          http://jenkins-ci.org/commit/branch-api-plugin/32c5aba1102a2a8928a1decc17c1170bec0e2845
          Log:
          JENKINS-41124 Address code review comments

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Stephen Connolly Path: src/main/java/jenkins/branch/MultiBranchProjectFactory.java src/main/java/jenkins/branch/NameEncoder.java src/test/java/integration/BrandingTest.java src/test/java/integration/MigrationTest.java src/test/java/jenkins/branch/WorkspaceLocatorImplTest.java http://jenkins-ci.org/commit/branch-api-plugin/32c5aba1102a2a8928a1decc17c1170bec0e2845 Log: JENKINS-41124 Address code review comments
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Stephen Connolly
          Path:
          src/main/java/jenkins/branch/MultiBranchProjectFactory.java
          http://jenkins-ci.org/commit/branch-api-plugin/091997f77adfa37704f83584f153776a2a239cd7
          Log:
          JENKINS-41124 Typo in javadoc

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Stephen Connolly Path: src/main/java/jenkins/branch/MultiBranchProjectFactory.java http://jenkins-ci.org/commit/branch-api-plugin/091997f77adfa37704f83584f153776a2a239cd7 Log: JENKINS-41124 Typo in javadoc
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Stephen Connolly
          Path:
          pom.xml
          src/main/java/jenkins/branch/Branch.java
          src/main/java/jenkins/branch/MultiBranchProject.java
          src/main/java/jenkins/branch/MultiBranchProjectDescriptor.java
          src/main/java/jenkins/branch/MultiBranchProjectFactory.java
          src/main/java/jenkins/branch/NameEncoder.java
          src/main/java/jenkins/branch/OrganizationFolder.java
          src/test/java/integration/EventsTest.java
          src/test/java/integration/MigrationTest.java
          src/test/java/integration/harness/BasicMultiBranchProjectFactory.java
          src/test/java/jenkins/branch/WorkspaceLocatorImplTest.java
          src/test/resources/integration/MigrationTest/nameMangling_2.zip
          src/test/resources/integration/MigrationTest/nameMangling_2_folder_reload.zip
          src/test/resources/integration/MigrationTest/nameMangling_2_full_reload.zip
          src/test/resources/integration/MigrationTest/nameMangling_folder_reload.zip
          src/test/resources/integration/MigrationTest/nameMangling_full_reload.zip
          http://jenkins-ci.org/commit/branch-api-plugin/05030c1c0a5a0811c562785d209698c22aee5a86
          Log:
          Merge pull request #72 from stephenc/jenkins-41124

          JENKINS-41124 Move name mangling support responsibility to AbstractFolder

          Compare: https://github.com/jenkinsci/branch-api-plugin/compare/228cd1a7209e...05030c1c0a5a

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Stephen Connolly Path: pom.xml src/main/java/jenkins/branch/Branch.java src/main/java/jenkins/branch/MultiBranchProject.java src/main/java/jenkins/branch/MultiBranchProjectDescriptor.java src/main/java/jenkins/branch/MultiBranchProjectFactory.java src/main/java/jenkins/branch/NameEncoder.java src/main/java/jenkins/branch/OrganizationFolder.java src/test/java/integration/EventsTest.java src/test/java/integration/MigrationTest.java src/test/java/integration/harness/BasicMultiBranchProjectFactory.java src/test/java/jenkins/branch/WorkspaceLocatorImplTest.java src/test/resources/integration/MigrationTest/nameMangling_2.zip src/test/resources/integration/MigrationTest/nameMangling_2_folder_reload.zip src/test/resources/integration/MigrationTest/nameMangling_2_full_reload.zip src/test/resources/integration/MigrationTest/nameMangling_folder_reload.zip src/test/resources/integration/MigrationTest/nameMangling_full_reload.zip http://jenkins-ci.org/commit/branch-api-plugin/05030c1c0a5a0811c562785d209698c22aee5a86 Log: Merge pull request #72 from stephenc/jenkins-41124 JENKINS-41124 Move name mangling support responsibility to AbstractFolder Compare: https://github.com/jenkinsci/branch-api-plugin/compare/228cd1a7209e...05030c1c0a5a
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Stephen Connolly
          Path:
          pom.xml
          src/main/java/jenkins/branch/MultiBranchProject.java
          http://jenkins-ci.org/commit/branch-api-plugin/93e7fa149036ef63842924b5a3514209747efdc7
          Log:
          JENKINS-41124 Post-merge tidy up and pick up cloudbees-folder 5.17-beta-1

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Stephen Connolly Path: pom.xml src/main/java/jenkins/branch/MultiBranchProject.java http://jenkins-ci.org/commit/branch-api-plugin/93e7fa149036ef63842924b5a3514209747efdc7 Log: JENKINS-41124 Post-merge tidy up and pick up cloudbees-folder 5.17-beta-1
          Hide
          stephenconnolly Stephen Connolly added a comment -

          scm-api-2.0.2
          git-2.6.4 or git-3.0.4
          branch-api-2.0.2
          bitbucket-branch-source-2.0.2
          github-branch-source-2.0.1
          cloudbees-folder-5.17
          workflow-multibranch-2.11

          Show
          stephenconnolly Stephen Connolly added a comment - scm-api-2.0.2 git-2.6.4 or git-3.0.4 branch-api-2.0.2 bitbucket-branch-source-2.0.2 github-branch-source-2.0.1 cloudbees-folder-5.17 workflow-multibranch-2.11

            People

            • Assignee:
              stephenconnolly Stephen Connolly
              Reporter:
              twasink Robert Watkins
            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: