Skip to content

Latest commit

 

History

History
101 lines (70 loc) · 4.18 KB

CONTRIBUTING.md

File metadata and controls

101 lines (70 loc) · 4.18 KB

Developing cadence-java-client

This doc is intended for contributors to cadence-java-client (hopefully that's you!)

Note: All contributors also need to fill out the Uber Contributor License Agreement before we can merge in any of your changes

Development Environment

  • Java 11 (currently, we use Java 11 to compile Java 8 code).
  • Thrift 0.9.3 (use homebrew or distribution)
  • Gradle build tool 6.x
  • Docker

⚠️ Note 1: You must install the 0.9.x version of Thrift. Otherwise compiling would fail at error error: package org.apache.thrift.annotation does not exist

⚠️ Note 2: It's currently compatible with Java 8 compiler but no guarantee in the future.

IntelliJ IDE integration (Optional)

  • Make sure you set the gradle path with the right version (currently 6.x)

IntelliJ

  • Then all the below gradlew command can be replaced with the Gradle plugin operation Gradle

Licence headers

This project is Open Source Software, and requires a header at the beginning of all source files. To verify that all files contain the header execute:

./gradlew licenseCheck

To generate licence headers execute

./gradlew licenseFormat

Commit Messages

Overcommit adds some requirements to your commit messages. At Uber, we follow the Chris Beams guide to writing git commit messages. Read it, follow it, learn it, love it.

Build & Publish & Test locally

Build with:

./gradlew build

To test locally, you can publish to MavenLocal

  1. Change build.gradle: Comment out the first section in publications ( line 160 to line 191 in this commit)

  2. Change the version to add a local suffix. E.g.

version = '3.3.0'

to

version = '3.3.0-local'

Then run the command

./gradlew publishToMavenLocal

Now you have the local cadence-java-client in your machine using veriosn 3.3.0-local

  1. To test with Cadence Java Samples, change mavenCentral() to mavenLocal() and also change the version with your suffix.

Then ./gradlew build and refer to the sample repo for how to run the code(it needs to run with a Cadence server).

⚠️ If you run into problem with version.properties creation task, you can comment the task out. It's okay for local testing.
The property file is being used by Version classto report the library version for logging/metrics.

Unit & Integration Test

Then run all the tests with:

./gradlew test

The test by default will run with TestEnvironment without Cadence service. If you want to run with Cadence serivce:

USE_DOCKER_SERVICE=true ./gradlew test

And sometimes it's important to test the non-sticky mode

STICKY_OFF=true USE_DOCKER_SERVICE=true ./gradlew test

Also, if there is any Buildkite test failure that you cannot reproduce locally, follow buildkite docker-compose instructions to run the tests.