[SPARK-51389][BUILD] Allow full customization of profiles in scalastyle#50156
Closed
cnauroth wants to merge 1 commit intoapache:masterfrom
Closed
[SPARK-51389][BUILD] Allow full customization of profiles in scalastyle#50156cnauroth wants to merge 1 commit intoapache:masterfrom
cnauroth wants to merge 1 commit intoapache:masterfrom
Conversation
### What changes were proposed in this pull request? In the `scalastyle` helper script, activate profiles docker-integration-tests and kubernetes-integration-tests in the default value of `SPARK_PROFILES` instead of directly on the `sbt` command line. ### Why are the changes needed? The `scalastyle` script supports customization of which profiles to activate and check for style violations by passing command-line arguments that fill the `SPARK_PROFILES` environment variable. However, the docker-integration-tests and kubernetes-integration-tests profiles are always activated directly during the `sbt` invocation. This may waste time when engineers want to check for style violations on work in progress that doesn't change any code under these profiles. ### Does this PR introduce _any_ user-facing change? No. This change only impacts developer tooling. The default behavior of the script when no arguments are passed remains the same. ### How was this patch tested? In my local repo (not included in this pull request), I introduced style violations in docker-integration-tests and kubernetes-integration-tests. I then ran the script with no arguments, and it flagged the style violations: ``` dev/scalastyle Scalastyle checks failed at following occurrences: [error] /usr/local/google/home/cnauroth/git/apache/spark/resource-managers/kubernetes/integration-tests/src/test/scala/org/apache/spark/deploy/k8s/integrationtest/Utils.scala:20:0: java.io. is in wrong order relative to java.nio.file.. [error] /usr/local/google/home/cnauroth/git/apache/spark/connector/docker-integration-tests/src/test/scala/org/apache/spark/util/DockerUtils.scala:23:0: scala.jdk.CollectionConverters._ is in wrong order relative to scala.sys.process._. [error] Total time: 66 s (01:06), completed Mar 4, 2025, 1:16:42 AM ``` I repeated this with command-line arguments specifying just the yarn profile, but it still flagged the violations in docker-integration-tests and kubernetes-integration-tests: ``` dev/scalastyle -Pyarn Scalastyle checks failed at following occurrences: [error] /usr/local/google/home/cnauroth/git/apache/spark/resource-managers/kubernetes/integration-tests/src/test/scala/org/apache/spark/deploy/k8s/integrationtest/Utils.scala:20:0: java.io. is in wrong order relative to java.nio.file.. [error] /usr/local/google/home/cnauroth/git/apache/spark/connector/docker-integration-tests/src/test/scala/org/apache/spark/util/DockerUtils.scala:23:0: scala.jdk.CollectionConverters._ is in wrong order relative to scala.sys.process._. [error] Total time: 101 s (01:41), completed Mar 4, 2025, 9:04:29 PM ``` After applying the changes in the script, it still flags the violations in docker-integration-tests and kubernetes-integration-tests by default, but not when I specify only the yarn profile: ``` dev/scalastyle -Pyarn Scalastyle checks passed. ``` ### Was this patch authored or co-authored using generative AI tooling? No.
dongjoon-hyun
approved these changes
Mar 5, 2025
Member
dongjoon-hyun
left a comment
There was a problem hiding this comment.
+1, LGTM. Thank you, @cnauroth .
Merged to master for Apache Spark 4.1.0.
Member
|
Although this is reported as a bug, I believe this as an improvement.
If you need this in other branches, please let me know again~ |
Contributor
Author
|
@dongjoon-hyun , thank you for the review and commit. I don't have a strong need for it on other branches. |
Member
|
Thank you for the confirmation. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
In the
scalastylehelper script, activate profiles docker-integration-tests and kubernetes-integration-tests in the default value ofSPARK_PROFILESinstead of directly on thesbtcommand line.Why are the changes needed?
The
scalastylescript supports customization of which profiles to activate and check for style violations by passing command-line arguments that fill theSPARK_PROFILESenvironment variable. However, the docker-integration-tests and kubernetes-integration-tests profiles are always activated directly during thesbtinvocation. This may waste time when engineers want to check for style violations on work in progress that doesn't change any code under these profiles.Does this PR introduce any user-facing change?
No. This change only impacts developer tooling. The default behavior of the script when no arguments are passed remains the same.
How was this patch tested?
In my local repo (not included in this pull request), I introduced style violations in docker-integration-tests and kubernetes-integration-tests. I then ran the script with no arguments, and it flagged the style violations:
I repeated this with command-line arguments specifying just the yarn profile, but it still flagged the violations in docker-integration-tests and kubernetes-integration-tests:
After applying the changes in the script, it still flags the violations in docker-integration-tests and kubernetes-integration-tests by default, but not when I specify only the yarn profile:
Was this patch authored or co-authored using generative AI tooling?
No.