Skip to content

Latest commit

 

History

History
96 lines (63 loc) · 4.52 KB

CONTRIBUTING.md

File metadata and controls

96 lines (63 loc) · 4.52 KB

Contributing

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

Our README describes the project, its purpose, and is necessary reading for contributors.

This project adheres to a code of conduct. By participating, you are expected to uphold this code.

Contributions to this project are made under the MIT License.

Help wanted

Browse open issues to see current requests.

Open an issue to tell us about a bug. You may also open a pull request to propose specific changes, but it's always OK to start with an issue.

Help with translating the website into other languages.

Setting up the development environment

You'll need to:

  1. Install PostgreSQL and start it
  2. Execute createuser --createdb postgres to create the standard development database user
  3. Create a GitHub OAuth app - set the callback URL to http://localhost:4000/auth/callback
  4. Copy .env.example to .env and set the GITHUB_CLIENT_ID and GITHUB_CLIENT_SECRET values to the ones obtained from the application in the previous step
  5. Run script/setup

Common Local Development Tasks

This project follows the GitHub "scripts to rule them all" pattern. The contents of the scripts directory are scripts that cover all common tasks:

  • script/setup — Performs first-time setup
  • script/update — Performs periodic updating
  • script/test — Runs automated tests, format and linter checks
  • script/server — Launches the local development web server
  • script/console — Opens the development console
  • script/db-console — Opens the database console for the development database
  • script/docs — Generates developer documentation
  • script/translate — Extract and merge new message strings in priv/gettext

See the documentation at the top of each script for more information about what each one does and is capable of.

Other scripts that are available but not intended to be used directly by developers:

  • script/bootstrap — Used to do a one-time install of all prerequisites for a development machine
  • script/cibuild — Used to run automated tests in the CI environment

Heroku Hosting Notes

Heroku restricts us to 20 simultaneous database connections. We divide them like this:

  • 14 connections for serving normal traffic
  • 2 for scheduled tasks
  • 2 for manual maintenance (see Executing Scripts)
  • 2 reserved for future use

Executing Scripts

Occasionally, certain maintenance will need to be executed on staging or production. This is best achieved by the means of Elixir scripts. This way, they can be tested locally before we potentially screw up production. To execute a script in a Heroku environment, execute:

heroku run "POOL_SIZE=2 mix run path/to/script.exs"

The POOL_SIZE environment variable restricts the number of database connections that the task can utilize, since Heroku restricts us to 20 simultaneous database connections.

Writing Tests

  • Controller specs should verify:
    • HTTP Status
    • Redirects
    • Assigns
    • Session values
  • Controller specs should not verify content
  • View specs should verify that given the expected assigns, the right content is displayed

Translations

If you would like to help with translating Atom Tweaks into languages other than US English, you can:

  1. Create a new directory under priv/gettext that is the name of the locale for which you will be providing a translation (for example, to provide a translation for Brazilian Portuguese, it would be priv/gettext/pt_BR)
  2. Run the script/translate script to extract and merge the latest version of the strings
  3. Add your translations to the .po files under your new directory
  4. Submit a PR with your changes

See the Gettext documentation for information about the file format.

Resources