Skip to content
This repository has been archived by the owner on Jul 27, 2018. It is now read-only.

Latest commit

 

History

History
108 lines (71 loc) · 6.21 KB

CONTRIBUTING.md

File metadata and controls

108 lines (71 loc) · 6.21 KB

Contributing to Move.mil

Anyone is welcome to contribute code changes and additions to this project. If you'd like your changes merged into the master branch, please read the following document before opening a pull request.

There are several ways in which you can help improve this project:

  1. Fix an existing issue and submit a pull request.
  2. Review open pull requests.
  3. Report a new issue. Only do this after you've made sure the behavior or problem you're observing isn't already documented in an open issue.

Table of Contents

Getting Started

Move.mil is a Ruby on Rails (version 5.1.x) application with a PostgreSQL database (version 9.6.x). Development dependencies are managed using the Bundler gem.

If you're using macOS, you can use Postgres.app to quickly get PostgreSQL installed and running. You may also install PostgreSQL using Homebrew:

brew install postgresql

If you're using Homebrew, consider installing Homebrew Services to easily start and stop PostgreSQL:

brew tap homebrew/services
brew services run postgresql

This project uses Ruby (version 2.4.2) which can be installed using a Ruby version manager like rbenv.

rbenv install 2.4.2

Once you've installed Ruby 2.4.2, install the Bundler gem:

gem install bundler

With your PostgreSQL server started, run the following setup script from the root of the project:

bin/setup

This script will install the dependencies specified in the project's Gemfile, set development environment configuration variables, and create and migrate the application's databases.

Lastly, start the application by running bin/rails server and opening http://localhost:3000 in your Web browser of choice.

Environment Variables

The bin/setup script will generate (or update) a .env file in the root of the project and create several default environment variables.

To obtain a Google Maps API key, visit Google's API Console and select "Credentials" in the left-hand navigation. Click "Create Credentials" and choose "API Key" from the list of options. Copy the generated API key and update the .env file, replacing <your api key here> with the generated API key:

export GOOGLE_MAPS_API_KEY=<your api key here>

Enable the Google Maps Geocoding API by going here.

To work with encrypted seed data, you need to know the secret SEEDS_ENC_KEY variable and set it in the .env file. This was originally generated once during the bin/setup process. Once set, run bin/rails db:setup to load the encrypted data.

Making Changes

  1. Fork and clone the project's repo.
  2. Install development dependencies as outlined above.
  3. Create a feature branch for the code changes you're looking to make: git checkout -b your-descriptive-branch-name origin/master.
  4. Write some code!
  5. Run the application and verify that your changes function as intended: bin/rails server.
  6. If your changes would benefit from testing, add the necessary tests and verify everything passes by running bin/rspec.
  7. Commit your changes: git commit -am 'Add some new feature or fix some issue'. (See this excellent article for tips on writing useful Git commit messages.)
  8. Push the branch to your fork: git push -u origin your-descriptive-branch-name.
  9. Create a new pull request and we'll review your changes.

Verifying Changes

We use a number of tools to evaluate the quality and security of this project's code:

  • The test suite uses RSpec (bin/rspec).
  • Static code analysis uses RuboCop (bin/rubocop).
  • Static vulnerability scans use Brakeman (bin/brakeman).

Before submitting a pull request, use the above tools to verify your changes.

Code Style

Code formatting conventions are defined in the .editorconfig file which uses the EditorConfig syntax. There are plugins for a variety of editors that utilize the settings in the .editorconfig file. It is recommended that you install the EditorConfig plugin for your editor of choice.

Your bug fix or feature addition won't be rejected if it runs afoul of any (or all) of these guidelines, but following the guidelines will definitely make everyone's lives a little easier.

Legalese

Before submitting a pull request to this repository for the first time, you'll need to sign a Developer Certificate of Origin (DCO). To read and agree to the DCO, you'll add your name and email address to CONTRIBUTORS.md. At a high level, this tells us that you have the right to submit the work you're contributing in your pull request and says that you consent to us treating the contribution in a way consistent with the license associated with this software (as described in LICENSE.md) and its documentation ("Project").

You may submit contributions anonymously or under a pseudonym if you'd like, but we need to be able to reach you at the email address you provide when agreeing to the DCO. Contributions you make to this public Department of Defense repository are completely voluntary. When you submit a pull request, you're offering your contribution without expectation of payment and you expressly waive any future pay claims against the U.S. Federal Government related to your contribution.