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

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

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Component/s: timestamper-plugin
    • Labels:
      None
    • Environment:
    • Similar Issues:
    • Released As:
      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 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 made changes -
            Status Open [ 1 ] Fixed but Unreleased [ 10203 ]
            Resolution Fixed [ 1 ]
            Released As 1.10
            basil Basil Crow made changes -
            Status Fixed but Unreleased [ 10203 ] Resolved [ 5 ]

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: