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

Start filtering by exclude/include patterns AFTER absolute path expansion

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • warnings-plugin
    • None
    • Jenkins 1.532.2 with Warnings plugin 4.39

      Currently filtering by exclude/include patterns is done before the expansion of relative paths to absolute paths is done. If this would be done after the expansion then the filtering would be more efficient:

      I see that under the advanced section of the compiler warnings module there is an option to ignore files based on their absolute file path. I have a directory at the top of my workspace named "log4cxx/source". I don't want to be notified of any warnings in that directory. The warnings are found in the console output. I have tried the following filters, all without success
      log4cxx/source
      ./log4cxx/source/.
      log4cxx/source/**

      When I look at the compiler output I see output like this:

      14:45:01 /bin/sh /d/workspace-jnlp/workspace/log4cxx/label/windigo-jnlp/log4cxx/source/apr-1.4.6/libtool --silent --mode=compile gcc -g -O2 -DHAVE_CONFIG_H -DWIN32 -D_MSVCRT_ -D_LARGEFILE64_SOURCE -I./include -I/d/workspace-jnlp/workspace/log4cxx/label/windigo-jnlp/log4cxx/source/apr-1.4.6/include/arch/win32 -I./include/arch/unix -I/d/workspace-jnlp/workspace/log4cxx/label/windigo-jnlp/log4cxx/source/apr-1.4.6/include/arch/unix -I/d/workspace-jnlp/workspace/log4cxx/label/windigo-jnlp/log4cxx/source/apr-1.4.6/include -o atomic/win32/apr_atomic.lo -c atomic/win32/apr_atomic.c && touch atomic/win32/apr_atomic.lo
      14:45:01 atomic/win32/apr_atomic.c:31:5: warning: 'dllimport' attribute ignored [-Wattributes]
      14:45:01 (apr_uint32_t volatile *);
      14:45:01 ^
      14:45:01 atomic/win32/apr_atomic.c:34:6: warning: 'dllimport' attribute ignored [-Wattributes]
      14:45:01 apr_uint32_t);
      14:45:01 ^
      14:45:01 atomic/win32/apr_atomic.c:37:6: warning: 'dllimport' attribute ignored [-Wattributes]
      14:45:01 apr_uint32_t, apr_uint32_t);
      14:45:01 ^
      14:45:01 atomic/win32/apr_atomic.c:40:6: warning: 'dllimport' attribute ignored [-Wattributes]
      14:45:01 void *, const void *);
      14:45:01 ^
      14:45:01 atomic/win32/apr_atomic.c:43:6: warning: 'dllimport' attribute ignored [-Wattributes]
      14:45:01 void *);
      14:45:01 ^

      If I list "atomic/win32/apr_atomic.c" in the excludes, then these warnings are ignored by the warnings plugin. However I would much rather be able to specify "./log4cxx/source/." to make sure I only exclude warnings from that subdirectory. The full path information must be available because the links that the plugin creates for the warnings link to the actual file in the workspace.

      I'm using Jenkins 1.532.2 with Warnings plugin 4.39.

          [JENKINS-24011] Start filtering by exclude/include patterns AFTER absolute path expansion

          jpschewe added a comment -

          This is using the GCC 4 parser of the console output.

          jpschewe added a comment - This is using the GCC 4 parser of the console output.

          Ulli Hafner added a comment - - edited

          Did you try

          .*log4cxx/source/.*
          

          ?
          The patterns are Java regular expressions (and not ant patterns).

          Ulli Hafner added a comment - - edited Did you try .*log4cxx/source/.* ? The patterns are Java regular expressions (and not ant patterns).

          jpschewe added a comment -

          Yes, I realize that they are not ant expressions, but given the problems I have been having I figured I would try all options. Here are the expressions that I have tried:

          log4cxx/source
          .*/log4cxx/source
          .*/log4cxx/source/.*
          log4cxx/source/**
          .*log4cxx.*source.*
          .*log4cxx.source.*
          

          jpschewe added a comment - Yes, I realize that they are not ant expressions, but given the problems I have been having I figured I would try all options. Here are the expressions that I have tried: log4cxx/source .*/log4cxx/source .*/log4cxx/source/.* log4cxx/source/** .*log4cxx.*source.* .*log4cxx.source.*

          Code changed in jenkins
          User: Ulli Hafner
          Path:
          src/main/java/hudson/plugins/warnings/WarningsPublisher.java
          src/main/java/hudson/plugins/warnings/parser/FileWarningsParser.java
          src/main/java/hudson/plugins/warnings/parser/ParserRegistry.java
          src/main/java/hudson/plugins/warnings/parser/WarningsFilter.java
          src/test/java/hudson/plugins/warnings/ConsoleParserTest.java
          src/test/java/hudson/plugins/warnings/ParserConfigurationTest.java
          src/test/java/hudson/plugins/warnings/WarningsPublisherTest.java
          src/test/java/hudson/plugins/warnings/parser/DynamicParserTest.java
          src/test/java/hudson/plugins/warnings/parser/ParserRegistryIntegrationTest.java
          src/test/java/hudson/plugins/warnings/parser/ParserRegistryTest.java
          src/test/java/hudson/plugins/warnings/parser/ParserSpeed.java
          http://jenkins-ci.org/commit/warnings-plugin/4f2bbc2f77b11159c87422e1c2ec5e65b974d07a
          Log:
          [FIXED JENKINS-24011] Apply include/exclude filters after path expansion.

          Also use JenkinsRule for all integration tests.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Ulli Hafner Path: src/main/java/hudson/plugins/warnings/WarningsPublisher.java src/main/java/hudson/plugins/warnings/parser/FileWarningsParser.java src/main/java/hudson/plugins/warnings/parser/ParserRegistry.java src/main/java/hudson/plugins/warnings/parser/WarningsFilter.java src/test/java/hudson/plugins/warnings/ConsoleParserTest.java src/test/java/hudson/plugins/warnings/ParserConfigurationTest.java src/test/java/hudson/plugins/warnings/WarningsPublisherTest.java src/test/java/hudson/plugins/warnings/parser/DynamicParserTest.java src/test/java/hudson/plugins/warnings/parser/ParserRegistryIntegrationTest.java src/test/java/hudson/plugins/warnings/parser/ParserRegistryTest.java src/test/java/hudson/plugins/warnings/parser/ParserSpeed.java http://jenkins-ci.org/commit/warnings-plugin/4f2bbc2f77b11159c87422e1c2ec5e65b974d07a Log: [FIXED JENKINS-24011] Apply include/exclude filters after path expansion. Also use JenkinsRule for all integration tests.

            drulli Ulli Hafner
            jpschewe jpschewe
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: