[ 
https://issues.apache.org/jira/browse/KAFKA-6428?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16317170#comment-16317170
 ] 

ASF GitHub Bot commented on KAFKA-6428:
---------------------------------------

ewencp closed pull request #4398: KAFKA-6428: Generate findbugs output for CI 
and fail builds for 'high' level warnings
URL: https://github.com/apache/kafka/pull/4398
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/README.md b/README.md
index 9371e482169..7db602325c8 100644
--- a/README.md
+++ b/README.md
@@ -182,13 +182,16 @@ The checkstyle warnings will be found in 
`reports/checkstyle/reports/main.html`
 subproject build directories. They are also are printed to the console. The 
build will fail if Checkstyle fails.
 
 #### Findbugs ####
-Findbugs uses static analysis to look for bugs in the code.
+Findbugs uses static analysis to look for bugs in the code. Findbugs is 
executed as part of the normal build process
+and will be included in CI testing. Normally xml reports are generated which 
are not very human readable unless processed
+by Jenkins. If you want to use check Findbugs results during development, run 
it so it generates HTML output:
+
 You can run findbugs using:
 
-    ./gradlew findbugsMain findbugsTest -x test
+    ./gradlew findbugsMain findbugsTest -x test -PhtmlFindBugsReport=true
 
 The findbugs warnings will be found in `reports/findbugs/main.html` and 
`reports/findbugs/test.html` files in the subproject build
-directories.  Use -PxmlFindBugsReport=true to generate an XML report instead 
of an HTML one.
+directories.
 
 ### Common build options ###
 
diff --git a/build.gradle b/build.gradle
index 725cf0b8bb2..bdbf0fbe6bb 100644
--- a/build.gradle
+++ b/build.gradle
@@ -371,13 +371,14 @@ subprojects {
       toolVersion = "3.0.1"
       excludeFilter = file("$rootDir/gradle/findbugs-exclude.xml")
       ignoreFailures = false
+      reportLevel = "high"
     }
     test.dependsOn('findbugsMain')
 
     tasks.withType(FindBugs) {
       reports {
-        xml.enabled(project.hasProperty('xmlFindBugsReport'))
-        html.enabled(!project.hasProperty('xmlFindBugsReport'))
+        xml.enabled(!project.hasProperty('htmlFindBugsReport'))
+        html.enabled(project.hasProperty('htmlFindBugsReport'))
       }
     }
   }


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Fail builds on findbugs warnings
> --------------------------------
>
>                 Key: KAFKA-6428
>                 URL: https://issues.apache.org/jira/browse/KAFKA-6428
>             Project: Kafka
>          Issue Type: Improvement
>          Components: build
>            Reporter: Ewen Cheslack-Postava
>            Assignee: Ewen Cheslack-Postava
>
> Findbugs spots likely bugs, and especially for warnings at the High level, it 
> actually has pretty good signal for real bugs (or just things that might be 
> risky). We should be failing builds, especially PRs, if any sufficiently high 
> warnings are listed. We should get this enabled for that level and then 
> decide if we want to adjust the level of warnings we want to address.
> This likely relates to KAFKA-5887 since findbugs may not be sufficiently 
> maintained for JDK9 support. In any case, the intent is to fail the build 
> based on whichever tool is used.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to