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

GlobalAnnotator does not annotate lines that are part of a multi-line color sequence

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved (View Workflow)
    • Minor
    • Resolution: Fixed
    • timestamper-plugin
    • None
    • 1.10

    Description

      Steps to reproduce

      1. Install timestamper 1.9 and ansicolor 0.6.2.
      2. Set the global option to enable timestamps for all Pipeline builds.
      3. Create a job with a console log as follows, and view the console in the classic UI.

      [2019-06-18T19:59:27.250Z] ^[[32mDone resetting Postgres targets^[[39m
      [2019-06-18T19:59:27.250Z] ^[[34m# vm.example.com:
      [2019-06-18T19:59:27.250Z] Could not fetch logs: Error while executing command: "awk 'BEGIN { CAPTURE="Could not fetch logs: Error while executing command: "grep -c "Starting initial_setup_tests.test_developer_reset_system" /var/log/error.log" Exit status: 1" }; CAPTURE==0 { if (lines > 0){print; lines-- }}; /"Starting initial_setup_tests.test_developer_reset_system"/ { CAPTURE--; lines=200}' /var/log/error.log" Exit status: 1# dlpx-trunk-84487-target.dlpxdc.co:
      [2019-06-18T19:59:27.250Z] Could not fetch logs: Error while executing command: "awk 'BEGIN { CAPTURE="Could not fetch logs: Error while executing command: "grep -c "Starting initial_setup_tests.test_developer_reset_system" /var/log/error.log" Exit status: 1" }; CAPTURE==0 { if (lines > 0){print; lines-- }}; /"Starting initial_setup_tests.test_developer_reset_system"/ { CAPTURE--; lines=200}' /var/log/error.log" Exit status: 1
      [2019-06-18T19:59:27.250Z] ^[[39m
      [2019-06-18T19:59:27.931Z] ^[[32mHTTP CONNECTION: vm.example.com/resources/json/session^[[39m
      

      Expected results

      GlobalAnnotator should mark up the timestamps for all lines as follows:

      12:59:27  Done resetting Postgres targets
      12:59:27  # vm.example.com:
      12:59:27 Could not fetch logs: Error while executing command: "awk 'BEGIN { CAPTURE="Could not fetch logs: Error while executing command: "grep -c "Starting initial_setup_tests.test_developer_reset_system" /var/log/error.log" Exit status: 1" }; CAPTURE==0 { if (lines > 0){print; lines-- }}; /"Starting initial_setup_tests.test_developer_reset_system"/ { CAPTURE--; lines=200}' /var/log/error.log" Exit status: 1# dlpx-trunk-84487-target.dlpxdc.co:
      12:59:27 Could not fetch logs: Error while executing command: "awk 'BEGIN { CAPTURE="Could not fetch logs: Error while executing command: "grep -c "Starting initial_setup_tests.test_developer_reset_system" /var/log/error.log" Exit status: 1" }; CAPTURE==0 { if (lines > 0){print; lines-- }}; /"Starting initial_setup_tests.test_developer_reset_system"/ { CAPTURE--; lines=200}' /var/log/error.log" Exit status: 1
      12:59:27 
      12:59:27  HTTP CONNECTION: vm.example.com/resources/json/session
      

      Actual results

      GlobalAnnotator marks up the first two lines and the and last line, but the three lines in the middle are not annotated:

      12:59:27  Done resetting Postgres targets
      12:59:27  # vm.example.com:
      [2019-06-18T19:59:27.250Z] Could not fetch logs: Error while executing command: "awk 'BEGIN { CAPTURE="Could not fetch logs: Error while executing command: "grep -c "Starting initial_setup_tests.test_developer_reset_system" /var/log/error.log" Exit status: 1" }; CAPTURE==0 { if (lines > 0){print; lines-- }}; /"Starting initial_setup_tests.test_developer_reset_system"/ { CAPTURE--; lines=200}' /var/log/error.log" Exit status: 1# dlpx-trunk-84487-target.dlpxdc.co:
      [2019-06-18T19:59:27.250Z] Could not fetch logs: Error while executing command: "awk 'BEGIN { CAPTURE="Could not fetch logs: Error while executing command: "grep -c "Starting initial_setup_tests.test_developer_reset_system" /var/log/error.log" Exit status: 1" }; CAPTURE==0 { if (lines > 0){print; lines-- }}; /"Starting initial_setup_tests.test_developer_reset_system"/ { CAPTURE--; lines=200}' /var/log/error.log" Exit status: 1
      [2019-06-18T19:59:27.250Z] 
      12:59:27  HTTP CONNECTION: vm.example.com/resources/json/session
      

      Note that the three lines in the middle are part of a multi-line color sequence.

      Attachments

        Issue Links

          Activity

            basil Basil Crow created issue -
            basil Basil Crow made changes -
            Field Original Value New Value
            Link This issue relates to JENKINS-48344 [ JENKINS-48344 ]
            basil Basil Crow added a comment -

            jglick This is possibly related to the html.startsWith logic in GlobalAnnotator.

            basil Basil Crow added a comment - jglick This is possibly related to the html.startsWith logic in GlobalAnnotator .
            basil Basil Crow added a comment -

            Posted jenkinsci/timestamper-plugin#28 to address this.

            basil Basil Crow added a comment - Posted jenkinsci/timestamper-plugin#28 to address this.
            basil Basil Crow made changes -
            Remote Link This issue links to "PR #28 (Web Link)" [ 23126 ]
            basil Basil Crow made changes -
            Assignee Steven G Brown [ stevengbrown ] Basil Crow [ basil ]
            basil Basil Crow added a comment -

            Released in Timestamper 1.10.

            basil Basil Crow added a comment - Released in Timestamper 1.10.
            basil Basil Crow made changes -
            Released As 1.10
            Resolution Fixed [ 1 ]
            Status Open [ 1 ] Fixed but Unreleased [ 10203 ]
            basil Basil Crow made changes -
            Status Fixed but Unreleased [ 10203 ] Resolved [ 5 ]
            basil Basil Crow made changes -
            Link This issue is duplicated by JENKINS-58215 [ JENKINS-58215 ]

            People

              basil Basil Crow
              basil Basil Crow
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: