Skip to content

Developer Guide

Lee Dongjin edited this page Aug 17, 2019 · 28 revisions

Table of Contents

Development Environment Setup

Prerequisites

To develop Brooklin, you need to have the following dependencies installed:

  1. Gradle: https://docs.gradle.org/4.10.3/userguide/installation.html
  2. JDK 8+: https://openjdk.java.net/install/
  3. Git: https://git-scm.com/downloads
  4. Python 2.3+: https://www.python.org/downloads/

IDE

If you do not have a Java IDE set up, you can download and install the latest version of IntelliJ IDEA Community Edition for your platform at https://www.jetbrains.com/idea/download/.

Building and Testing Brooklin

  • To clone the Brooklin repository, run the following command from termina/command line:
    git clone https://github.com/linkedin/brooklin.git

Note: If you are on Windows, please replace gradlew with gradlew.bat

  • To build Brooklin and run all tests:

    ./gradlew clean build
  • To run unit tests:

    ./gradlew test
  • To release the Brooklin binaries into local Maven repository:

    ./gradlew publishToMavenLocal
  • To build the Brooklin tarball:

    ./gradlew releaseTarGz

    You can find the generated tarball at datastream-tools/build/distributions/brooklin.tgz

Publishing a New Version of Brooklin

Decide the Next Version

Brooklin adheres to Semantic Versioning, i.e.

Given a version number MAJOR.MINOR.PATCH, increment the:

MAJOR version when you make incompatible API changes,

MINOR version when you add functionality in a backwards-compatible manner, and

PATCH version when you make backwards-compatible bug fixes.

Create a new release on GitHub

  1. Decide which commit to publish as the new version (in the master branch)

  2. On your local machine, open at terminal window at the root directory of your Brooklin clone. Make sure your HEAD points at the commit you chose in the previous step.

  3. Edit gradle/maven.gradle by setting allprojects.version to the new version.

  4. Run the following command to produce the new tarball

./gradlew releaseTarGz
  1. Go to https://github.com/linkedin/brooklin/releases/ and click "Draft a new release".

  2. Type the new version in both the "Tag version" and "Release title" text boxes.

  3. Set the "Target" select box to the commit you chose in step 1.

  4. Upload the new release tarball located under the ./datastream-tools/build/distributions/ directory, to the new GitHub release.

  5. Publish the new release.

Update maven.gradle

Send a PR with an update to allprojects.version in gradle/maven.gradle setting it to a future SNAPSHOT version. For instance, if you just released version 1.0.0, set allprojects.version to 1.0.1-SNAPSHOT.

Add a new entry to Change Log

Add a new entry to CHANGELOG.md documenting the new version, release date, and all noteworthy changes.

Publish Artifacts to JFrog Bintray

  1. Sign in to Bintray at at https://bintray.com/linkedin/maven/brooklin, preferably using your GitHub account.

  2. After signing in successfully, retrieve an API key that you can use to publish Brooklin artifacts:

    • Click your account name on the upper right corner
    • Click Edit Profile
    • Click API Key on the left navigation menu
  3. Run the following commands in Brooklin's root directory to specify your publishing credentials:

export BINTRAY_USER=<your-bintray-username>
export BINTRAY_KEY=<your-API-key>
  1. Publish the new version by running:
./gradlew bintrayUpload
  1. Go to Brooklin's page on Bintray, check out the uploaded files, and publish the new version (look for an inline notification message prompting you to publish or discard the new files).

Update the version shield

Update the version shield on the README page. Ideally, we should have been able to use Shields.io's version badge to reflect the new version automatically, but it is flaky.

Contributing to Brooklin

  • Contributions are accepted in the form of Pull Requests.

  • Before submitting a Pull Request, please, make sure your changes are building and passing all tests with the latest code in the master branch of the Brooklin upstream repo. Please, follow the instructions on this page to learn how to sync a fork with an upstream repository.

  • Please, take a moment to read our Contribution Guidelines before submitting patches or opening issues.