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

timestamper 1.9 breaks warnings-ng's ability to find source files

    • 5.0.0 (analysis-model and warnings-ng)

      In timestamper 1.9, the log format was changed.  When I enable timestamper on a pipeline job, then scan it with warnings-ng, it detects errors but incorrectly parses the filename — it considers the timestamp to be part of the filename.

      To reproduce the issue, install both plugins and run this pipeline job:

      node {
          timestamps {
              sh """
                  echo '#error This is an error.' > test.c
                  clang test.c || true
              """
              recordIssues tools: [clang(id: 'clang', name: 'clang')]
          }
      }
      

      and the console log says:

      00:00:01.047  test.c:1:2: error: This is an error.
      …
      00:00:06.276  [clang] [ERROR] Can't resolve absolute paths for some files:
      00:00:06.276  [clang] [ERROR] - [2019-03-08T15:46:53.268Z] test.c
      00:00:06.276  [clang] [ERROR] Can't create fingerprints for some files:
      00:00:06.276  [clang] [ERROR] - '[2019-03-08T15:46:53.268Z] test.c', IO exception has been thrown: java.nio.file.NoSuchFileException: [2019-03-08T15:46:53.268Z] test.c
      

          [JENKINS-56484] timestamper 1.9 breaks warnings-ng's ability to find source files

          Steve Mokris created issue -
          Steve Mokris made changes -
          Description Original: In timestamper 1.9, the [log format was changed|https://plugins.jenkins.io/timestamper#Timestamper-1.9(2019-02-07)].  When I enable timestamper on a pipeline job, then scan it with warnings-ng, it detects errors but incorrectly parses the filename — it considers the timestamp part of the filename.

          To reproduce the issue, install both plugins and run this pipeline job:
          {code:java}
          node {
              timestamps {
                  sh """
                      echo '#error This is an error.' > test.c
                      clang test.c || true
                  """
                  recordIssues tools: [clang(id: 'clang', name: 'clang')]
              }
          }
          {code}
          and the console log says:
          {code:java}
          00:00:01.047 test.c:1:2: error: This is an error.

          00:00:06.276 [clang] [ERROR] Can't resolve absolute paths for some files:
          00:00:06.276 [clang] [ERROR] - [2019-03-08T15:46:53.268Z] test.c
          00:00:06.276 [clang] [ERROR] Can't create fingerprints for some files:
          00:00:06.276 [clang] [ERROR] - '[2019-03-08T15:46:53.268Z] test.c', IO exception has been thrown: java.nio.file.NoSuchFileException: [2019-03-08T15:46:53.268Z] test.c
          {code}
          New: In timestamper 1.9, the [log format was changed|https://plugins.jenkins.io/timestamper#Timestamper-1.9(2019-02-07)].  When I enable timestamper on a pipeline job, then scan it with warnings-ng, it detects errors but incorrectly parses the filename — it considers the timestamp to be part of the filename.

          To reproduce the issue, install both plugins and run this pipeline job:
          {code:java}
          node {
              timestamps {
                  sh """
                      echo '#error This is an error.' > test.c
                      clang test.c || true
                  """
                  recordIssues tools: [clang(id: 'clang', name: 'clang')]
              }
          }
          {code}
          and the console log says:
          {code:java}
          00:00:01.047 test.c:1:2: error: This is an error.

          00:00:06.276 [clang] [ERROR] Can't resolve absolute paths for some files:
          00:00:06.276 [clang] [ERROR] - [2019-03-08T15:46:53.268Z] test.c
          00:00:06.276 [clang] [ERROR] Can't create fingerprints for some files:
          00:00:06.276 [clang] [ERROR] - '[2019-03-08T15:46:53.268Z] test.c', IO exception has been thrown: java.nio.file.NoSuchFileException: [2019-03-08T15:46:53.268Z] test.c
          {code}

          Ulli Hafner added a comment -

          Ulli Hafner added a comment - See discussion in https://github.com/jenkinsci/analysis-model/pull/118 .
          Ulli Hafner made changes -
          Component/s Original: timestamper-plugin [ 15749 ]
          Assignee Original: Steven G Brown [ stevengbrown ] New: Ulli Hafner [ drulli ]

          Ulli Hafner added a comment -

          This is not related to the timestamper plugin in general. It also happens if e.g. warnings are reported using a colored maven output.

          Ulli Hafner added a comment - This is not related to the timestamper plugin in general. It also happens if e.g. warnings are reported using a colored maven output.
          Ulli Hafner made changes -
          Epic Link New: JENKINS-56456 [ 198054 ]
          Ulli Hafner made changes -
          Component/s New: analysis-model [ 23523 ]
          Component/s Original: warnings-ng-plugin [ 24526 ]
          Assignee Original: Ulli Hafner [ drulli ]
          Labels New: help-wanted newbie-friendly
          Ulli Hafner made changes -
          Link New: This issue is caused by JENKINS-48344 [ JENKINS-48344 ]

          Jesse Glick added a comment - - edited

          There is apparently a TimestamperAPI.read method which no longer works (and has no test coverage that I know of), though I guess you are looking for something like the opposite which AFAIK does not exist.

          Jesse Glick added a comment - - edited There is apparently a TimestamperAPI.read method which no longer works (and has no test coverage that I know of), though I guess you are looking for something like the opposite which AFAIK does not exist.
          Jesse Glick made changes -
          Remote Link New: This issue links to "Discussion of TimestamperAPI.read (Web Link)" [ 22520 ]

            smokris Steve Mokris
            smokris Steve Mokris
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: