Skip to content

Latest commit

 

History

History
138 lines (92 loc) · 4.32 KB

contributing.md

File metadata and controls

138 lines (92 loc) · 4.32 KB

Contributing to PeopleDepot

Quick start

  1. Install or make sure docker and docker-compose are installed on your computer

    docker -v
    docker-compose -v
  2. Clone this repo and change to the project root directory

    git clone https://github.com/hackforla/peopledepot.git
    cd peopledepot
  3. [Temporary] The latest code is in https://github.com/fyliu/peopledepot.git and we need to get that.

    1. Create a git remote fang to that repo

      git remote add fang https://github.com/fyliu/peopledepot.git
    2. Fetch data from the remote

      git fetch fang
    3. Checkout the recurring_event-model branch to see the current progress. The main repo should be updated with the latest code soon.

      git checkout fang/recurring_event-model
  4. Create .env.dev from .env.dev-sample

    cp .env.dev-sample .env.dev
  5. Build and run via the script

    ./scripts/buildrun.sh
  6. Create a super user for logging into the web admin interface

    docker-compose exec web python manage.py createsuperuser
  7. Browse to the web admin interface at http://localhost:8000/admin/

Testing

  1. Run all tests

    ./scripts/test.sh

Linting and autoformatting

We're using the popular flake8 and black for linting and code formatting. We're also using isort to organize import statements.

To run them, use the lint.sh convenience script or look inside the script to see how to run them individually.

  1. Run lint.sh

    ./scripts/lint.sh

Pre-commit checks

We will eventually integrate this into pre-commit hooks, but for now, run this command before each git commit

  1. Run precommit-check.sh

    ./scripts/precommit-check.sh

Convenience scripts for sanity checks before committing code (assumes bash env)

  1. buildrun.sh - clean, build, and run containers in background mode
  2. lint.sh - lint and and auto-format code
  3. test.sh - run tests and generate test coverage report
  4. logs.sh - view container logs
  5. migrate.sh - run database migrations inside container
  6. precommit-check.sh - sanity checks before committing (calls other scripts, but doesn't stop progress on error like it should)
  7. createsuperuser.sh - creates a default superuser (assumes apt env. requires expect util to be installed)

Working with issues

Submit a bug

Submit a feature request

Contribute to an existing issue

  1. Find issue in Prioritized Backlog here
  2. Assign issue to yourself and move it to In progress
  3. Follow the steps in the issue description to complete the issue
  4. Create a pull request and tag it with the issue number (i.e. closes #15)

To create a new issue, please use the blank issue template (available when you click New Issue). If you want to create an issue for other projects to use, please create the issue in your own repository and send a slack message to one of your hack night hosts with the link.

Working with forks and branches

We use the fork, branch, and pull request model

To contribute code changes

  1. Choose an issue to work on, say issue #15
  2. Create a fork and commit your work inside the fork
    1. Fork the repo from hackforla/peopledepot
    2. Create a branch in your fork to work on the issue. It's preferred to have the working issue number in the branch name.
    3. Remember to run the precommit-checks.sh script before each commit until it can be integrated
  3. Create a PR from your fork/branch to hackforla/peopledepot/main when you're done with your changes
    1. Reference the issue that you're working on in the PR description. e.g. "Closes #15"
    2. Provide a description of the relevant changes.
  4. Move the issue to the Review column in the project board

Working with pull requests and reviews

  • Explain your process.