Are you an external contibutor? Follow this guide to make your first pull request!
- Java 11
- Maven 3
- A Snowflake account
-
Create a fork of this repository into your personal account and clone the repo locally.
-
Create
profile.properties
from the template (profile.properties.example
). -
Run the test suite using the following command
mvn -DtagsToExclude=com.snowflake.snowpark.UDFTest -Dgpg.skip scoverage:report
If the tests execute successfully, you can proceed to making your contribution/addition. When you're ready, head to the next section to create a pull request.
- scala/ is the primary implentation of the SDK
- java/ is a wrapper around the Scala implementation for the Java SDK
Before opening a pull request on the upstream repo, we recommend running the following tasks locally.
Run the following command to execute the test suite and and the formatter.
mvn clean compile
The previous command will generate the Scala documentation. Run this command to generate the docs for the Java API:
scripts/generateJavaDoc.sh
After you have run the test suite, formatter, and docs locally open a pull request on this repo and add @sfc-gh-bli as a reviewer. We will run additional tests against your pull request.
To compile the latest code and build a jar without running tests, use the command:
mvn -DskipTests -Dgpg.skip package
This target also copies all the dependencies to the folder target/dependency.
Quick test:
mvn scala:doc
Apply All Configurations:
mvn -DskipTests -Dgpg.skip package
Doc can be found in snowpark-java-scala/target/site
scripts/generateJavaDoc.sh
Doc can be found in snowpark-java-scala/javaDoc/target/site
Snowpark triggers all Java tests from Scala test suite JavaAPISuite
.
So everytime when adding a new Java test suite, please update JavaAPISuite
to trigger it,
otherwise, that new Java test suite will be ignored.
Note: This section is only applicable to Snowflake employees.
Install sonar-scanner
https://docs.sonarqube.org/latest/analysis/scan/sonarscanner/
# clean repo
mvn clean verify -DskipTests -Dgpg.skip
# generate report
mvn -Dgpg.skip -e scoverage:report
# setup version
version=`git rev-parse HEAD`
snowpark_home= # path to snowpark repo
sonar-scanner \
-Dsonar.host.url=https://sonarqube.int.snowflakecomputing.com \
-Dsonar.projectBaseDir=${snowpark_home} \
-Dsonar.projectVersion="$version" \
-Dsonar.scala.coverage.reportPaths=target/scoverage.xml \
-Dsonar.sources=src/main \
-Dsonar.binaries=target/scoverage-classes \
-Dsonar.java.binaries=target/scoverage-classes \
-Dsonar.tests=src/test \
-Dsonar.scala.version=2.12 \
-Dsonar.projectKey=snowpark \
-Dsonar.scm.revision=${version} \
-Dsonar.scm.provider=git