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

When using Groovy Postbuild's `manager.addShortText()` in Firefox, it will cause page misalignment in the build history list

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • core
    • Mac os monterey 12.3
      firefox version 100.0
      Jenkins version 2.332.3

      Using manager.addShortText($content) to show text in a build history list when the $content is long may cause page disorder , just like the photos attached.

       

      The timestamp could occupy a large blank and seems not aligned when using Firefox.

       

       

       

        1. safari_1.png
          safari_1.png
          259 kB
        2. firefox_1.jpg
          firefox_1.jpg
          141 kB
        3. plugin.png
          plugin.png
          70 kB
        4. viewpage.html
          65 kB
        5. new_1.png
          new_1.png
          84 kB
        6. image-2022-06-07-22-40-24-894.png
          image-2022-06-07-22-40-24-894.png
          149 kB
        7. image-2022-06-07-22-39-24-321.png
          image-2022-06-07-22-39-24-321.png
          146 kB
        8. image-2022-06-07-22-32-33-305.png
          image-2022-06-07-22-32-33-305.png
          85 kB
        9. image-2022-05-07-18-32-51-161.png
          image-2022-05-07-18-32-51-161.png
          137 kB
        10. on_safari.png
          on_safari.png
          127 kB

          [JENKINS-68427] When using Groovy Postbuild's `manager.addShortText()` in Firefox, it will cause page misalignment in the build history list

          I tried to reproduce the problem with

          manager.addShortText("this is a very very very long text")
          

          using Groovy PostBuild plugin on a freestyle project. I tried in 2.332.2 without success.

          Would you have a easy reproducible test to offer? This would make finding the root cause easier and make sure we fox correctly the problem. Thank you bignnonster.

          Adrien Lecharpentier added a comment - I tried to reproduce the problem with manager.addShortText("this is a very very very long text") using Groovy PostBuild plugin on a freestyle project. I tried in 2.332.2 without success. Would you have a easy reproducible test to offer? This would make finding the root cause easier and make sure we fox correctly the problem. Thank you bignnonster .

          C XY added a comment - - edited

          Thanks for your attention.

          I tried with your text and it happened again.

          I tried to scale the horizontal size of the window , and I could see some variations from the normal to the abnormal, as the follow screenshots.

           

           

          Hope those helpful for you,alecharp 

          C XY added a comment - - edited Thanks for your attention. I tried with your text and it happened again. I tried to scale the horizontal size of the window , and I could see some variations from the normal to the abnormal, as the follow screenshots.     Hope those helpful for you, alecharp  

          Thank you bignnonster for this. I tried installing the Simplified Chinese locale plugin, thinking it could matter.
          But I cannot reproduce this.

          Could you please try to find when this issue was introduced? To do so, you need to:

          1. clone https://github.com/jenkinsci/jenkins,
          2. checkout the jenkins-2.332.2 tag,
          3. run git bisect start
          4. run mvn clean package -Pquick-build,
          5. run java -jar war/target/jenkins.war
          6. reproduce the problem, run git bisect bad
          7. checkout a previous label (go from lts baseline to lts baseline), run 4 and 5 again

          • while the problem can be reproduced, run git bisect bad
          • as soon as the problem is fixed, run git bisect good

          at this moment, git-bisect will go from commit to commit to find the commit introducing the issue. Run 4-5-6-7 until you have found the commit introducing the problem.

          Thank you very much for your help.

          Adrien Lecharpentier added a comment - Thank you bignnonster for this. I tried installing the Simplified Chinese locale plugin, thinking it could matter. But I cannot reproduce this. Could you please try to find when this issue was introduced? To do so, you need to: 1. clone https://github.com/jenkinsci/jenkins , 2. checkout the jenkins-2.332.2 tag, 3. run git bisect start 4. run mvn clean package -Pquick-build , 5. run java -jar war/target/jenkins.war 6. reproduce the problem, run git bisect bad 7. checkout a previous label (go from lts baseline to lts baseline), run 4 and 5 again while the problem can be reproduced, run git bisect bad as soon as the problem is fixed, run git bisect good at this moment, git-bisect will go from commit to commit to find the commit introducing the issue. Run 4-5-6-7 until you have found the commit introducing the problem. Thank you very much for your help.

          C XY added a comment -

          Hi,alecharp 

          I tried to reproduce the problem by following the steps your gave ,and I didn't make it.

          I can't find a obvious difference between my prod env and my local env . I think this may be involved by a certain plugin or Jenkins configuration ,yet there are so many plugins installed in my prod Jenkins, I can't make sure which one.

           

           

          I copy the bug html codes , is this helpful? Or is there a easy way to find the root cause? 

          <div class="build-icon"><a href="/job/test_freestyle/165/console" class="build-status-link"><span style="width: 16px; height: 16px; " class="build-status-icon__wrapper icon-blue icon-sm"><span class="build-status-icon__outer"><svg viewBox="0 0 24 24" tooltip="成功 &amp;gt; 控制台输出" focusable="false" class="svg-icon "><use href="/images/build-status/build-status-sprite.svg#build-status-static"></use></svg></span><svg viewBox="0 0 24 24" tooltip="成功 &amp;gt; 控制台输出" focusable="false" class="svg-icon icon-blue icon-sm"><use href="/static/84e2218b/images/build-status/build-status-sprite.svg#last-successful"></use></svg></span></a></div><a update-parent-class=".build-row" href="/job/test_freestyle/165/" class="tip model-link inside build-link display-name">#165</a> 

           

          Source code of the whole page

          viewpage.html

           

          A screenshot of my local jenkins

          C XY added a comment - Hi, alecharp   I tried to reproduce the problem by following the steps your gave ,and I didn't make it. I can't find a obvious difference between my prod env and my local env . I think this may be involved by a certain plugin or Jenkins configuration ,yet there are so many plugins installed in my prod Jenkins, I can't make sure which one.     I copy the bug html codes , is this helpful? Or is there a easy way to find the root cause?  <div class= "build-icon" ><a href= "/job/test_freestyle/165/console" class= "build-status-link" ><span style= "width: 16px; height: 16px; " class= "build-status-icon__wrapper icon-blue icon-sm" ><span class= "build-status-icon__outer" ><svg viewBox= "0 0 24 24" tooltip= "成功 &amp;gt; 控制台输出" focusable= " false " class= "svg-icon " ><use href= "/images/build-status/build-status-sprite.svg#build-status- static " ></use></svg></span><svg viewBox= "0 0 24 24" tooltip= "成功 &amp;gt; 控制台输出" focusable= " false " class= "svg-icon icon-blue icon-sm" ><use href= "/ static /84e2218b/images/build-status/build-status-sprite.svg#last-successful" ></use></svg></span></a></div><a update-parent-class= ".build-row" href= "/job/test_freestyle/165/" class= "tip model-link inside build-link display-name" >#165</a>   Source code of the whole page viewpage.html   A screenshot of my local jenkins

          Daniel Beck added a comment -

          Is warnings-ng installed on the instance with the problem? Does the page you're on include a reference to …/plugin/bootstrap5-api/css/jenkins-style.css in the source code?

          Daniel Beck added a comment - Is warnings-ng installed on the instance with the problem? Does the page you're on include a reference to …/plugin/bootstrap5-api/css/jenkins-style.css in the source code?

          C XY added a comment - - edited

          Is warnings-ng installed on the instance with the problem? 

          Does the page you're on include a reference to …/plugin/bootstrap5-api/css/jenkins-style.css?? in the source code???

           

          No.
          No.

           

           

          C XY added a comment - - edited Is warnings-ng installed on the instance with the problem?  Does the page you're on include a reference to …/plugin/bootstrap5-api/css/jenkins-style.css?? in the source code???   No. No.    

          Daniel Beck added a comment - - edited

          Is the Chinese localization plugin installed on both instances, or only the prod instance?

          (Unsure whether that'd be covered by "no obvious difference, asking just in case.)

          Daniel Beck added a comment - - edited Is the Chinese localization plugin installed on both instances, or only the prod instance? (Unsure whether that'd be covered by "no obvious difference, asking just in case.)

          C XY added a comment -

          I guess you mean this plugin. None of them installed this one.

          C XY added a comment - I guess you mean this plugin. None of them installed this one.

          Daniel Beck added a comment -

          To clarify, I am asking about https://plugins.jenkins.io/localization-zh-cn/

          Daniel Beck added a comment - To clarify, I am asking about https://plugins.jenkins.io/localization-zh-cn/

          C XY added a comment -

          Got it. The both instances are installed Localization: Chinese (Simplified)

          C XY added a comment - Got it. The both instances are installed Localization: Chinese (Simplified)

          Daniel Beck added a comment -

          I notice the build numbers are different in the "new_1" screenshot from the local machine.

          Could you use https://plugins.jenkins.io/next-build-number/ to set the build numbers to the ones from the prod instance to be as close as possible to the real environment with that as well?

          Daniel Beck added a comment - I notice the build numbers are different in the "new_1" screenshot from the local machine. Could you use https://plugins.jenkins.io/next-build-number/ to set the build numbers to the ones from the prod instance to be as close as possible to the real environment with that as well?

          C XY added a comment -

          I tried to use https://plugins.jenkins.io/next-build-number/ and the matter reproduced again at my local env. But there is a little difference that it did not reproduce until I set build number over 10000.

           

          C XY added a comment - I tried to use https://plugins.jenkins.io/next-build-number/ and the matter reproduced again at my local env. But there is a little difference that it did not reproduce until I set build number over 10000.  

          Daniel Beck added a comment -

          OK, so it looks like it's the following:

          5 digit build number + super long text badge + Firefox = problem

          That's a start

          Daniel Beck added a comment - OK, so it looks like it's the following: 5 digit build number + super long text badge + Firefox = problem That's a start

          C XY added a comment -

           

          C XY added a comment -  

          Jan Faracik added a comment -

          Builds widget got rewritten in https://www.jenkins.io/changelog-stable/2.479.1/ - and one area of focus was ensuring that content doesn't overflow in unexpected ways as it did in the classic widget.

          Would it possible for you to confirm if the issue is still around?

          Jan Faracik added a comment - Builds widget got rewritten in https://www.jenkins.io/changelog-stable/2.479.1/ - and one area of focus was ensuring that content doesn't overflow in unexpected ways as it did in the classic widget. Would it possible for you to confirm if the issue is still around?

            janfaracik Jan Faracik
            bignnonster C XY
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: