Skip to content

Latest commit

 

History

History
168 lines (128 loc) · 7.12 KB

CONTRIBUTING.md

File metadata and controls

168 lines (128 loc) · 7.12 KB

How to Contribute

We'd love to get patches from you!

Building dependencies

We are not currently publishing snapshots for Finagle's dependencies, which means that it may be necessary to publish the develop branches of these libraries locally in order to work on Finagle's develop branch. To do so you can run ./bin/travisci script and pass it an optional TRAVIS_SCALA_VERSION environment variable. For example, the following command locally publishes all the Finagle dependencies built for Scala 2.11.7.

TRAVIS_SCALA_VERSION=2.11.7 ./bin/travisci

We are planning to begin publishing snapshots soon, which will make these steps unnecessary. If you have any questions or run into any problems, please create an issue here, tweet at us at @finagle, or email the Finaglers mailing list.

Workflow

The workflow that we support:

  1. Fork finagle
  2. Check out the develop branch
  3. Make a feature branch (use git checkout -b "cool-new-feature")
  4. Make your cool new feature or bugfix on your branch
  5. Write a test for your change
  6. From your branch, make a pull request against twitter/finagle/develop
  7. Work with repo maintainers to get your change reviewed
  8. Wait for your change to be pulled into twitter/finagle/develop
  9. Merge twitter/finagle/develop into your origin develop
  10. Delete your feature branch

Testing

We've standardized on using the ScalaTest testing framework. Because ScalaTest has such a big surface area, we use a restricted subset of it in our tests to keep them easy to read. We've chosen the assert API, not the Matchers one, and we use the FunSuite mixin, which supports xUnit-like semantics.

We encourage our contributors to ensure Java compatibility for any new public APIs they introduce. The easiest way to do so is to provide Java compilation tests and make sure the new API is easily accessible (typing X$.MODULE$ is not easy) from Java. These compilation tests also provide Java users with testable examples of the API usage. For an example of a Java compilation test see AddrCompilationTest.java.

Note that while you will see a Travis CI status message in your pull request, this may not always be accurate, and in any case all changes will be tested internally at Twitter before being merged. We're working to make Travis CI more useful for development, but for now you don't need to worry if it's failing (assuming that you are able to build and test your changes locally).

Style

We generally follow Effective Scala and the Scala Style Guide. When in doubt, look around the codebase and see how it's done elsewhere.

Comments should be formatted to a width no greater than 80 columns.

Files should be exempt of trailing spaces.

We adhere to a specific format for commit messages. Please write your commit messages along these guidelines. Please keep the line width no greater than 80 columns (You can use fmt -n -p -w 80 to accomplish this).

One line description of your change (less than 72 characters)

Problem

Explain the context and why you're making that change.  What is the
problem you're trying to solve? In some cases there is not a problem
and this can be thought of being the motivation for your change.

Solution

Describe the modifications you've done.

Result

What will change as a result of your pull request? Note that sometimes
this section is unnecessary because it is self-explanatory based on
the solution.

Code Review

The Finagle repository on GitHub is kept in sync with an internal repository at Twitter. For the most part this process should be transparent to Finagle users, but it does have some implications for how pull requests are merged into the codebase.

When you submit a pull request on GitHub, it will be reviewed by the Finagle community (both inside and outside of Twitter), and once the changes are approved, your commits will be brought into the internal system for additional testing. Once the changes are merged internally, they will be pushed back to GitHub with the next release.

This process means that the pull request will not be merged in the usual way. Instead a member of the Finagle team will post a message in the pull request thread when your changes have made their way back to GitHub, and the pull request will be closed (see this pull request for an example). The changes in the pull request will be collapsed into a single commit, but the authorship metadata will be preserved.

Please let us know if you have any questions about this process!

Getting Started

We've created a Starter label for issues that we think are likely to be reasonably limited in scope and ready to be tackled by new contributors. Please feel free to ask questions in the issue thread or on the mailing list if you run into problems trying to implement a new feature or fix a bug described in one of the starter issues.

Documentation

We also welcome improvements to the Finagle documentation, which is maintained in this repository and hosted on the corresponding GitHub Pages site.

Finagle uses Sphinx to generate its user guide via the built-in Sphinx support in the sbt-site plugin. You'll need to install Sphinx on your system before you can build the site locally.

Once you've got Sphinx installed, you can make changes to the RST files in the doc/src/sphinx directory and then build the site with the following command:

./sbt 'project finagle-doc' make-site

You can then view the site locally at doc/target/site/index.html.

Please note that sbt-site currently will not work with the Python 3 version of Sphinx. It's also hard-coded to call an executable named sphinx-build, which on some systems may be the name of the Python 3 version, with the Python 2 version named sphinx-build2. If the site build process crashes with a "Failed to build Sphinx html documentation", this is likely to be the problem. The simplest solution is to create a symbolic link to sphinx-build2 named sphinx-build somewhere on your path.

Please note that any additions or changes to the API must be thoroughly described in ScalaDoc comments. We will also happily consider pull requests that improve the existing ScalaDocs!