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

Aggregated maven result shows empty data when a module fails the build due to a threshold being hit

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • analysis-core-plugin
    • None
    • email-ext 2.24.1, jenkins 1.483, findbugs plugin 4.44, Static Analysis Utilities 1.47

      Maven aggregation results are not computed if the build failed during a maven module (due to a threshold being hit). I.e., the build creates a maven module result with status failure. However, the aggregation action on job level does not show these results.

        1. build.xml
          7 kB
        2. config.xml
          7 kB
        3. screenshot-1.jpg
          screenshot-1.jpg
          210 kB
        4. screenshot-2.jpg
          screenshot-2.jpg
          67 kB
        5. screenshot-3.jpg
          screenshot-3.jpg
          67 kB
        6. screenshot-4.jpg
          screenshot-4.jpg
          60 kB
        7. stat.png
          stat.png
          12 kB
        8. static-analysis.jelly
          15 kB

          [JENKINS-15324] Aggregated maven result shows empty data when a module fails the build due to a threshold being hit

          Ulli Hafner added a comment -

          Can you please clarify your expectations? Did you enable the flag to run findbugs for failed builds, too? Maybe this flag needs to be clarified when used in conjunction with maven projects...

          Ulli Hafner added a comment - Can you please clarify your expectations? Did you enable the flag to run findbugs for failed builds, too? Maybe this flag needs to be clarified when used in conjunction with maven projects...

          hhuynh added a comment -

          My goal is to fail our build if there is new Finbugs error introduced into the code base and having the email reflects number of new errors that findbugs plugin found.

          These are the options that are selected for the Finbugs plugin:

          • Run always
          • Compute new warnings (based on reference build)
          • Use delta for new warnings
          • Only use stable builds as reference
          • Status thresholds (New warnings): All priorities set to 0

          As a test, after a first run, the job passed since it's first ever run and no new findbugs errors found. The email showed Findbugs statistics just fine.
          Then I intentionally checked in a Findbugs error to the one of my source class, the build ran and failed this time because Findbugs plugin saw the new warning threshold of 0 has been breached. Here is where the bug I filed came in: the email content of Findbugs statistics are all 0's (used to be empty strings). So you know that your build failed but you don't know that it failed because Findbugs found new errors. This email is quite vague to a developer.

          Also, this bug only exposes when you use a Maven style job. A freestyle job generates the right content in the email when the build failed due to Findbugs.

          hhuynh added a comment - My goal is to fail our build if there is new Finbugs error introduced into the code base and having the email reflects number of new errors that findbugs plugin found. These are the options that are selected for the Finbugs plugin: Run always Compute new warnings (based on reference build) Use delta for new warnings Only use stable builds as reference Status thresholds (New warnings): All priorities set to 0 As a test, after a first run, the job passed since it's first ever run and no new findbugs errors found. The email showed Findbugs statistics just fine. Then I intentionally checked in a Findbugs error to the one of my source class, the build ran and failed this time because Findbugs plugin saw the new warning threshold of 0 has been breached. Here is where the bug I filed came in: the email content of Findbugs statistics are all 0's (used to be empty strings). So you know that your build failed but you don't know that it failed because Findbugs found new errors. This email is quite vague to a developer. Also, this bug only exposes when you use a Maven style job. A freestyle job generates the right content in the email when the build failed due to Findbugs.

          Ulli Hafner added a comment -

          Ok, just to make sure: what is reported in the web page of the build? Are there the correct results reported?

          Ulli Hafner added a comment - Ok, just to make sure: what is reported in the web page of the build? Are there the correct results reported?

          hhuynh added a comment -

          the report in the webpage is correct.

          hhuynh added a comment - the report in the webpage is correct.

          Ulli Hafner added a comment -

          Can you please show a screenshot of the build page of your maven project? Is there a difference between the stable and the failed build? When the result is there then it should be possible to navigate to the results in the email, too.

          Ulli Hafner added a comment - Can you please show a screenshot of the build page of your maven project? Is there a difference between the stable and the failed build? When the result is there then it should be possible to navigate to the results in the email, too.

          hhuynh added a comment -

          I rerun it and took the a closer look and realized both Findbugs Warnings and Static Analysis Warnings disappeared after the failed run. I had to refresh the page to see that (otherwise, it would look like they're still there but they're actually links from successful build earlier). Screenshot attached. I have a temporarily instance of Jenkins running here http://173.167.103.153:8080

          hhuynh added a comment - I rerun it and took the a closer look and realized both Findbugs Warnings and Static Analysis Warnings disappeared after the failed run. I had to refresh the page to see that (otherwise, it would look like they're still there but they're actually links from successful build earlier). Screenshot attached. I have a temporarily instance of Jenkins running here http://173.167.103.153:8080

          Ulli Hafner added a comment -

          Ok, I see. Then the problem is not in email only. It is in the internal logic of the maven code: the aggregating action is not created when the build failed in a maven module.

          Until this is fixed you can use as a workaround the unstable thresholds and not the failed ones (i.e. a warning sets the build to unstable). Alternatively, as you already described use the freestyle project.

          Ulli Hafner added a comment - Ok, I see. Then the problem is not in email only. It is in the internal logic of the maven code: the aggregating action is not created when the build failed in a maven module. Until this is fixed you can use as a workaround the unstable thresholds and not the failed ones (i.e. a warning sets the build to unstable). Alternatively, as you already described use the freestyle project.

          hhuynh added a comment -

          Thank you. I'm glad we got some root cause of it. I've tried unstable thresholds and it's not quite working right either. HIGH, NORMAL and LOW counts are there but not the NEW or FIXED counts (still 0).

          I've used these calls:

          ${action.result.getNumberOfFixedWarnings()}
          ${action.result.getNumberOfNewWarnings()}

          which are available in class hudson.plugins.findbugs.FindBugsReporterResult (which is ${action.result.getClass()})

          I can't use freestyle jobs unfortunately because we're relying on Maven dependencies fingerprints for our upstream/downstream relationships (we have a lot of projects)

          hhuynh added a comment - Thank you. I'm glad we got some root cause of it. I've tried unstable thresholds and it's not quite working right either. HIGH, NORMAL and LOW counts are there but not the NEW or FIXED counts (still 0). I've used these calls: ${action.result.getNumberOfFixedWarnings()} ${action.result.getNumberOfNewWarnings()} which are available in class hudson.plugins.findbugs.FindBugsReporterResult (which is ${action.result.getClass()}) I can't use freestyle jobs unfortunately because we're relying on Maven dependencies fingerprints for our upstream/downstream relationships (we have a lot of projects)

          Code changed in jenkins
          User: Ulli Hafner
          Path:
          src/main/java/hudson/plugins/analysis/core/MavenResultAction.java
          http://jenkins-ci.org/commit/analysis-core-plugin/b506c418b4b3579d7cb71f31498cdbc21bbfc618
          Log:
          [FIXED JENKINS-15324] Aggregate build results if a failed build is
          caused by a plugin threshold.


          You received this message because you are subscribed to the Google Groups "Jenkins Commits" group.
          To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-commits+unsubscribe@googlegroups.com.
          For more options, visit https://groups.google.com/groups/opt_out.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Ulli Hafner Path: src/main/java/hudson/plugins/analysis/core/MavenResultAction.java http://jenkins-ci.org/commit/analysis-core-plugin/b506c418b4b3579d7cb71f31498cdbc21bbfc618 Log: [FIXED JENKINS-15324] Aggregate build results if a failed build is caused by a plugin threshold. – You received this message because you are subscribed to the Google Groups "Jenkins Commits" group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-commits+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out .

          Ulli Hafner added a comment -

          Integrated in Jenkins Analysis Plug-ins (Compile) #609
          [FIXED JENKINS-15324] Aggregate build results if a failed build is (Revision b506c418b4b3579d7cb71f31498cdbc21bbfc618)

          Result = SUCCESS

          Ulli Hafner added a comment - Integrated in Jenkins Analysis Plug-ins (Compile) #609 [FIXED JENKINS-15324] Aggregate build results if a failed build is (Revision b506c418b4b3579d7cb71f31498cdbc21bbfc618) Result = SUCCESS

            drulli Ulli Hafner
            hhuynh hhuynh
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: