Skip to content

Latest commit

 

History

History
118 lines (79 loc) · 2.72 KB

CONTRIBUTING.md

File metadata and controls

118 lines (79 loc) · 2.72 KB

Contributing to Spark Dialect Extension

This document provides detailed steps to build the Spark Dialect Extension from the source code.

Prerequisites

Before you start, ensure you have the following installed:

Compile the Project

To compile the project and generate a JAR file, run the following command in the project's root directory:

./gradlew crossBuildV212Jar crossBuildV213Jar

This command compiles the source code and packages it into a .jar files located in the build/libs directory.

Running Scala Tests

This section describes how to run Scala tests for the Spark Dialect Extension.

Start Required Services

Before running the tests, you need to start the necessary database services using Docker Compose:

docker-compose -f docker-compose.test.yml up -d

Execute Tests

To run the Scala tests, execute:

./gradlew test

After the tests, you can view the coverage report by opening the build/reports/tests/test/index.html file in your web browser.

Stopping Docker Containers

After completing the tests, you can stop the Docker containers with:

docker-compose -f docker-compose.test.yml down

Code Formatting and Linting

Using Scalafmt to Format Code

To format all Scala source files in the project, execute the following command from the project's root directory:

./gradlew scalafmtAll

Using Scalafix for Linting and Refactoring

To lint and refactor the code, run Scalafix using the following command:

./gradlew scalafix

This command checks the code against various rules specified in the .scalafix.conf file and applies fixes where possible.

Release process

  1. Checkout to develop branch and update it to the actual state
git checkout develop
git pull -p
  1. Copy version (it must start with v, e.g. v1.0.0)
VERSION=$(./gradlew -q printVersion)
  1. Commit and push changes to develop branch
git add .
git commit -m "Prepare for release ${VERSION}"
git push
  1. Merge develop branch to master, WITHOUT squashing
git checkout master
git pull
git merge develop
git push
  1. Add git tag to the latest commit in master branch
git tag "$VERSION"
git push origin "$VERSION"
  1. Update version in develop branch after release:
git checkout develop
NEXT_VERSION=$(echo "$VERSION" | awk -F. '/[0-9]+\./{$NF++;print}' OFS=.)
sed -i "s/version = \".*\"/version = \"$NEXT_VERSION\"/" build.gradle
git add .
git commit -m "Bump version"
git push