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

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

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • badge-plugin
    • None
    • Centos7, Jenkins 2.121.1, Badge 1.5
    • 1.6

      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....

       

       

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

          [JENKINS-52287] Multiple ShortText created by Badge plugin failed to wrapped in build history pane

          Marc Brugger added a comment -

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

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

          Jason Er added a comment -

          Please see the good case and the bad case attached.

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

          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>

          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>

          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; ...

           

          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; ...  

          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.

          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.

          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

           

          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  

          Jason Er added a comment -

          Yes, this works.

          Jason Er added a comment - Yes, this works.

          Marc Brugger added a comment -

          Marc Brugger added a comment - reverted the style change:  https://github.com/jenkinsci/badge-plugin/commit/e3ab5a7f9b11d9553042e8cde9ccf7c635a8f69c

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

              Created:
              Updated:
              Resolved: