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

Message filter does not work for multiple-line messages

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: analysis-model
    • Labels:
      None
    • Environment:
      Jenkins: 2.168
      warnings-ng-plugin: 4.0.0
    • Similar Issues:
    • Released As:
      5.0.0 (analysis-model and warnings-ng)

      Description

      Pipeline:

      recordIssues enabledForFailure: true, filters: [
        excludeFile('.*qrc_icons\\.cpp.*'),
        excludeMessage('.*QVTKWidget.*'),
        excludeMessage('.*tmpnam.*')],
        tools: [gcc4(name: 'GCC-GUI', id: 'gcc4-gui', pattern: 'build/build*.log')],
        unstableTotalAll: 1
      

      With warnings-ng-plugin 3.0.3:

      Error Messages
      
      Can't resolve absolute paths for some files:
      - createSurface.cpp
      - Applications/DataExplorer/VtkVis/VtkVis_autogen/include/ui_VisualizationWidgetBase.h
      
      Information Messages
      
      Searching for all files in '/var/jenkins/workspace/ufz_ogs_PR-2429' that match the pattern 'build/build*.log'
      -> found 2 files
      Successfully parsed file /var/jenkins/workspace/ufz_ogs_PR-2429/build/build1.log
      -> found 2 issues (skipped 5 duplicates)
      Successfully parsed file /var/jenkins/workspace/ufz_ogs_PR-2429/build/build2.log
      -> found 2 issues (skipped 6 duplicates)
      Post processing issues on 'envinf11w' with source code encoding 'UTF-8'
      Resolving absolute file names for all issues in workspace '/var/jenkins/workspace/ufz_ogs_PR-2429'
      -> 0 resolved, 2 unresolved, 0 already resolved
      Copying affected files to Jenkins' build folder '/datadrive/jenkins-home/jobs/ufz/jobs/ogs/branches/PR-2429/builds/2/files-with-issues'
      -> 0 copied, 0 not in workspace, 2 not-found, 0 with I/O error
      Resolving module names from module definitions (build.xml, pom.xml, or Manifest.mf files)
      -> resolved module names for 2 issues
      Resolving package names (or namespaces) by parsing the affected files
      -> resolved package names of 2 affected files
      Applying 3 filters on the set of 2 issues (2 issues have been removed, 0 issues will be published)
      Creating fingerprints for all affected code blocks to track issues over different builds
      -> created fingerprints for 0 issues
      Invoking Git blamer to create author and commit information for all affected files
      GIT_COMMIT env = 'HEAD'
      Git working tree = '/var/jenkins/workspace/ufz_ogs_PR-2429'
      Git commit ID = 'ecd82eb50254ae2401a98c518f7305fccf7b2454'
      Job workspace = '/data3/var/jenkins/workspace/ufz_ogs_PR-2429'
      Created no blame requests - Git blame will be skipped
      -> blamed authors of issues in 0 files
      Using reference build 'ufz/ogs/PR-2429 #1' to compute new, fixed, and outstanding issues
      Issues delta (vs. reference build): outstanding: 0, new: 0, fixed: 0
      Evaluating quality gates
      -> PASSED - Total number of issues (any severity): 0 - Quality QualityGate: 1
      -> All quality gates have been passed
      Health report is disabled - skipping
      

      With warnings-ng-plugin 4.0.0:

      Error Messages
      
      Can't resolve absolute paths for some files:
      - createSurface.cpp
      - Applications/DataExplorer/VtkVis/VtkVis_autogen/include/ui_VisualizationWidgetBase.h
      Can't create fingerprints for some files:
      - 'Applications/DataExplorer/VtkVis/VtkVis_autogen/include/ui_VisualizationWidgetBase.h', IO exception has been thrown: java.nio.file.NoSuchFileException: Applications/DataExplorer/VtkVis/VtkVis_autogen/include/ui_VisualizationWidgetBase.h
      - 'Applications/DataExplorer/VtkVis/VtkVis_autogen/include/ui_VisualizationWidgetBase.h', IO exception has been thrown: java.nio.file.NoSuchFileException: Applications/DataExplorer/VtkVis/VtkVis_autogen/include/ui_VisualizationWidgetBase.h
      - 'Applications/DataExplorer/VtkVis/VtkVis_autogen/include/ui_VisualizationWidgetBase.h', IO exception has been thrown: java.nio.file.NoSuchFileException: Applications/DataExplorer/VtkVis/VtkVis_autogen/include/ui_VisualizationWidgetBase.h
      - 'Applications/DataExplorer/VtkVis/VtkVis_autogen/include/ui_VisualizationWidgetBase.h', IO exception has been thrown: java.nio.file.NoSuchFileException: Applications/DataExplorer/VtkVis/VtkVis_autogen/include/ui_VisualizationWidgetBase.h
      - 'Applications/DataExplorer/VtkVis/VtkVis_autogen/include/ui_VisualizationWidgetBase.h', IO exception has been thrown: java.nio.file.NoSuchFileException: Applications/DataExplorer/VtkVis/VtkVis_autogen/include/ui_VisualizationWidgetBase.h
      - 'Applications/DataExplorer/VtkVis/VtkVis_autogen/include/ui_VisualizationWidgetBase.h', IO exception has been thrown: java.nio.file.NoSuchFileException: Applications/DataExplorer/VtkVis/VtkVis_autogen/include/ui_VisualizationWidgetBase.h
      Can't create blame requests for some affected files:
      - Skipping non-workspace file Applications/DataExplorer/VtkVis/VtkVis_autogen/include/ui_VisualizationWidgetBase.h
      - Skipping non-workspace file Applications/DataExplorer/VtkVis/VtkVis_autogen/include/ui_VisualizationWidgetBase.h
      - Skipping non-workspace file Applications/DataExplorer/VtkVis/VtkVis_autogen/include/ui_VisualizationWidgetBase.h
      - Skipping non-workspace file Applications/DataExplorer/VtkVis/VtkVis_autogen/include/ui_VisualizationWidgetBase.h
      - Skipping non-workspace file Applications/DataExplorer/VtkVis/VtkVis_autogen/include/ui_VisualizationWidgetBase.h
      - Skipping non-workspace file Applications/DataExplorer/VtkVis/VtkVis_autogen/include/ui_VisualizationWidgetBase.h
      
      Information Messages
      
      Searching for all files in '/var/jenkins/workspace/ufz_ogs_PR-2429' that match the pattern 'build/build*.log'
      -> found 2 files
      Successfully parsed file /var/jenkins/workspace/ufz_ogs_PR-2429/build/build1.log
      -> found 7 issues (skipped 0 duplicates)
      Successfully parsed file /var/jenkins/workspace/ufz_ogs_PR-2429/build/build2.log
      -> found 7 issues (skipped 1 duplicate)
      Post processing issues on 'envinf56' with source code encoding 'UTF-8'
      Resolving absolute file names for all issues in workspace '/var/jenkins/workspace/ufz_ogs_PR-2429'
      -> 0 resolved, 2 unresolved, 0 already resolved
      Copying affected files to Jenkins' build folder '/datadrive/jenkins-home/jobs/ufz/jobs/ogs/branches/PR-2429/builds/3/files-with-issues'
      -> 0 copied, 0 not in workspace, 2 not-found, 0 with I/O error
      Resolving module names from module definitions (build.xml, pom.xml, or Manifest.mf files)
      -> resolved module names for 7 issues
      Resolving package names (or namespaces) by parsing the affected files
      -> resolved package names of 2 affected files
      Applying 3 filters on the set of 7 issues (1 issues have been removed, 6 issues will be published)
      Creating fingerprints for all affected code blocks to track issues over different builds
      -> created fingerprints for 0 issues
      Invoking Git blamer to create author and commit information for all affected files
      GIT_COMMIT env = 'HEAD'
      Git working tree = '/var/jenkins/workspace/ufz_ogs_PR-2429'
      Git commit ID = '84c4b4764737e38408db0eba5c0d97ba289702f1'
      Job workspace = '/var/jenkins/workspace/ufz_ogs_PR-2429'
      Created no blame requests - Git blame will be skipped
      -> blamed authors of issues in 0 files
      Using reference build 'ufz/ogs/PR-2429 #1' to compute new, fixed, and outstanding issues
      Issues delta (vs. reference build): outstanding: 0, new: 6, fixed: 0
      Evaluating quality gates
      -> WARNING - Total number of issues (any severity): 6 - Quality QualityGate: 1
      -> Some quality gates have been missed: overall result is WARNING
      Health report is disabled - skipping
      

      It is a CMake-based build and the file ui_VisualizationWidgetBase.h is located in the build-directory (it is auto-generated by Qt uic-compiler).

        Attachments

          Activity

          Hide
          drulli Ulli Hafner added a comment -

          And another tip/question: Normally the gcc parser detects the absolute path by combining the path of the current work directory and the relative path of the warning. In your case there is no current work directory printed. We currently have support for make and ninja messages. Would it be possible to add those messages to your build?

          Show
          drulli Ulli Hafner added a comment - And another tip/question: Normally the gcc parser detects the absolute path by combining the path of the current work directory and the relative path of the warning. In your case there is no current work directory printed. We currently have support for make and ninja messages. Would it be possible to add those messages to your build?
          Hide
          bilke Lars Bilke added a comment -

          Thanks a lot for the quick fix!

          What do you mean with "add those messages to your build"? The log is already generated with ninja although we build via cmake --build:

          #!/bin/bash set -eo pipefail cd build cmake --build . --config Release --target package -j 4 2>&1 | tee build1.log
          Show
          bilke Lars Bilke added a comment - Thanks a lot for the quick fix! What do you mean with "add those messages to your build"? The log is already generated with ninja although we build via cmake --build: #!/bin/bash set -eo pipefail cd build cmake --build . --config Release --target package -j 4 2>&1 | tee build1.log
          Hide
          drulli Ulli Hafner added a comment -

          I don't know how to invoke ninja, I'm a Java guy I just added support for ninja path detection: https://github.com/jenkinsci/analysis-model/blob/master/src/main/java/edu/hm/hafner/analysis/LookaheadParser.java#L28

          Is there an option in ninja to get those log messages in your build as well?

          Show
          drulli Ulli Hafner added a comment - I don't know how to invoke ninja, I'm a Java guy I just added support for ninja path detection: https://github.com/jenkinsci/analysis-model/blob/master/src/main/java/edu/hm/hafner/analysis/LookaheadParser.java#L28 Is there an option in ninja to get those log messages in your build as well?
          Hide
          bilke Lars Bilke added a comment -

          Ah I see. But this is output from CMake not Ninja. CMake configures the build and generates e.g. Makefiles or Ninja build files. CMake-based projects are often built out-of-source (i.e. having a build-directory separate from the source directory) so with your implementation you detect the build-directory (not the usage of Ninja).

          Yep, I can try to get the log message into the build log. Would it be enough to have it in one of several build files? I.e. adding a file which contains that line to pattern: 'build/build*.log'? Because what I do is like this:

          $ mkdir build; cd build
          $ cmake -G Ninja ../sources
            ...
            -- Build files have been written to ...
          $ ninja

          Every command is piped to a log file.

          Show
          bilke Lars Bilke added a comment - Ah I see. But this is output from CMake not Ninja. CMake configures the build and generates e.g. Makefiles or Ninja build files. CMake-based projects are often built out-of-source (i.e. having a build-directory separate from the source directory) so with your implementation you detect the build-directory (not the usage of Ninja). Yep, I can try to get the log message into the build log. Would it be enough to have it in one of several build files? I.e. adding a file which contains that line to  pattern: 'build/build*.log' ? Because what I do is like this: $ mkdir build; cd build $ cmake -G Ninja ../sources ... -- Build files have been written to ... $ ninja Every command is piped to a log file.
          Hide
          drulli Ulli Hafner added a comment -
          Show
          drulli Ulli Hafner added a comment - This should work, here is the example that I am using in my test: https://github.com/jenkinsci/analysis-model/blob/master/src/test/resources/edu/hm/hafner/analysis/parser/issue56020.ninja.log

            People

            • Assignee:
              drulli Ulli Hafner
              Reporter:
              bilke Lars Bilke
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: