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

Multiple ShortText created by Badge plugin failed to wrapped in build history pane

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: badge-plugin
    • Labels:
      None
    • Environment:
      Centos7, Jenkins 2.121.1, Badge 1.5
    • Similar Issues:
    • Released As:
      1.6

      Description

      An earlier instance of Jenkins running on 2.89.4 with Badge 1.2 was running fine. Multiple ShortText labels created from Badge plugin via Groovy PostBuild wrapped nicely in the Build History pane in multi-line.

       

      The ShortText labels are used to bring out important build parameters. Thus, this issue had caused a major lost of functionality.

       

      A new instance of Jenkins server with 2.121.1 and Badge 1.5 rendered the ShortText labels in a single line in the Build History pane.

       

      Comparing the rendered html showed that the rendered html in the new Jenkins is using single-line class and the text label has "display:inline;" added to its style. Manually reverting both solved the issue.

       

      <tr page-entry-id="-9223372036854775797" class="build-row single-line overflow-checked"><td class="build-row-cell"><div class="pane build-name" style="height: 21px;"><div class="build-icon"><a href="/job/jason.staging/11/console" class="build-status-link"><img src="/static/47928b75/images/16x16/blue.png" alt="Success > Console Output" tooltip="Success > Console Output" style="width: 16px; height: 16px; " class="icon-blue icon-sm" title="Success > Console Output"></a></div><a update-parent-class=".build-row" href="/job/jason.staging/11/" class="tip model-link inside build-link display-name zws-inserted">#1​1 </a></div><div time="1530355732848" class="pane build-details" style="height: 21px;"><a update-parent-class=".build-row" href="/job/jason.staging/11/" class="tip model-link inside build-link">Jun 30, 2018 6:48 PM</a></div><div class="pane build-controls"><div class="middle-align build-badge" style="width: 100%;"> <span style="_display:inline;_padding:1px;border:1px solid #C0C000;margin:0px;background:#FFFF00;color:#000000">awwwwwaa</span>

      ... truncated....

       

       

        Attachments

        1. badge.hpi
          51 kB
        2. html corrected.jpg
          html corrected.jpg
          71 kB
        3. misaligned.jpg
          misaligned.jpg
          35 kB

          Activity

          Hide
          bakito Marc Brugger added a comment -

          Can you please provide more information (attached html, screenshot, ...) to allow me to verify your issue.

          Show
          bakito Marc Brugger added a comment - Can you please provide more information (attached html, screenshot, ...) to allow me to verify your issue.
          Hide
          jasoner Jason Er added a comment -

          Please see the good case and the bad case attached.

          Show
          jasoner Jason Er added a comment - Please see the good case and the bad case attached.
          Hide
          jasoner Jason Er added a comment -

          corrected html

          <tr page-entry-id="-9223372036854775797" class="build-row multi-line overflow-checked"><td class="build-row-cell"><div class="pane build-name" style="height: 21px;"><div class="build-icon"><a href="/job/jason.staging/11/console" class="build-status-link"><img src="/static/47928b75/images/16x16/blue.png" alt="Success > Console Output" tooltip="Success > Console Output" style="width: 16px; height: 16px; " class="icon-blue icon-sm" title="Success > Console Output"></a></div><a update-parent-class=".build-row" href="/job/jason.staging/11/" class="tip model-link inside build-link display-name zws-inserted">#1​1 </a></div><div time="1530355732848" class="pane build-details block indent-multiline" style="height: 21px;"><a update-parent-class=".build-row" href="/job/jason.staging/11/" class="tip model-link inside build-link">Jun 30, 2018 6:48 PM</a></div><div class="pane build-controls block indent-multiline"><div class="middle-align build-badge" style="width: 100%;"> <span style="padding:1px;border:1px solid #C0C000;margin:0px;background:#FFFF00;color:#000000">awwwwwaa</span>

          Show
          jasoner Jason Er added a comment - corrected html <tr page-entry-id="-9223372036854775797" class="build-row multi-line overflow-checked"><td class="build-row-cell"><div class="pane build-name" style="height: 21px;"><div class="build-icon"><a href="/job/jason.staging/11/console" class="build-status-link"><img src="/static/47928b75/images/16x16/blue.png" alt="Success > Console Output" tooltip="Success > Console Output" style="width: 16px; height: 16px; " class="icon-blue icon-sm" title="Success > Console Output"></a></div><a update-parent-class=".build-row" href="/job/jason.staging/11/" class="tip model-link inside build-link display-name zws-inserted">#1​1 </a></div><div time="1530355732848" class="pane build-details block indent-multiline " style="height: 21px;"><a update-parent-class=".build-row" href="/job/jason.staging/11/" class="tip model-link inside build-link">Jun 30, 2018 6:48 PM</a></div><div class="pane build-controls block indent-multiline "><div class="middle-align build-badge" style="width: 100%;"> <span style="padding:1px;border:1px solid #C0C000;margin:0px;background:#FFFF00;color:#000000">awwwwwaa</span>
          Hide
          bakito Marc Brugger added a comment - - edited

          I'm not able to reproduce your issue.

          The jenkins version I've checked with is 2.121.1, the same that you are using.

          When I run this pipeline, everything looks fine

          node() {
            addBadge( text:"badge from Jenkins")
            addBadge( text:"badge from Jenkins")
            addBadge( text:"badge from Jenkins")
            addBadge( text:"badge from Jenkins")
            addBadge( text:"badge from Jenkins")
            addBadge( text:"badge from Jenkins")
          }

           

          Can you please provide me your pipeline script?

           

          By the way, the style class 'build-row single-line' comes not from the bage plugin. The plugin does not have control over that style.

          The code that is from the plugin is just

          <span style="display:inline; ...

           

          Show
          bakito Marc Brugger added a comment - - edited I'm not able to reproduce your issue. The jenkins version I've checked with is 2.121.1, the same that you are using. When I run this pipeline, everything looks fine node()  {   addBadge( text:"badge from Jenkins")   addBadge( text:"badge from Jenkins")   addBadge( text:"badge from Jenkins")   addBadge( text:"badge from Jenkins")   addBadge( text:"badge from Jenkins")   addBadge( text:"badge from Jenkins") }   Can you please provide me your pipeline script?   By the way, the style class 'build-row  single-line ' comes not from the bage plugin. The plugin does not have control over that style. The code that is from the plugin is just <span style=" display:inline; ...  
          Hide
          jasoner Jason Er added a comment -

          You are right. It may not be related to Jenkins. I downgraded Badge plugin to 1.2 and it works again. Problem surface when moving up to version 1.3.

          Show
          jasoner Jason Er added a comment - You are right. It may not be related to Jenkins. I downgraded Badge plugin to 1.2 and it works again. Problem surface when moving up to version 1.3.
          Hide
          bakito Marc Brugger added a comment -

          It might be related to this change here: https://github.com/jenkinsci/badge-plugin/commit/c219f60ef4c0cf1f2fe39e1378b2751977dfe61a#diff-088c15c62ef9dc9b6dbb3a0626f227c0R36 

          I've removed the 'display:inline;' from the style and added the snapshot plugin hpi to this issue. Could you try if this would solve your issue?
          badge.hpi

           

          Show
          bakito Marc Brugger added a comment - It might be related to this change here: https://github.com/jenkinsci/badge-plugin/commit/c219f60ef4c0cf1f2fe39e1378b2751977dfe61a#diff-088c15c62ef9dc9b6dbb3a0626f227c0R36   I've removed the 'display:inline;' from the style and added the snapshot plugin hpi to this issue. Could you try if this would solve your issue? badge.hpi  
          Hide
          jasoner Jason Er added a comment -

          Yes, this works.

          Show
          jasoner Jason Er added a comment - Yes, this works.
          Show
          bakito Marc Brugger added a comment - reverted the style change:  https://github.com/jenkinsci/badge-plugin/commit/e3ab5a7f9b11d9553042e8cde9ccf7c635a8f69c

            People

            Assignee:
            bakito Marc Brugger
            Reporter:
            jasoner Jason Er
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: