Skip to content

Latest commit

 

History

History
92 lines (68 loc) · 4.75 KB

CONTRIBUTING.md

File metadata and controls

92 lines (68 loc) · 4.75 KB

Contributing to Girder

There are many ways to contribute to Girder, with varying levels of effort. Do try to look through the documentation first if something is unclear, and let us know how we can do better.

We encourage a range of Pull Requests, from patches that include passing tests and documentation, all the way down to half-baked ideas that launch discussions.

The PR Process, Travis CI, and Related Gotchas

How to submit a PR ?

If you are new to Girder development and you don't have push access to the Girder repository, here are the steps:

  1. Fork and clone the repository.
  2. Create a branch.
  3. Push the branch to your GitHub fork.
  4. Create a Pull Request.

This corresponds to the Fork & Pull Model mentioned in the GitHub flow guides.

If you have push access to Girder repository, you could simply push your branch into the main repository and create a Pull Request. This corresponds to the Shared Repository Model and will facilitate other developers to checkout your topic without having to configure a remote. It will also simplify the workflow when you are co-developing a branch.

When submitting a PR, make sure to add a Cc: @girder/developers comment to notify Girder developers of your awesome contributions. Based on the comments posted by the reviewers, you may have to revisit your patches.

How to integrate a PR ?

Getting your contributions integrated is relatively straightforward, here is the checklist:

  • All tests pass
  • Consensus is reached. This usually means that at least one reviewer added a LGTM comment and a reasonable amount of time passed without anyone objecting. LGTM is an acronym for Looks Good to Me.

Next, there are two scenarios:

  • You do NOT have push access: A Girder core developer will integrate your PR.
  • You have push access: Simply click on the "Merge pull request" button.

Then, click on the "Delete branch" button that appears afterward.

Automatic testing of pull requests

When you submit a PR to the Girder repo, Travis CI will run the full build on two different branches

  • The commit at the head of the PR branch, the push build
  • The head of the PR branch that is then merged into master, the pr branch

The Travis build will run according to the .travis.yml file, which is useful as an example for how to set up your own environment for testing. We are currently using containerized builds on Travis, and for each branch, will test against both Mongo v2.6.8 and Mongo v3.0.1.

Confusing failing test message "AttributeError: 'module' object has no attribute 'x_test'"

This is also a gotcha for your local testing environment. If a new dependency is introduced during development, but is not in the test environment, usually because the dependency is not included in a requirements.txt or requirements-dev.txt file, or because those requirements are not installed via pip, a test can fail that attempts to import that dependency and can print a confusing message in the test logs like "AttributeError: 'module' object has no attribute 'x_test'".

As an example, the HDFS plugin has a dependency on the Python module snakebite, specified in the HDFS plugin requirements.txt file. If this dependency was not included in the requirements file, or if that requirements file was not included in the .travis.yml file (or that requirements file was not pip installed in a local test environment), when the test defined in the assetstore_test.py file is run, the snakebite module will not be found, but the exception will be swallowed by the testing environment and instead the assetstore_test module will be considered invalid, resulting in the confusing error message

AttributeError: 'module' object has no attribute 'assetstore_test'

but you won't be confused now, will you?