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

Show violations on build page

XMLWordPrintable

    • 5.0.0-beta2

      Please make the Warnings Plugin output on the build result page whether or not the threshold has been exceeded (and if so, how) similar to how Checkstyle, PMD, CPD etc. checks in Jenkins show that.

      Example 1: Task Scanner Plugin Output

      Here is a screenshot of what the Task Scanner plugin shows:

      Notice the explanatory details below the first line.

      Example 2: Warnings Plugin Output

      And then here is what the Warnings Plugin shows:

      Notice the lack of details below the first line. There are 5 High Priority issues that are blocking the build from being consider Stable, but you would not be able to tell from this.
       

      Steps to Reproduce

      1. Configure the Warnings Plugin in Manage Jenkins with the following Parser:
        • Name: Generic Log Analysis
        • Link name: Generic Log Analysis
        • Trend report name: Generic Log Analysis
        • Regular expression:
          .*(FATAL|fatal|SEVERE|severe|ERROR|error|WARN|warn|WARNING|warning|NOTICE|notice|FIXME|fixme|TODO|XXX)[:\]\s]+(.*)
        • Mapping script:
          import hudson.plugins.warnings.parser.Warning
          import hudson.plugins.analysis.util.model.Priority
          
          String fileName = ""
          String lineNumber = ""
          String category = ""
          String type = matcher.group(1)
          String message = type + ": " + matcher.group(2)
          
          Priority prio = Priority.HIGH 
          if (type == "WARN" || type == "warn" || type == "WARNING" || type == "warning" || type == "TODO") {
          prio = Priority.NORMAL;
          } else if (type == "NOTICE" || type == "XXX") {
          prio = Priority.NORMAL;
          }
          
          return new Warning(fileName, 0, "Generic Log Analysis Parser", category, message, prio);
        • Example log message:
          Bla [warn] There is something wrong
      2. Create a pipeline job with this invocation of the Warnings Plugin:
        warnings canComputeNew: false, defaultEncoding: 'UTF-8', shouldDetectModules: params.DETECT_MODULES, unstableTotalHigh: '0', includePattern: '', excludePattern: '', healthy: '', unHealthy: '', messagesPattern: '', canResolveRelativePaths: false, consoleParsers: [[parserName: 'Generic Log Analysis']]
      3. In the pipeline script, echo an error, e.g.:
        echo "ERROR: This should trigger the Warnings Plugin"
      4. Run the pipeline job.

      Expected Result

      1. Build finishes successfully.
      2. Build status is UNSTABLE.
      3. 1 high-priority issue is raised by the Warnings Plugin.
      4. On the build page, there is a section labeled “Generic Log Analysis” and it lists 1 warning.
      5. In that section there is an indication that a threshold has been exceeded, similar to Checkstyle, PMD, CPD etc. checks in Jenkins.

      Actual Result

      1.  Build finishes successfully.
      2.  Build status is UNSTABLE.
      3.  1 high-priority issue is raised by the Warnings Plugin.
      4.  On the build page, there is a section labeled “Generic Log Analysis” and it lists 1 warning.
      5.  In that section there is no indication that a threshold has been exceeded.

            drulli Ulli Hafner
            znerd Ernst de Haan
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: