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

A link in a build description gets truncated in the Job view with ellipses.

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • Jenkins 2.426.1
      Markdown Formatter 95.v17a_965e696ee

      When using the markdown plugin, a markdown link is properly rendered in the build view. However, while viewing the same build in the Job view, the markdown link gets truncated with ellipses.

      This is not an issue while using Safe HTML.

      Controller using Safe HTML

      • Select a build (e.g. #5)
      • Edit Build Information link (left)
        Description:
        <b>Commit</b>: [<a href="https://MY_BB_HOST/bitbucket/projects/MY_PROJECT/repos/MY_REPO/commits/0123456789abcdef0123456789abcdef01234567">abc123d</a>] 
      • Save button
      • OBSERVE: build #5 shows clickable link:
        Commit: [abc123d]   // this IS a clickable link
      • Navigate back to job
      • OBSERVE: list of jobs, build #5 shows clickable link:
        Commit: [abc123d]   // this IS a clickable link

      Controller using markdown

      • Select a build (e.g. #5)
      • Edit Build Information link (left) or Add Description button
      • Description:
        __Commit__: [abc123d}(https://MY_BB_HOST/bitbucket/projects/MY_PROJECT/repos/MY_REPO/commits/0123456789abcdef0123456789abcdef01234567)] 
      • Save button
      • OBSERVE: build # 5 shows clickable link:
        Commit: [abc123d]   // this IS a clickable link 
      • Navigate back to job 
      • OBSERVE: list of jobs, build #5 shows:
        Commit:... //NOT a clickable or readable link 
      • Hypothesis: It appears that the plugin truncates the Commit string based on actual length rather than rendered length.
      • Workaround: Just use the commit prefix string WITHOUT the link. (But... I like the link.)
      • Other markdown (e.g. bold) for short strings appears to work as expected in both build and job views.

      FWIW, I find adding a Commit link to the build from the pipeline EXTREMELY useful if I am quickly iterating. I find myself being impatient and smashing build button shortly after pushing a change. This quick look allows me to see the commit version without having to click into the job. Only caveat is my sample only shows last commit version, but good enough for my use.

      Pipeline snippet: somewhere in an early stage... before things start to break

      script{
          ...
          env.REPO_URL_COMMITS = "https://MY_BB.com/bitbucket/projects/MY_PROJECT/repos/MY_REPO/commits" // only shown here for example, I will usually set in environment{} block 
      
          env.COMMIT_URL_MD = "[Commit ${GIT_COMMIT[0..6]}](${REPO_URL_COMMITS}/${GIT_COMMIT})"   // truncates commit version to 7 characters for display text
          currentBuild.description = "${COMMIT_URL_MD}" // add commit URL to build description
          //OPTIONAL: add useful debug/iterate comments to description (note the double trailing spaces for linefeeds) 
          //currentBuild.description = "${COMMIT_URL_MD}  \n${MY_CUSTOM_MESSAGE}  \n  \n---" 
          ...
      }    

          [JENKINS-72916] A link in a build description gets truncated in the Job view with ellipses.

          Mike Butterfield created issue -
          Mike Butterfield made changes -
          Description Original: When using the markdown plugin, a markdown link is properly rendered in the _build_ view. However, while viewing the same build in the _Job_ view, the markdown link gets truncated with ellipses.

          This is not an issue while using Safe HTML.

          *Controller using Safe HTML*
           * Select a build (e.g. #5)
           * Edit Build Information link (left)
          Description:

          {code:java}
          <b>Commit</b>: [<a href="https://MY_BB_HOST/bitbucket/projects/MY_PROJECT/repos/MY_REPO/commits/0123456789abcdef0123456789abcdef01234567">abc123d</a>]{code}

           * Save button
           * OBSERVE: build #5 shows clickable link:

          {code:java}
          Commit: [abc123d]   // this IS a clickable link{code}

           * Navigate back to job
           * OBSERVE: list of jobs, build #5 shows clickable link:

          {code:java}
          Commit: [abc123d]   // this IS a clickable link{code}

          *Controller using markdown*
           * Select a build (e.g. #5)
           * Edit Build Information link (left) or Add Description button
           * Description:

          {code:java}
          __Commit__: [<a href="https://MY_BB_HOST/bitbucket/projects/MY_PROJECT/repos/MY_REPO/commits/0123456789abcdef0123456789abcdef01234567">abc123d</a>]{code}

           * Save button
           * OBSERVE: build # 5 shows clickable link:
          {code:java}
          Commit: [abc123d]   // this IS a clickable link {code}

           * Navigate back to job 
           * OBSERVE: list of jobs, build #5 shows:
          {code:java}
          Commit:... //NOT a clickable link {code}

           * Hypothesis: It appears that the plugin truncates the Commit string based on actual length rather than rendered length.
           * Workaround: Just use the commit prefix string WITHOUT the link. (But... I like the link.)
           * Other markdown (e.g. bold) for short strings appears to work as expected in both build and job views.

          FWIW, I find adding a Commit link to the build from the pipeline EXTREMELY useful if I am quickly iterating. I find myself being impatient and smashing build button shortly after pushing a change. This quick look allows me to see the commit version without having to click into the job. Only caveat is my sample only shows _last_ commit version, but good enough for my use.

          Pipeline snippet: somewhere in an early stage... before things start to break ;-)
          {code:java}
          script{
              ...
              env.REPO_URL_COMMITS = "https://MY_BB.com/bitbucket/projects/MY_PROJECT/repos/MY_REPO/commits" // only shown here for example, I will usually set in environment{} block 

              env.COMMIT_URL_MD = "[Commit ${GIT_COMMIT[0..6]}](${REPO_URL_COMMITS}/${GIT_COMMIT})"   // truncates commit version to 7 characters for display text
              currentBuild.description = "${COMMIT_URL_MD}" // add commit URL to build description
              //OPTIONAL: add useful debug/iterate comments to description (note the double trailing spaces for linefeeds)
              //currentBuild.description = "${COMMIT_URL_MD}  \n${MY_CUSTOM_MESSAGE}  \n  \n---"
              ...
          }   
          ... 
           {code}
          New: When using the markdown plugin, a markdown link is properly rendered in the _build_ view. However, while viewing the same build in the _Job_ view, the markdown link gets truncated with ellipses.

          This is not an issue while using Safe HTML.

          *Controller using Safe HTML*
           * Select a build (e.g. #5)
           * Edit Build Information link (left)
          Description:
          {code:java}
          <b>Commit</b>: [<a href="https://MY_BB_HOST/bitbucket/projects/MY_PROJECT/repos/MY_REPO/commits/0123456789abcdef0123456789abcdef01234567">abc123d</a>] {code}

           * Save button
           * OBSERVE: build #5 shows clickable link:
          {code:java}
          Commit: [abc123d]   // this IS a clickable link{code}

           * Navigate back to job
           * OBSERVE: list of jobs, build #5 shows clickable link:
          {code:java}
          Commit: [abc123d]   // this IS a clickable link{code}

          *Controller using markdown*
           * Select a build (e.g. #5)
           * Edit Build Information link (left) or Add Description button
           * Description:
          {code:java}
          __Commit__: [abc123d}(https://MY_BB_HOST/bitbucket/projects/MY_PROJECT/repos/MY_REPO/commits/0123456789abcdef0123456789abcdef01234567)] {code}

           * Save button
           * OBSERVE: build # 5 shows clickable link:
          {code:java}
          Commit: [abc123d]   // this IS a clickable link {code}

           * Navigate back to job 
           * OBSERVE: list of jobs, build #5 shows:
          {code:java}
          Commit:... //NOT a clickable or readable link {code}

           * Hypothesis: It appears that the plugin truncates the Commit string based on actual length rather than rendered length.
           * Workaround: Just use the commit prefix string WITHOUT the link. (But... I like the link.)
           * Other markdown (e.g. bold) for short strings appears to work as expected in both build and job views.



          FWIW, I find adding a Commit link to the build from the pipeline EXTREMELY useful if I am quickly iterating. I find myself being impatient and smashing build button shortly after pushing a change. This quick look allows me to see the commit version without having to click into the job. Only caveat is my sample only shows _last_ commit version, but good enough for my use.

          {*}Pipeline snippet{*}: somewhere in an early stage... before things start to break ;)
          {code:java}
          script{
              ...
              env.REPO_URL_COMMITS = "https://MY_BB.com/bitbucket/projects/MY_PROJECT/repos/MY_REPO/commits" // only shown here for example, I will usually set in environment{} block 

              env.COMMIT_URL_MD = "[Commit ${GIT_COMMIT[0..6]}](${REPO_URL_COMMITS}/${GIT_COMMIT})"   // truncates commit version to 7 characters for display text
              currentBuild.description = "${COMMIT_URL_MD}" // add commit URL to build description
              //OPTIONAL: add useful debug/iterate comments to description (note the double trailing spaces for linefeeds)
              //currentBuild.description = "${COMMIT_URL_MD}  \n${MY_CUSTOM_MESSAGE}  \n  \n---"
              ...
          }    {code}
          Mark Waite made changes -
          Attachment New: job-vew-truncated-with-safe-html.png [ 62359 ]
          Mark Waite made changes -
          Mark Waite made changes -
          Mark Waite made changes -
          Attachment New: job-view-truncated-with-markdown-formatter-1.png [ 62362 ]

          Mark Waite added a comment - - edited

          I'm seeing truncation of build description by both the safe HTML formatter and the markdown formatter when displaying in the job view. I believe that is an intentional choice by Jenkins core to not overrun the table in the job view.

          Safe HTML job view truncated

          Markdown job view truncated

          Safe HTML build view not truncated

          Markfown build view not truncated

          Mark Waite added a comment - - edited I'm seeing truncation of build description by both the safe HTML formatter and the markdown formatter when displaying in the job view. I believe that is an intentional choice by Jenkins core to not overrun the table in the job view. Safe HTML job view truncated Markdown job view truncated Safe HTML build view not truncated Markfown build view not truncated
          Mark Waite made changes -
          Attachment Original: job-view-truncated-with-markdown-formatter-1.png [ 62362 ]
          Mark Waite made changes -

          Mike Butterfield added a comment - - edited

          While in the job view, the build description gets truncated with ellipses after 98 or 99 characters of the string itself, and not the 'rendered/display' length for the following examples. 

          [JENKINS-72916](https://issues.jenkins.io/browse/JENKINS-72916) display: JENKINS-72916 (clickable link)
          
          __Commit__: [[1234567(https://BB_HOST/bitbucket/projects/PROJECT/repos/REPO/commits/123456789012)], length: 99, display: Commit: [1234567] (clickable link)
          
          __Commit__: [[1234567](https://BB_HOST/bitbucket/projects/PROJECT/repos/REPO/commits/1234567890123)], length: 100, display: Commit:...  (NOT clickable)
          
          012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678, length: 98, NOT truncated 
          
          0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789, length: 99, truncated with ellipses 

          The Commit URL that initiated this ticket will routinely exceed this length.

          (Apologies for edits due to failed cut-and-paste attempts)

          Mike Butterfield added a comment - - edited While in the job view, the build description gets truncated with ellipses after 98 or 99 characters of the string itself, and not the 'rendered/display' length for the following examples.  [JENKINS-72916](https: //issues.jenkins.io/browse/JENKINS-72916) display: JENKINS-72916 (clickable link) __Commit__: [[1234567(https: //BB_HOST/bitbucket/projects/PROJECT/repos/REPO/commits/123456789012)], length: 99, display: Commit: [1234567] (clickable link) __Commit__: [[1234567](https: //BB_HOST/bitbucket/projects/PROJECT/repos/REPO/commits/1234567890123)], length: 100, display: Commit:...  (NOT clickable) 012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678, length: 98, NOT truncated  0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789, length: 99, truncated with ellipses The Commit URL that initiated this ticket will routinely exceed this length. (Apologies for edits due to failed cut-and-paste attempts)

            Unassigned Unassigned
            mb_austex Mike Butterfield
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: