-
-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make FindBugs effort and threshold configurable #84
Make FindBugs effort and threshold configurable #84
Conversation
This change makes the default configuration of FindBugs much more paranoid. On the Low level there are many Not-important issues, but experience of jenkinsci/envinject-lib#13 shows that otherwise we may miss real NPE risks in Jenkins.
This pull request originates from a CloudBees employee. At CloudBees, we require that all pull requests be reviewed by other CloudBees employees before we seek to have the change accepted. If you want to learn more about our process please see this explanation. |
I am worried that this is the wrong direction. Could you provide some examples of real issues that are actually caught by this level in the current codebase. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Finding more bugs, OK. I guess we will find out if there are a ton of false positives.
@stephenc see the example I have referenced in the PR description: jenkinsci/envinject-lib#13. There is a missing |
In the worst case there is a property which can be set by plugins when they get upgraded. |
i’d rather see the property updated on CI jobs and leave local builds faster by default. I fear this will just be another Could we do a poll of plugin developers to see their preferences. While findbugs at its current level finds enough real bugs that I don’t want to turn it off, it’s close enough with false positives that I continue to want to turn it off. The PR you cite as an example even contains “incorrect” suppression of findbugs warnings, presumably to get the build to pass... which feels like a warning sign to me. Just my €0.02 |
I'm using max by default everywhere. The only inconvenient thing that i should annotate method instance of single call that i want suppress. The second is that requireNonNull, Objects.isNull() doesn't work with findbugs inspection. Waiting for spotbugs... |
Any change for findbugs should IMO also come hand in hand with spotbogs 3.1 and replace JSR305 given it is dead and no more... (the spotbugs annotations are no longer deprecated!) |
It is in my longer-term TODO list. This change will likely require Plugin POM 4.x, but it's something I want to do for better integration with https://github.com/jenkinsci/pom (will likely require JEP as well). |
When using |
Yes, I do not see an issue with build duration. Anyway, FindBugs contributes less that a couple of JTH test cases. Regarding the impact on plugins, it's proposed for Plugin Pom 3.0 for a reason.
The only suppressions in my PR is
I will raise a mailing list thread for that |
pom.xml
Outdated
@@ -65,6 +65,10 @@ | |||
<!-- Whether the build should fail if findbugs finds any error. --> | |||
<!-- It is strongly encouraged to leave it as true. Use false with care only in transient situations. --> | |||
<findbugs.failOnError>true</findbugs.failOnError> | |||
<!-- Defines a default FindBugs threshold. --> | |||
<!-- In Plugin POM 2.x the default value was Medium, but it was not enough to discover some null handling cases --> | |||
<findbugs.threshold>Low</findbugs.threshold> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm OK with the idea, a bit more unsure about the ratio of false-positives this could detect.
Currently, I like the fact I'm not bothered that often, and when I do it's almost always a good catch. I wouldn't like to see dozens of errors with only 1 actual in the middle.
As an aside:
Unless the class is defined in I seem to recall users of IBM J9 agents complaining that this JVM inferred a different default |
@jglick it's foggy for me too, because from ~10 years ago, but I can relate, and do remember the same experience with |
@jenkinsci/code-reviewers might want to weigh in here. |
on what level |
@reviewbybees @jenkinsci/code-reviewers I have reverted the defaults change for now, but I made the parameter configurable at least. So it unblocks my use-cases without changing the default behavior. PTAL. |
IIRC it does not even with the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
pom.xml
Outdated
--> | ||
<findbugs.threshold>Medium</findbugs.threshold> | ||
<!-- Defines a FindBugs effor. Use "Max" to maximize the scan depth --> | ||
<findbugs.effort>default</findbugs.effort> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only reason I am
Ok with these properties - rather than plugins just shock horror configuring the standard Maven way - is because it allows CLI override which enables easier exploration of the potential impact of changing these levels
Yes, it is one of the reasons. |
This change makes the default configuration of FindBugs much more paranoid about potential issues. #83 bumps the Parent POM to 3.x, so I feel it is a good time to introduce it.
On the Low level there are some Not-important issues, but the experience in jenkinsci/envinject-lib#13 shows that otherwise we may miss real NPE risks in Jenkins.
@reviewbybees @jglick @batmat