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

MsBuildParser reports warnings if the build project contains "info"

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • analysis-model
    • Jenkins 2.176
      Analysis Model API Plug-in 5.0.0
      Warnings Next Generation Plugin 5.0.0
    • 5.0.2

      The warning analysis reports a false positive if e.g. the build project name contains the string "info".

      For example, the line below is matched by the regexp parser:

      311>------ Build started: Project: sysinfo, Configuration: Debug Win32 ------

       
      This obviously leads to an error during the report generation:

      [DEBUG] [-ERROR-] Can't resolve absolute paths for some files:
      [DEBUG] [-ERROR-] - C:/jenkins/workspace/acecode-win/build/------ Build started: Project
      [DEBUG] [-ERROR-] Can't create fingerprints for some files:
      [DEBUG] [-ERROR-] - 'C:/jenkins/workspace/acecode-win/build/------ Build started: Project', IO exception has been thrown: java.nio.file.InvalidPathException: Illegal char <:> at index 59: C:/jenkins/workspace/acecode-win/build/------ Build started: Project
      

       

          [JENKINS-57365] MsBuildParser reports warnings if the build project contains "info"

          I don't know about the broader scope of the different versions of MsBuild and the corresponding outputs that have to be matched with the regexp, but I have a suggestions which fixes my issue. Obviously I cannot guarantee that this doesn't break anything else but looking at the examples in the unit test file msbuild.txt it could be valid.

          New regexp pattern:

           

          MS_BUILD_WARNING_PATTERN = "(?:^(?:.*)Command line warning ([A-Za-z0-9]+):\\s*(.*)\\s*\\[(.*)\\])|"
                      + ANT_TASK + "(?:(?:\\s*(?:\\d+|\\d+:\\d+)>)?(?:(?:(?:(.*?)\\((\\d*)(?:,(\\d+))?[a-zA-Z]*?\\)|.*LINK)\\s*:|"
                      + "(.*):)\\s*([A-z-_]*\\s(?:[Nn]ote|[Ii]nfo|[Ww]arning|(?:fatal\\s*)?[Ee]rror))[^A-Za-z0-9]\\s*:?\\s*([A-Za-z0-9\\-_]+)?"
                      + "\\s*:\\s(?:\\s*([A-Za-z0-9.]+)\\s*:)?\\s*(.*?)(?: \\[([^\\]]*)[/\\\\][^\\]\\\\]+\\])?"
                      + "|(.*)\\s*:.*error\\s*(LNK[0-9]+):\\s*(.*)))$";
          

          I removed the "optional"-flag (question mark) for the whitespace before the note/info/warning/fatal error strings. In other words, the strings are now only matched if they have a whitespace right before them which seems to be valid for the test cases in the unit test file msbuild.txt.

           

           

          This should probably be checked by someone more familiar with the various MsBuild outputs but I just wanted to contribute a bit and provide some guidance to solve the issue.

          Stephan Senkbeil added a comment - I don't know about the broader scope of the different versions of MsBuild and the corresponding outputs that have to be matched with the regexp, but I have a suggestions which fixes my issue. Obviously I cannot guarantee that this doesn't break anything else but looking at the examples in the unit test file msbuild.txt it could be valid. New regexp pattern:   MS_BUILD_WARNING_PATTERN = "(?:^(?:.*)Command line warning ([A-Za-z0-9]+):\\s*(.*)\\s*\\[(.*)\\])|" + ANT_TASK + "(?:(?:\\s*(?:\\d+|\\d+:\\d+)>)?(?:(?:(?:(.*?)\\((\\d*)(?:,(\\d+))?[a-zA-Z]*?\\)|.*LINK)\\s*:|" + "(.*):)\\s*([A-z-_]*\\s(?:[Nn]ote|[Ii]nfo|[Ww]arning|(?:fatal\\s*)?[Ee]rror))[^A-Za-z0-9]\\s*:?\\s*([A-Za-z0-9\\-_]+)?" + "\\s*:\\s(?:\\s*([A-Za-z0-9.]+)\\s*:)?\\s*(.*?)(?: \\[([^\\]]*)[/\\\\][^\\]\\\\]+\\])?" + "|(.*)\\s*:.*error\\s*(LNK[0-9]+):\\s*(.*)))$" ; I removed the "optional"-flag (question mark) for the whitespace before the note/info/warning/fatal error strings. In other words, the strings are now only matched if they have a whitespace right before them which seems to be valid for the test cases in the unit test file msbuild.txt.     This should probably be checked by someone more familiar with the various MsBuild outputs but I just wanted to contribute a bit and provide some guidance to solve the issue.

          This change is now marking the following msbuild output where before it was not being marked.

           

          unknown : info : PostSharp 5.0.45 [postsharp-net40-x86-native.exe release | .NET Framework 4.7] complete – 0 errors, 0 warnings, processed in 2272 ms

           

          It is being reported as file: unknown:0, package: -, severity: Low, there is nothing reported in the category column.

           

          Is this expected to be marked with this change?

          Peter Banfield added a comment - This change is now marking the following msbuild output where before it was not being marked.   unknown : info : PostSharp 5.0.45 [postsharp-net40-x86-native.exe release | .NET Framework 4.7] complete – 0 errors, 0 warnings, processed in 2272 ms   It is being reported as file: unknown:0, package: -, severity: Low, there is nothing reported in the category column.   Is this expected to be marked with this change?

            stephansenkbeil Stephan Senkbeil
            stephansenkbeil Stephan Senkbeil
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: