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

Warnings Next Generation: Error on accessing 'MSBUILD' file

    • warnings-ng 2.0.0, analysis-model-api 2.0.0

      When using the warnings-ng-plugin to parse an MSBUILD output as described in analysis-model issue20154 the expected outcome is that the filename 'MSBUILD' is recognized. (see here Line 214)

      However, as a consequence the publishIssues step in warnings-ng-plugin tries to resolve the absolute path and create fingerprints for the file 'MSBUILD', which of course fails and pollutes the console outwith with ERROR messages.

      [MyLib] [ERROR] Can't resolve absolute paths for some files:
      [MyLib] [ERROR] - MSBUILD
      [MyLib] [ERROR] Can't create fingerprints for some files:
      [MyLib] [ERROR] - 'MSBUILD', IO exception has been thrown: java.nio.file.NoSuchFileException: MSBUILD
      
      [MyLib] Resolving absolute file names for all issues
      [MyLib] -> 0 resolved, 1 unresolved, 0 already resolved
      [MyLib] Copying affected files to Jenkins' build folder /var/jenkins_home/jobs/.../builds/130
      [MyLib] -> 0 copied, 0 not in workspace, 1 not-found, 0 with I/O error
      

       

      From my point of view, an easy workaround would be to remove any 'MSBUILD' entry before processing the files, or to not add the dummy 'MSBUILD' file entry at the beginning (This would however be a breaking change).

      Any chance to get this fixed?

          [JENKINS-55373] Warnings Next Generation: Error on accessing 'MSBUILD' file

          Ulli Hafner added a comment -

          I don't use the parser on my own. However, rather than ignoring MSBUILD globally as file name I would suggest to change the MSBuild parser so that the MSBUILD token is not used as file name. Then the filename will be automatically skipped. What do you think?

          Interested in providing a PR in analysis-model?

          Ulli Hafner added a comment - I don't use the parser on my own. However, rather than ignoring MSBUILD globally as file name I would suggest to change the MSBuild parser so that the MSBUILD token is not used as file name. Then the filename will be automatically skipped. What do you think? Interested in providing a PR in analysis-model?

          Florian Hug added a comment - - edited

          I'm not sure but my approach would be to change the MSBuildParser.java in line 37 to

          String fileName = determineFileName(matcher);
          if !"MSBUILD".equals(fileName.trim()) {
            builder.setFileName(fileName);
          }
          

          Then however, the corresponding unit tests would need to be adjusted as well.
          As I don't have any experience in developing java, I have actually no idea how to develop locally. Hence, I could create a PR and let the Jenkins CI Build Server verify the results.

          (See https://github.com/Aeon512/analysis-model as a quick-shot)

          Florian Hug added a comment - - edited I'm not sure but my approach would be to change the MSBuildParser.java in line 37 to String fileName = determineFileName(matcher); if ! "MSBUILD" .equals(fileName.trim()) { builder.setFileName(fileName); } Then however, the corresponding unit tests would need to be adjusted as well. As I don't have any experience in developing java, I have actually no idea how to develop locally. Hence, I could create a PR and let the Jenkins CI Build Server verify the results. (See https://github.com/Aeon512/analysis-model as a quick-shot)

          Ulli Hafner added a comment -

          Yes, the tests needs to be adjusted as well. Your changes look good Simply send the PR and I'll integrate it...

          Ulli Hafner added a comment - Yes, the tests needs to be adjusted as well. Your changes look good Simply send the PR and I'll integrate it...

            drulli Ulli Hafner
            aeon512 Florian Hug
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: