It appears that the ANSI Color plugin currently does not work with the Blue Ocean UX. We're expecting to see shell output which is colored but it's not. I am not sure if it would be up to the Blue Ocean plugin team or the ANSI color plugin team to resolve this so I mapped both components to it. Please feel free to edit this ticket as needed. By the way, we're using the pipeline syntax for generating the output.

      I've read the guidelines for ticket creation and searched for similar issues and was unable to find any. Having said this, please let me know if there is something wrong with this ticket or if this is a known issue. Also, I was not sure which sprint to add this to so I left it blank.

      Thanks!

          [JENKINS-40107] Blue Ocean support for ANSI Color output

          James Dumay added a comment -

          I suspect this will need some changes to Blue Ocean and Pipeline for this to work. io.jenkins.blueocean.service.embedded.rest.LogResource is a good start.

          James Dumay added a comment - I suspect this will need some changes to Blue Ocean and Pipeline for this to work. io.jenkins.blueocean.service.embedded.rest.LogResource is a good start.

          James Dumay added a comment -

          thanks for filing evasilchenko.

          I'd be curious if dblock (maintainer of the ANSI color plugin) would like to help us build console annotation support for Blue Ocean.

          James Dumay added a comment - thanks for filing evasilchenko . I'd be curious if dblock (maintainer of the ANSI color plugin) would like to help us build console annotation support for Blue Ocean.

          I'd gladly take pull requests and provide free advice, but I don't use Jenkins actively so I won't have time to code it. That said https://github.com/dblock/jenkins-ansicolor-plugin is quite straightforward.

          Daniel Doubrovkine added a comment - I'd gladly take pull requests and provide free advice, but I don't use Jenkins actively so I won't have time to code it. That said https://github.com/dblock/jenkins-ansicolor-plugin is quite straightforward.

          Thanks so much for the feedback guys! I unfortunately don't develop in Java but let me know how else I can help. Keep up the great work and Blue Ocean is coming along really nice!

          Eugene Vasilchenko added a comment - Thanks so much for the feedback guys! I unfortunately don't develop in Java but let me know how else I can help. Keep up the great work and Blue Ocean is coming along really nice!

          Lewis Cowles added a comment -

          Looking at the code, I'd be surprised if the markup did not exist and was not just having styles overridden. Can anyone produce attachment the output as HTML of a part of the log (redacted if necessary)? should be as simple as selecting with mouse, right-click and "copy as HTML". This way we can know if it's failing to parse the text or if it's a front-end glitch.

          Lewis Cowles added a comment - Looking at the code, I'd be surprised if the markup did not exist and was not just having styles overridden. Can anyone produce attachment the output as HTML of a part of the log (redacted if necessary)? should be as simple as selecting with mouse, right-click and "copy as HTML". This way we can know if it's failing to parse the text or if it's a front-end glitch.

          lewiscowles1986 it appears to be a front-end issue. I picked a random output line from a Chef command which appears green in the legacy UX but is indistinguishable from the rest of the output in Blue Ocean:

          Jenkins Console Output:

          <span style="color: #00CD00;">- restart service service[httpd]</span>
          

          Jenkins Blue Ocean Console Output

          <tr id="step-134-log-524">
            <td class="linenumber">
              <a href="#step-134-log-524" name="step-134-log-524">524</a>
              <!-- react-text: 4068 --> 
              <!-- /react-text -->
            </td>
            <td class="line"> - restart service service[httpd]</td>
          </tr>
          

          If I manually add the inline style to the td with class="line" it overrides the styling from this .line class and works. There might need to be an update made to the plugin however, because I don't see any reference to the green style in the CSS hierarchy for the <tr> node at all.

          Eugene Vasilchenko added a comment - lewiscowles1986 it appears to be a front-end issue. I picked a random output line from a Chef command which appears green in the legacy UX but is indistinguishable from the rest of the output in Blue Ocean: Jenkins Console Output: <span style= "color: #00CD00;" > - restart service service[httpd] </span> Jenkins Blue Ocean Console Output <tr id= "step-134-log-524" > <td class= "linenumber" > <a href= "#step-134-log-524" name= "step-134-log-524" > 524 </a> <!-- react-text: 4068 --> <!-- /react-text --> </td> <td class= "line" > - restart service service[httpd] </td> </tr> If I manually add the inline style to the td with class="line" it overrides the styling from this .line class and works. There might need to be an update made to the plugin however, because I don't see any reference to the green style in the CSS hierarchy for the <tr> node at all.

          Lewis Cowles added a comment -

          Looking at this, I'm not sure it is a front-end issue. Forcing inline style changes is probably not the way forward the specific td needs a style tag appended to it by the looks of things.

          Lewis Cowles added a comment - Looking at this, I'm not sure it is a front-end issue. Forcing inline style changes is probably not the way forward the specific td needs a style tag appended to it by the looks of things.

          James Dumay added a comment -

          lewiscowles1986 I think you will find we have to add an extension point in blueocean-rest-impl for the ansi color plugin to pass that color info up into the response and then some sort of decorator extension point in the JS

          James Dumay added a comment - lewiscowles1986 I think you will find we have to add an extension point in blueocean-rest-impl for the ansi color plugin to pass that color info up into the response and then some sort of decorator extension point in the JS

          James Dumay added a comment -

          It is likely that we would like to support ANSI Color right out of the box with JENKINS-41200.

          James Dumay added a comment - It is likely that we would like to support ANSI Color right out of the box with JENKINS-41200 .

            Unassigned Unassigned
            evasilchenko Eugene Vasilchenko
            Votes:
            2 Vote for this issue
            Watchers:
            16 Start watching this issue

              Created:
              Updated:
              Resolved: