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

Display Pull Request Name instead of ID in the UI

      Currently, in the UI, the Pull Request (PR) ID is displayed as the job name (example: PR-3), and when you mouse hover over the PR ID then the PR name pops up in a tool-tip label. This should be reversed, the job name should be named after the Pull Request name, not the ID, and the tool-tip should pop up showing the PR ID. The PR name appearing in the UI is much more important than the PR ID, and showing the PR name as the Jenkins job name is much more valuable to the user. Alternatively, the UI can display "{PR-ID} - {PR-NAME}" as the job name.

      Note: The job ID itself can remain as the PR ID (what appears in the URL), it's just what appears in the UI to the user that's important, the "display name" for the job name should be the PR name, or at least have the PR name as part of the human-readable label.

          [JENKINS-55348] Display Pull Request Name instead of ID in the UI

          The Pull Request name can be really long and although less UX friendly, it's more UI friendly.

          Radek Antoniuk added a comment - The Pull Request name can be really long and although less UX friendly, it's more UI friendly.

          Alan Czajkowski added a comment - - edited

          warden If the Pull Request name is very long then there are very easy styling tricks to truncate the name on the UI. You can either use CSS to elegantly truncate the the long line or do a hard-truncate when passing the name to the UI and then adding ellipses (...) to the end of the name. Either way, almost nobody knows what their PR ID is, and they are looking for their PR name in the list – it actually takes some effort to find the PR ID on most Git UIs (GitHub, Bitbucket, etc.).

          Alan Czajkowski added a comment - - edited warden If the Pull Request name is very long then there are very easy styling tricks to truncate the name on the UI. You can either use CSS to elegantly truncate the the long line or do a hard-truncate when passing the name to the UI and then adding ellipses (...) to the end of the name. Either way, almost nobody knows what their PR ID is, and they are looking for their PR name in the list – it actually takes some effort to find the PR ID on most Git UIs (GitHub, Bitbucket, etc.).

          We were injecting a custom CSS rule to achieve that:

          #projectstatus a[title]::after {
          	content: " (" attr(title) ") ";
          } 

          But we are still unhappy about the state as you can't find PR branches when you use the Jenkins search as this is just a visual fix

          Philipp Abraham added a comment - We were injecting a custom CSS rule to achieve that: #projectstatus a[title]::after { content: " (" attr(title) ") " ; } But we are still unhappy about the state as you can't find PR branches when you use the Jenkins search as this is just a visual fix

          any ETA on this? it's a very easy fix, it's just a small UI change (the job name/id does not change)

          Alan Czajkowski added a comment - any ETA on this? it's a very easy fix, it's just a small UI change (the job name/id does not change)

          Pay Bas added a comment - - edited

          Just attached a screenshot to show how silly this problem is. It prohibits easy use of monitoring because most information is lost. Nobody knows what PR-1360 means and which branch or PR-name it refers to.

          Pay Bas added a comment - - edited Just attached a screenshot to show how silly this problem is. It prohibits easy use of monitoring because most information is lost. Nobody knows what PR-1360 means and which branch or PR-name it refers to.

          Alan Czajkowski added a comment - - edited

          Attaching another screenshot example:

          The Jenkins UI shows "PR-20" but nobody really knows what that is, showing the PR name is much more valuable. And the PR name is already available to the UI because when you hover your mouse over the hyperlink, the tooltip popup shows the PR name. The UI should flip that display experience, the hyperlink text should be the PR name, and when you hover the mouse over the text, the tooltip popup should show the PR ID.

          Alan Czajkowski added a comment - - edited Attaching another screenshot example: The Jenkins UI shows "PR-20" but nobody really knows what that is, showing the PR name is much more valuable. And the PR name is already available to the UI because when you hover your mouse over the hyperlink, the tooltip popup shows the PR name. The UI should flip that display experience, the hyperlink text should be the PR name, and when you hover the mouse over the text, the tooltip popup should show the PR ID.

          Pay Bas added a comment -

          Perhaps better than changing the current behavior, a new SCMSourceTrait could be added for "changing PR display names". Perhaps using something like the https://plugins.jenkins.io/token-macro behavior, so we could enter a string like:

          "PR-${pullRequestId}"  or  "PR-${pullRequestId} | ${branchName}"  or  "PR-${pullRequestId} = ${pullRequestName}"

          Pay Bas added a comment - Perhaps better than changing the current behavior, a new SCMSourceTrait could be added for "changing PR display names". Perhaps using something like the https://plugins.jenkins.io/token-macro behavior, so we could enter a string like: "PR-${pullRequestId}"   or  "PR-${pullRequestId} | ${branchName}"   or  "PR-${pullRequestId} = ${pullRequestName}"

          Pay Bas added a comment -

          This is the Trait that I created. Working well. Going on holiday soon so a colleague of mine will probably finish it and create a PR.

           

           

          Pay Bas added a comment - This is the Trait that I created. Working well. Going on holiday soon so a colleague of mine will probably finish it and create a PR.    

          Unrelated to the solution posted above, but trying to solve the same problem: https://github.com/jenkinsci/branch-api-plugin/pull/254

          Ing. Christoph Obexer added a comment - Unrelated to the solution posted above, but trying to solve the same problem: https://github.com/jenkinsci/branch-api-plugin/pull/254

          rsandell could you take a look?

          Ing. Christoph Obexer added a comment - rsandell could you take a look?

          Hanns Hartman added a comment -

          Is there any update on when this might get done or if there is a work around?

          Hanns Hartman added a comment - Is there any update on when this might get done or if there is a work around?

          paybas rsandell is anybody looking at this?

          Alan Czajkowski added a comment - paybas rsandell is anybody looking at this?

          I created a pull request based on cobexer's dev that adds a test.

          Can somebody have a look?

          Cyprien Quilici added a comment - I created a pull request based on cobexer 's dev that adds a test. Can somebody have a look?

          when can we expect this to be released?

          Alan Czajkowski added a comment - when can we expect this to be released?

          Kalle Niemitalo added a comment - - edited

          AFAICT, this was released in Branch API 2.1105.v472604208c55. It works in multibranch projects, with the following caveats:

          • The branch source plugin must add an ObjectMetadataAction with the title of the pull request in it. The Bitbucket Branch Source plugin does so, and I think the GitHub Branch Source, GitLab Branch Source, Gitea, Gerrit Code Review, and P4 plugins also do so; but the Bitbucket Server Integration plugin doesn't.
          • The new feature is not automatically activated in multibranch projects. You have to configure the branch source of the multibranch project and add "Job display name strategy". You can then select a strategy from the dropdown list: either "Job display name with fallback to name" or "Name and, if available, display name" (default). Neither of those strategies corresponds to what happens if you don't add "Job display name strategy" at all.
            (The help text for this setting does not match the dropdown list and instead calls those strategies "Object display name" and "Raw and object display name".)
          • If you choose "Job display name with fallback to name", then you lose the ability to sort pull requests by ID.

          Kalle Niemitalo added a comment - - edited AFAICT, this was released in Branch API 2.1105.v472604208c55. It works in multibranch projects, with the following caveats: The branch source plugin must add an ObjectMetadataAction with the title of the pull request in it. The Bitbucket Branch Source plugin does so, and I think the GitHub Branch Source , GitLab Branch Source , Gitea , Gerrit Code Review , and P4 plugins also do so; but the Bitbucket Server Integration plugin doesn't. The new feature is not automatically activated in multibranch projects. You have to configure the branch source of the multibranch project and add "Job display name strategy". You can then select a strategy from the dropdown list: either "Job display name with fallback to name" or "Name and, if available, display name" (default). Neither of those strategies corresponds to what happens if you don't add "Job display name strategy" at all. (The help text for this setting does not match the dropdown list and instead calls those strategies "Object display name" and "Raw and object display name".) If you choose "Job display name with fallback to name", then you lose the ability to sort pull requests by ID.

          I opened another PR to fix the mistakes of the previous one: https://github.com/jenkinsci/branch-api-plugin/pull/382

          If anyone's available for a review that'd be great.

          Cyprien Quilici added a comment - I opened another PR to fix the mistakes of the previous one: https://github.com/jenkinsci/branch-api-plugin/pull/382 If anyone's available for a review that'd be great.

          Thanks quilicicf
          Is anybody available to review this PR?

          Alan Czajkowski added a comment - Thanks quilicicf Is anybody available to review this PR?

            rsandell rsandell
            alan_czajkowski Alan Czajkowski
            Votes:
            13 Vote for this issue
            Watchers:
            14 Start watching this issue

              Created:
              Updated:
              Resolved: