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
HBASE-24065 Enable SpotBugs in PreCommit #1364
Conversation
Yetus's SpotBugs module depends on `maven_add_install`. In `Jenkinsfile_GitHub`, I'm pretty strict on my module definitions, with ``` GENERAL_CHECK_PLUGINS = 'all,-compile,-javac,-javadoc,-jira,-shadedjars,-unit' JDK_SPECIFIC_PLUGINS = 'compile,github,htmlout,javac,javadoc,maven,mvninstall,shadedjars,unit' ``` The general check requests all but omits `compile` and `maven`, which I think means the `spotbugs` check gets dropped. Before HBASE-23767, we had just a single yetus that did all, so spotbugs would have been run.
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
4a9f96a
to
46000cc
Compare
🎊 +1 overall
This message was automatically generated. |
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.
LGTM. Try it. Comment below
@@ -46,6 +46,7 @@ pipeline { | |||
TESTS_FILTER = 'cc,checkstyle,javac,javadoc,pylint,shellcheck,whitespace,perlcritic,ruby-lint,rubocop,mvnsite' | |||
EXCLUDE_TESTS_URL = "${JENKINS_URL}/job/HBase-Find-Flaky-Tests/job/${CHANGE_TARGET}/lastSuccessfulBuild/artifact/excludes" | |||
|
|||
//// |
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.
?
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.
Trying to distinguish between comments that describe the following section of code vs. comments that describe the following line. Suggestions?
PLUGINS = "${JDK_SPECIFIC_PLUGINS}" | ||
// | ||
// run SpotBugs only once, and run it on JDK8. | ||
PLUGINS = "${JDK_SPECIFIC_PLUGINS},spotbugs" |
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.
It used to be -findbugs with hyphen. No need of it when doing spotbugs?
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.
-fingbugs
explicitly disabled findbugs. I'm trying to explicitly enable spotbugs
. The two appear to be driven by the same yetus "check", so I'm attempting to ensure that module is enabled. Because we don't ship findbugs binaries in our Dockerfile anymore, I think that "check" will do the right thing, as long as it's enabled (see earlier comments re: that check also requiring the maven
check as a dependency).
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 -fingbugs is from the release note of yetus, as the official way to enable spotbugs.
https://issues.apache.org/jira/browse/YETUS-749
Of course I haven't checked the code of yetus so maybe specify spotbugs also works.
🎊 +1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
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.
Something looks off here. Is it just me or has the spotbugs disappeared from the build report?
The way I read https://issues.apache.org/jira/browse/YETUS-749 is --> -findbugs with SPOTBUGS_HOME set enables spotbugs. no? I thought this is what HBASE-23077 did. After HBASE-23077 I do see spot bugs warnings in the github PRs, is there something additional that we are trying to generate?
That's what I'm trying to enable here. I think the functionality was dropped in HBASE-23077 or HBASE-23767.
Ah thanks, I hadn't read the Yetus side of the feature change. I believe that when I'm currently thinking there's a plugin dependency for spotbugs that I'm missing because of the explicit omission of |
Oh, unless spotbugs only runs when a java file is modified... function spotbugs_filefilter
{
declare filename=$1
if [[ ${BUILDTOOL} == maven
|| ${BUILDTOOL} == ant ]]; then
if [[ ${filename} =~ \.java$
|| ${filename} =~ (^|/)${SPOTBUGS_MODE}-exclude.xml$ ]]; then
add_test "${SPOTBUGS_MODE}"
fi
fi
} |
46000cc
to
5e33ccf
Compare
that worked! |
🎊 +1 overall
This message was automatically generated. |
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.
Perfect..nice catch.
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.
To be honest I do not get the point here, what's the problem for the current pre commit spotbugs? It is run in the general check section, you want to move it to the jdk8 specific section? why?
PLUGINS = "${JDK_SPECIFIC_PLUGINS}" | ||
// | ||
// run SpotBugs only once, and run it on JDK8. | ||
PLUGINS = "${JDK_SPECIFIC_PLUGINS},spotbugs" |
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 -fingbugs is from the release note of yetus, as the official way to enable spotbugs.
https://issues.apache.org/jira/browse/YETUS-749
Of course I haven't checked the code of yetus so maybe specify spotbugs also works.
🎊 +1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
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.
what's the problem for the current pre commit spotbugs? It is run in the general check section, you want to move it to the jdk8 specific section? why?
@Apache9 My last question was exactly this.
The way I read https://issues.apache.org/jira/browse/YETUS-749 is --> -findbugs with SPOTBUGS_HOME set enables spotbugs. no? I thought this is what HBASE-23077 did. After HBASE-23077 I do see spot bugs warnings in the github PRs, is there something additional that we are trying to generate?
I think the patch refactors to use a more sensible query option "spotbugs" rather than un-intuitive -findbugs, but I see your point that it can be run as a part of general checks itself . @ndimiduk can probably can answer that part.
Should we do the cosmetic change of -findbugs -> spotbugs? '-findbugs' is misleading for the readers if they don't know '-' actually disables the configs :-) |
I think the |
Yetus's SpotBugs module depends on
maven_add_install
. InJenkinsfile_GitHub
, I'm pretty strict on my module definitions, withThe general check requests all but omits
compile
andmaven
, whichI think means the
spotbugs
check gets dropped. Before HBASE-23767,we had just a single yetus that did all, so spotbugs would have been
run.