Skip to content
This repository has been archived by the owner on Nov 10, 2020. It is now read-only.

Latest commit

 

History

History
135 lines (93 loc) · 4.17 KB

CONTRIBUTING.md

File metadata and controls

135 lines (93 loc) · 4.17 KB

Contributing to Atomic App

👍🎉 First off, thanks for taking the time to contribute! 🎉👍

The following is a set of guidelines (not rules) for contributing to Atomic App, which is hosted in the Project Atomic Organization on GitHub. These are just guidelines, not rules, use your best judgment and feel free to propose changes to this document in a pull request.

Submitting Issues

  • You can create an issue here, include as many details as possible with your report.
  • Include the version of Atomic App you are using, have a look at the docker container image tag.
  • Include the behavior you expected and maybe other places you've seen that behavior
  • Perform a cursory search to see if a similar issue has already been submitted

Submitting a Pull Request

Before you submit your pull request consider the following guidelines:

  • Make your changes in a new git branch:

    git checkout -b bug/my-fix-branch master
  • Create your patch, including appropriate test cases. Do not forget to add a copyright notice to your files, pls read along the line 625 of gpl-3.txt

  • Please test your changes locally for conformance of coding guidelines with following command

    $ tox
  • Include documentation that either describe a change to a behavior of atomicapp or the changed capability to an end user of atomicapp.

  • Commit your changes using a descriptive commit message. If you are fixing an issue please include something like 'this closes issue #xyz'.

  • Additionally think about implementing a git hook, as flake8 is part of the travis-ci tests it will help you pass the CI tests.

    $ cat .git/hooks/pre-push
    #!/bin/bash
    
    flake8 -v atomicapp
  • Push your branch to GitHub:

    git push origin bug/my-fix-branch
  • In GitHub, send a pull request to atomicapp:master.

  • If we suggest changes then:

    • Make the required updates.

    • Rebase your branch and force push to your GitHub repository (this will update your Pull Request):

      git rebase master -i
      git push origin bug/my-fix-branch -f

That's it! Thank you for your contribution!

Merge Rules

  • Include unit or integration tests for the capability you have implemented
  • Include documentation for the capability you have implemented
  • If you are fixing an issue within Atomic App,
  • include the issue number you are fixing

After your pull request is merged

After your pull request is merged, you can safely delete your branch and pull the changes from the upstream repository:

  • Delete the remote branch on GitHub either through the GitHub web UI or your local shell as follows:

    git push origin --delete bug/my-fix-branch
  • Check out the master branch:

    git checkout master -f
  • Delete the local branch:

    git branch -D bug/my-fix-branch
  • Update your master with the latest upstream version:

    git pull --ff upstream master

Git Commit Messages

  • Use the present tense ("Add feature" not "Added feature")
  • Use the imperative mood ("Move cursor to..." not "Moves cursor to...")
  • Reference issues and pull requests liberally

How to Test

Functional tests and unit tests are part of this repository. We prepared a Dockerfile which creates an image able to run these tests. To build it, run:

docker build -t atomicapp-test -f Dockerfile.test .

In case you want to test code which is currently in repository, run:

docker run -t --rm atomicapp-test

To test your changes in code you have two options:

  1. rebuild the image every time you save a file
  2. add a volume to the docker run command as follows
docker run -t --rm -v $PWD/atomicapp:/opt/atomicapp/atomicapp atomicapp-test

You can use following command to run tests you added:

docker run -t --rm -v $PWD/tests/:/opt/atomicapp/tests atomicapp-test