-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-22269][BUILD] Run Java linter via SBT for Jenkins #21399
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
Conversation
|
Test build #90973 has started for PR 21399 at commit |
|
This is the one? Finally, nice! @HyukjinKwon . |
|
Thanks @dongjoon-hyun. BTW, I am pushing some commits to check if it works in Jenkins and show the results. |
|
Test build #90976 has finished for PR 21399 at commit
|
project/SparkBuild.scala
Outdated
| ) | ||
| } | ||
|
|
||
| object CheckStyle { |
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.
How about call it as CheckJavaStyle.
CheckStyle seems a broad concept which should include scala style chceck.
And dev/sbt-checkstyle -> dev/sbt-checkjavastyle or similar
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.
sbt-checkstyle is actually a package name which is consistent in dev scripts.
CheckStyle is also a package name like Unidoc.
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.
Let me fix CheckStyle to Checkstyle while I am here btw.
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.
Ah, I see.
Thanks for clarification as it's a bit confusing.
| libraryDependencies += "com.puppycrawl.tools" % "checkstyle" % "8.2" | ||
|
|
||
| // checkstyle uses guava 23.0. | ||
| libraryDependencies += "com.google.guava" % "guava" % "23.0" |
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 a little surprised this is not causing other problems... when I was testing this, it was overriding Spark's own Guava import (which is version 14).
But if it works, awesome.
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.
Yea but it's plugin dependency here. I was a little surprised too because I was stuck here for a while.
|
Let me push some more commits in main code and test code too to double check. |
|
Test build #90983 has finished for PR 21399 at commit
|
|
Test build #90982 has finished for PR 21399 at commit
|
|
Test build #90980 has finished for PR 21399 at commit
|
|
Test build #90977 has finished for PR 21399 at commit
|
|
Test build #90984 has finished for PR 21399 at commit
|
|
retest this please |
|
Test build #91000 has finished for PR 21399 at commit
|
|
@vanzin, I will leave it to you as I believe you are the most appropriate one to review this - I assume the approach you initially took is the same with this. I feel quite sure on the current change FWIW. |
vanzin
left a comment
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.
Let me check what things look like after the build is finished, but otherwise this looks good.
| for f in changed_files): | ||
| # run_java_style_checks() | ||
| pass | ||
| run_java_style_checks() |
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.
This is really minor, but now you'll be running this when building with maven too. That could be avoided by checking that the build is not using maven; and also changing the maven target from package to verify so that these checks run.
You can add [build-maven] to the PR title to try it out (or locally with AMPLAB_JENKINS_BUILD_TOOL=maven).
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.
no problem.
|
Checked locally and looks good. Feel free to merge if you don't want to address the comment above in this PR. |
|
retest this please |
|
Test build #91076 has finished for PR 21399 at commit
|
|
Test build #91084 has finished for PR 21399 at commit
|
|
^ this one was ran with Maven. I am merging this in. |
|
Merged to master. Thanks all, @dongjoon-hyun, @advancedxy, @vanzin and @felixcheung. |
|
Test build #91085 has finished for PR 21399 at commit
|
## What changes were proposed in this pull request? #12980 added Travis CI file mainly for linter because we disabled Java lint check in Jenkins. It's enabled as of #21399 and now SBT runs it. Looks we can now remove the file added before. ## How was this patch tested? N/A Closes #22665 Closes #22667 from HyukjinKwon/SPARK-25673. Authored-by: hyukjinkwon <[email protected]> Signed-off-by: hyukjinkwon <[email protected]> (cherry picked from commit 2199224) Signed-off-by: hyukjinkwon <[email protected]>
## What changes were proposed in this pull request? apache#12980 added Travis CI file mainly for linter because we disabled Java lint check in Jenkins. It's enabled as of apache#21399 and now SBT runs it. Looks we can now remove the file added before. ## How was this patch tested? N/A Closes apache#22665 Closes apache#22667 from HyukjinKwon/SPARK-25673. Authored-by: hyukjinkwon <[email protected]> Signed-off-by: hyukjinkwon <[email protected]>
## What changes were proposed in this pull request? apache#12980 added Travis CI file mainly for linter because we disabled Java lint check in Jenkins. It's enabled as of apache#21399 and now SBT runs it. Looks we can now remove the file added before. ## How was this patch tested? N/A Closes apache#22665 Closes apache#22667 from HyukjinKwon/SPARK-25673. Authored-by: hyukjinkwon <[email protected]> Signed-off-by: hyukjinkwon <[email protected]>
What changes were proposed in this pull request?
This PR proposes to check Java lint via SBT for Jenkins. It uses the SBT wrapper for checkstyle.
I manually tested. If we build the codes once, running this script takes 2 mins at maximum in my local:
Test codes:
Main codes:
How was this patch tested?
Manually tested. Jenkins build should test this.