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

Warnings plugin - regex fails to detect pattern whereas it is correctly detected when declaring the regex in System Configuration page

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • warnings-plugin
    • warnings-plugin 4.52
      Jenkins 1.648

      Hello,

      I have an issue with a regex that does not trigger any warning when set as a console output parser in a job, but seems to be correctly formatted and working in the System Configuration page

      Here are all the details of my sample:
      I created the following sample regex in the System Configuration page:

      (start(?:(?!start)[\s\S])*?end   step: runtimedata.*)
      

      With the following Groovy script:

      import hudson.plugins.warnings.parser.Warning
      import hudson.plugins.analysis.util.model.Priority
      String type = "TEST"
      String category = "runtimedata"
      String errors = matcher.group(1)
      return new Warning("", 0, type, category, errors, Priority.HIGH);
      

      It is supposed to retrieve the lines in red in the following sample:
      start step: at 06/01/2016-12:05:42
      end step: jsruler at 06/01/2016-12:05:42
      start step: at 06/01/2016-12:05:42
      some details here
      on several lines
      end step: runtimedata at 06/01/2016-12:05:42

      start step: at 06/01/2016-12:05:42
      end step: dummynls at 06/01/2016-12:05:42

      This works correctly when I create the regex and put the exact same sample text in the "Example Log Message" field:

      One warning found
      file name: 
      line number: 0
      priority: High Priority
      category:  headerruler
      type: TEST
      message: start step: runtimed[...]data   at 06/01/2016-12:05:42
      

      FYI, I've also tested the regex in several online tools and it works.

      However, when I run a job with the exact same trace in the console output and set the corresponding regex to parse it, no warning is found.
      Please note that this behavior happens only with regex with the pattern (??!someString)

      I looked for answers in forums and such but I haven't been able find anyone else encountering this issue. Since I feel like it is specific to some regex patterns, it might be that nobody else tried this...

      I hope you can find the explanation and correct this, it is quite a pain for me to work around this! Feel free to request any additional information I might have forgotten.

      Best Regards,
      Tyoneb

          [JENKINS-35262] Warnings plugin - regex fails to detect pattern whereas it is correctly detected when declaring the regex in System Configuration page

          Benoît CHOMEL created issue -
          Benoît CHOMEL made changes -
          Description Original: Hello,

          I have an issue with a regex that does not trigger any warning when set as a console output parser in a job, but seems to be correctly formatted and working in the System Configuration page :(

          +Here are all the details of my sample:+
          I created the following sample regex in the System Configuration page:
          (start(?:(?!start)[\s\S])*?end step: runtimedata.*)

          With the following Groovy script:
          import hudson.plugins.warnings.parser.Warning
          import hudson.plugins.analysis.util.model.Priority
          String type = "TEST"
          String category = "runtimedata"
          String errors = matcher.group(1)
          return new Warning("", 0, type, category, errors, Priority.HIGH);

          It is supposed to retrieve the lines in red in the following sample:
          start step: at 06/01/2016-12:05:42
          end step: jsruler at 06/01/2016-12:05:42
          {color:#d04437}start step: at 06/01/2016-12:05:42
          some details here
          on several lines
          end step: runtimedata at 06/01/2016-12:05:42{color}
          start step: at 06/01/2016-12:05:42
          end step: dummynls at 06/01/2016-12:05:42

          This works correctly when I create the regex and put the exact same sample text in the "Example Log Message" field:
          One warning found
          file name:
          line number: 0
          priority: High Priority
          category: headerruler
          type: TEST
          message: start step: runtimed[...]data at 06/01/2016-12:05:42

          FYI, I've also tested the regex in several online tools and it works.

          However, when I run a job with the exact same trace in the console output and set the corresponding regex to parse it, no warning is found.
          Please note that this behavior happens only with regex with the pattern (?:(?!someString)

          I looked for answers in forums and such but I haven't been able find anyone else encountering this issue. Since I feel like it is specific to some regex patterns, it might be that nobody else tried this...

          I hope you can find the explanation and correct this, it is quite a pain for me to work around this! Feel free to request any additional information I might have forgotten.

          Best Regards,
          Tyoneb
          New: Hello,

          I have an issue with a regex that does not trigger any warning when set as a console output parser in a job, but seems to be correctly formatted and working in the System Configuration page :(

          +Here are all the details of my sample:+
          I created the following sample regex in the System Configuration page:

          {code:java}
          (start(?:(?!start)[\s\S])*?end step: runtimedata.*)
          {code}


          With the following Groovy script:
          import hudson.plugins.warnings.parser.Warning
          import hudson.plugins.analysis.util.model.Priority
          String type = "TEST"
          String category = "runtimedata"
          String errors = matcher.group(1)
          return new Warning("", 0, type, category, errors, Priority.HIGH);

          It is supposed to retrieve the lines in red in the following sample:
          start step: at 06/01/2016-12:05:42
          end step: jsruler at 06/01/2016-12:05:42
          {color:#d04437}start step: at 06/01/2016-12:05:42
          some details here
          on several lines
          end step: runtimedata at 06/01/2016-12:05:42{color}
          start step: at 06/01/2016-12:05:42
          end step: dummynls at 06/01/2016-12:05:42

          This works correctly when I create the regex and put the exact same sample text in the "Example Log Message" field:
          One warning found
          file name:
          line number: 0
          priority: High Priority
          category: headerruler
          type: TEST
          message: start step: runtimed[...]data at 06/01/2016-12:05:42

          FYI, I've also tested the regex in several online tools and it works.

          However, when I run a job with the exact same trace in the console output and set the corresponding regex to parse it, no warning is found.
          Please note that this behavior happens only with regex with the pattern (?:(?!someString)

          I looked for answers in forums and such but I haven't been able find anyone else encountering this issue. Since I feel like it is specific to some regex patterns, it might be that nobody else tried this...

          I hope you can find the explanation and correct this, it is quite a pain for me to work around this! Feel free to request any additional information I might have forgotten.

          Best Regards,
          Tyoneb
          Benoît CHOMEL made changes -
          Description Original: Hello,

          I have an issue with a regex that does not trigger any warning when set as a console output parser in a job, but seems to be correctly formatted and working in the System Configuration page :(

          +Here are all the details of my sample:+
          I created the following sample regex in the System Configuration page:

          {code:java}
          (start(?:(?!start)[\s\S])*?end step: runtimedata.*)
          {code}


          With the following Groovy script:
          import hudson.plugins.warnings.parser.Warning
          import hudson.plugins.analysis.util.model.Priority
          String type = "TEST"
          String category = "runtimedata"
          String errors = matcher.group(1)
          return new Warning("", 0, type, category, errors, Priority.HIGH);

          It is supposed to retrieve the lines in red in the following sample:
          start step: at 06/01/2016-12:05:42
          end step: jsruler at 06/01/2016-12:05:42
          {color:#d04437}start step: at 06/01/2016-12:05:42
          some details here
          on several lines
          end step: runtimedata at 06/01/2016-12:05:42{color}
          start step: at 06/01/2016-12:05:42
          end step: dummynls at 06/01/2016-12:05:42

          This works correctly when I create the regex and put the exact same sample text in the "Example Log Message" field:
          One warning found
          file name:
          line number: 0
          priority: High Priority
          category: headerruler
          type: TEST
          message: start step: runtimed[...]data at 06/01/2016-12:05:42

          FYI, I've also tested the regex in several online tools and it works.

          However, when I run a job with the exact same trace in the console output and set the corresponding regex to parse it, no warning is found.
          Please note that this behavior happens only with regex with the pattern (?:(?!someString)

          I looked for answers in forums and such but I haven't been able find anyone else encountering this issue. Since I feel like it is specific to some regex patterns, it might be that nobody else tried this...

          I hope you can find the explanation and correct this, it is quite a pain for me to work around this! Feel free to request any additional information I might have forgotten.

          Best Regards,
          Tyoneb
          New: Hello,

          I have an issue with a regex that does not trigger any warning when set as a console output parser in a job, but seems to be correctly formatted and working in the System Configuration page :(

          +Here are all the details of my sample:+
          I created the following sample regex in the System Configuration page:

          {code:java}
          (start(?:(?!start)[\s\S])*?end step: runtimedata.*)
          {code}


          With the following Groovy script:

          {code:java}
          import hudson.plugins.warnings.parser.Warning
          import hudson.plugins.analysis.util.model.Priority
          String type = "TEST"
          String category = "runtimedata"
          String errors = matcher.group(1)
          return new Warning("", 0, type, category, errors, Priority.HIGH);
          {code}


          It is supposed to retrieve the lines in red in the following sample:

          {code:java}
          start step: at 06/01/2016-12:05:42
          end step: jsruler at 06/01/2016-12:05:42
          {color:#d04437}start step: at 06/01/2016-12:05:42
          some details here
          on several lines
          end step: runtimedata at 06/01/2016-12:05:42{color}
          start step: at 06/01/2016-12:05:42
          end step: dummynls at 06/01/2016-12:05:42
          {code}


          This works correctly when I create the regex and put the exact same sample text in the "Example Log Message" field:

          {code:java}
          One warning found
          file name:
          line number: 0
          priority: High Priority
          category: headerruler
          type: TEST
          message: start step: runtimed[...]data at 06/01/2016-12:05:42
          {code}


          FYI, I've also tested the regex in several online tools and it works.

          However, when I run a job with the exact same trace in the console output and set the corresponding regex to parse it, no warning is found.
          Please note that this behavior happens only with regex with the pattern (?:(?!someString)

          I looked for answers in forums and such but I haven't been able find anyone else encountering this issue. Since I feel like it is specific to some regex patterns, it might be that nobody else tried this...

          I hope you can find the explanation and correct this, it is quite a pain for me to work around this! Feel free to request any additional information I might have forgotten.

          Best Regards,
          Tyoneb
          Benoît CHOMEL made changes -
          Description Original: Hello,

          I have an issue with a regex that does not trigger any warning when set as a console output parser in a job, but seems to be correctly formatted and working in the System Configuration page :(

          +Here are all the details of my sample:+
          I created the following sample regex in the System Configuration page:

          {code:java}
          (start(?:(?!start)[\s\S])*?end step: runtimedata.*)
          {code}


          With the following Groovy script:

          {code:java}
          import hudson.plugins.warnings.parser.Warning
          import hudson.plugins.analysis.util.model.Priority
          String type = "TEST"
          String category = "runtimedata"
          String errors = matcher.group(1)
          return new Warning("", 0, type, category, errors, Priority.HIGH);
          {code}


          It is supposed to retrieve the lines in red in the following sample:

          {code:java}
          start step: at 06/01/2016-12:05:42
          end step: jsruler at 06/01/2016-12:05:42
          {color:#d04437}start step: at 06/01/2016-12:05:42
          some details here
          on several lines
          end step: runtimedata at 06/01/2016-12:05:42{color}
          start step: at 06/01/2016-12:05:42
          end step: dummynls at 06/01/2016-12:05:42
          {code}


          This works correctly when I create the regex and put the exact same sample text in the "Example Log Message" field:

          {code:java}
          One warning found
          file name:
          line number: 0
          priority: High Priority
          category: headerruler
          type: TEST
          message: start step: runtimed[...]data at 06/01/2016-12:05:42
          {code}


          FYI, I've also tested the regex in several online tools and it works.

          However, when I run a job with the exact same trace in the console output and set the corresponding regex to parse it, no warning is found.
          Please note that this behavior happens only with regex with the pattern (?:(?!someString)

          I looked for answers in forums and such but I haven't been able find anyone else encountering this issue. Since I feel like it is specific to some regex patterns, it might be that nobody else tried this...

          I hope you can find the explanation and correct this, it is quite a pain for me to work around this! Feel free to request any additional information I might have forgotten.

          Best Regards,
          Tyoneb
          New: Hello,

          I have an issue with a regex that does not trigger any warning when set as a console output parser in a job, but seems to be correctly formatted and working in the System Configuration page :(

          +Here are all the details of my sample:+
          I created the following sample regex in the System Configuration page:

          {code:java}
          (start(?:(?!start)[\s\S])*?end step: runtimedata.*)
          {code}


          With the following Groovy script:

          {code:java}
          import hudson.plugins.warnings.parser.Warning
          import hudson.plugins.analysis.util.model.Priority
          String type = "TEST"
          String category = "runtimedata"
          String errors = matcher.group(1)
          return new Warning("", 0, type, category, errors, Priority.HIGH);
          {code}


          It is supposed to retrieve the lines in red in the following sample:
          start step: at 06/01/2016-12:05:42
          end step: jsruler at 06/01/2016-12:05:42
          {color:#d04437}start step: at 06/01/2016-12:05:42
          some details here
          on several lines
          end step: runtimedata at 06/01/2016-12:05:42{color}
          start step: at 06/01/2016-12:05:42
          end step: dummynls at 06/01/2016-12:05:42


          This works correctly when I create the regex and put the exact same sample text in the "Example Log Message" field:

          {code:java}
          One warning found
          file name:
          line number: 0
          priority: High Priority
          category: headerruler
          type: TEST
          message: start step: runtimed[...]data at 06/01/2016-12:05:42
          {code}


          FYI, I've also tested the regex in several online tools and it works.

          However, when I run a job with the exact same trace in the console output and set the corresponding regex to parse it, no warning is found.
          Please note that this behavior happens only with regex with the pattern (?:(?!someString)

          I looked for answers in forums and such but I haven't been able find anyone else encountering this issue. Since I feel like it is specific to some regex patterns, it might be that nobody else tried this...

          I hope you can find the explanation and correct this, it is quite a pain for me to work around this! Feel free to request any additional information I might have forgotten.

          Best Regards,
          Tyoneb
          SCM/JIRA link daemon made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]
          Benoît CHOMEL made changes -
          Resolution Original: Fixed [ 1 ]
          Status Original: Resolved [ 5 ] New: Reopened [ 4 ]
          SCM/JIRA link daemon made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: Reopened [ 4 ] New: Resolved [ 5 ]
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 171503 ] New: JNJira + In-Review [ 199119 ]

            drulli Ulli Hafner
            tyoneb Benoît CHOMEL
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: