Skip to content

Latest commit

 

History

History
208 lines (137 loc) · 8.24 KB

File metadata and controls

208 lines (137 loc) · 8.24 KB

Join Us

Arrow is an inclusive community powered by awesome individuals like you. As an actively growing ecosystem, Arrow and its associated libraries and toolsets are in need of new contributors! We have issues suited for all levels, from entry to advanced, and our maintainers are happy to provide 1:1 mentoring. All are welcome in Arrow.

If you’re looking to contribute, have questions, or want to keep up-to-date about what’s happening, please follow us here and say hello!

How-tos

In this page you'll find these guidelines for contributions:

Can't find what you're looking for? Please, contact us at #arrow on Kotlin Slack or create an issue.

How to build the libraries

Requirements

  • JDK 8

Steps

To build all the libraries (compilation + tests) and examples:

cd arrow-libs
./gradlew build

To build just CORE libraries, FX libraries, OPTICS libraries, etc. select the correspondent directory.

For instance, for CORE libraries:

cd arrow-libs/core
./gradlew build

How to generate and validate the documentation

Dokka is responsible for generating documentation based on source code annotations. Ank is in charge of compiling and validating your doc snippets and deploying the proper binaries for those.

In order to generate the documentation and validate it:

cd arrow-libs
./gradlew buildDoc

That Gradle task is equivalent to run Dokka and Ank:

cd arrow-libs
./gradlew dokka
cd ../arrow-site
./gradlew runAnk

Doc snippets policies

Whenever you are documenting a new type (type class, data type, whatever) you'll wonder how to add code snippets to it. Please, use the following priority check list:

1. Snippets for public API docs

If the snippet is just docs for a public method of a type (as in arguments, return type, or how it should be used from call sites), that should be inlined in the Kdocs of that given method using Dokka. That's done under the actual type file. Here you have a simple example for Option methods.

That will automatically inline the docs of each method into the docs of the given data type. This is intended to be used just for public APIs exposed to users of the library.

2. Snippets for broader samples

If your snippet is showing examples on how to use the public APIs in a broader scenario (like describing FP patterns or similar), then you'll add those snippets to the described docs Markdown file.

For the mentioned cases, you should double-check which Ank modifiers you want to use for the snippets (silent, replace, or outFile(<file>)). You'll find more details about each one of those in Ank docs. See some real examples on this docs PR.

Also note that you can make your Ank snippets editable and runnable in the actual browser, which is quite handy. Just add this {: data-executable='true'} before your Ank Kotlin snippet. That must be used as a norm for all the snippets except for the ones that just represent infrastructure for following snippets (where there's not much value on making them runnable).

How to run the website in your local workspace

cd arrow-site
./gradlew buildSite

That Gradle task is equivalent to run Dokka, Ank and Jekyll build:

cd arrow-libs
./gradlew dokka
cd ../arrow-site
./gradlew runAnk
bundle install --gemfile Gemfile --path vendor/bundle
bundle exec jekyll serve -s build/site

This will install any needed dependencies locally, and will use it to launch the complete website in 127.0.0.1:4000 so you can open it with a standard browser.

If you get an error while installing the Ruby gem http_parser, check if the path to your Arrow directory contains spaces. According to this issue, the installation with spaces in the path is currently not working.

How to test links

Test for broken links in documentation using

wget --spider -r -nd -nv -l 5 http://127.0.0.1:4000

How to propose an improvement

If it's the first time you contribute with a GitHub repository, take a look at Collaborating with issues and pull requests.

How to create an issue

Please, follow the link to create an issue.

How to create a pull request

Requirements to change an existing feature

If you want to propose a fix, rename, move, etc. please, ensure that these checks pass:

  • Required checks:
    • arrow libraries: build
    • arrow libraries: build documentation
  • The approval by 2 maintainers of the Arrow Community.

Requirements to add a new feature

Please, ensure these points when adding a new feature:

When creating the pull request, ensure that these checks pass:

  • Required automatic checks:
    • arrow libraries: build
    • arrow libraries: build documentation
  • The approval by 2 maintainers of the Arrow Community.

How to download the tests report

Both successful or failed build checks allow to download the tests report to review it:

how-to-download-tests-report

What happens when merging a pull request

When merging the pull request, a new SNAPSHOT library will be published into Sonatype OSSRH.

On the other hand, the documentation for the next version (SNAPSHOT) will be updated:

If any of these actions fails, an issue will be created to be solved as soon as possible.

Notes

How to upgrade Gradle

The use of Gradle appears in several places: arrow-libs, arrow-libs/core, arrow-stack, etc.

However, links are being used so it's just necessary to upgrade Gradle in arrow-libs directory:

cd arrow-libs
./gradlew wrapper --gradle-version <new-version>

How to add a new module

This short guideline provides all the things to keep in mind when adding a new module:

  • Configuration:
    • Add <module>/gradle.properties
    • Add <module>/build.gradle
    • Update settings.xml
  • Website:
  • Utilities:

Gradle dependency configurations

Configuration Use Note
api compilation exported to consumers for compilation
implementation compilation + runtime exported to consumers for runtime
compileOnly just compilation not exported to consumers
runtimeOnly just runtime exported to consumers for runtime
testImplementation test compilation + test runtime
testCompileOnly test compilation
testRuntimeOnly test runtime