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

Gradle plugin pipeline console annotator doesn't work with global timestamper

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • Jenkins 2.426.1
      gradle-plugin 2.9
      timestamper 1.26

      The "Executed Gradle Tasks" side panel that comes from gradle console log annotations doesn't show up when looking at pipeline logs when the global timestamper setting is turned on.

      Expected

      The "Executed Gradle Tasks" side panel shows up on pipeline/multibranch pipelines when using the global timestamper option

      Actual

      The panel does not show up

      Steps to Reproduce

      Works:
      1. Vanilla install of Jenkins LTS 2.426.1 with default plugins
      2. Setup java
      3. Run sample pipeline below

      Doesn't work:
      1. Vanilla install of Jenkins LTS 2.426.1 with default plugins
      2. Setup java
      3. Enable global timestamps (System > Timestamper > Enabled for all Pipeline builds)
      4. Run sample pipeline below

      build.gradle:

      task task1 {
          doLast {
              Thread.sleep(1000)
          }
      }
      
      task task2 {
          doLast {
              Thread.sleep(1000)
          }
      }
      
      task task3 {
          doLast {
              Thread.sleep(1000)
          }
      }
      

      multi-branch pipeline:

      pipeline {
          agent any
      
          tools {
             jdk "openjdk17.0_latest"
          }
      
          stages {
              stage('Hello') {
                  steps {
                      withGradle {
                          sh './gradlew task1 task2 task3'
                      }
                  }
              }
          }
      }
      

          [JENKINS-72411] Gradle plugin pipeline console annotator doesn't work with global timestamper

          Mark R added a comment - - edited

          It appears to be because the log lines have the timestamp directly in them when using pipelines:

          [2023-12-01T15:42:34.883Z] > Task :task1
          [2023-12-01T15:42:35.459Z] > Task :task2
          [2023-12-01T15:42:36.405Z] > Task :task3
          

          If the timestamp is injected before the GradleConsoleAnnotator code runs the annotation code won't properly detect that a task was executed.

          Mark R added a comment - - edited It appears to be because the log lines have the timestamp directly in them when using pipelines: [2023-12-01T15:42:34.883Z] > Task :task1 [2023-12-01T15:42:35.459Z] > Task :task2 [2023-12-01T15:42:36.405Z] > Task :task3 If the timestamp is injected before the GradleConsoleAnnotator code runs the annotation code won't properly detect that a task was executed.

            wolfs Stefan Wolf
            mrichar2 Mark R
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: