Fork the project on GitHub and check out your copy.
git clone https://github.com/contributor/grape-api-boilerplate.git
cd grape-api-boilerplate
git remote add upstream https://github.com/duffn/grape-api-boilerplate.git
Make sure your fork is up-to-date and create a topic branch for your feature or bug fix.
git checkout main
git pull upstream main
git checkout -b my-feature-branch
docker compose up --build
Run tests
docker compose run --rm -e RACK_ENV=test app bundle exec rake spec
Try to write a test that reproduces the problem you're trying to fix or describes a feature that you want to build and add them to the spec directory.
I appreciate pull requests that highlight or reproduce a problem, even without a fix!
Implement your feature or bug fix.
Ruby style is enforced with Rubocop. Run docker compose run --rm -e RACK_ENV=test app bundle exec rake rubocop
and fix any style issues highlighted.
Make sure that docker compose run --rm -e RACK_ENV=test app bundle exec rake spec
completes without errors.
Writing good commit messages is important. A commit message should describe what changed and why.
git add .
git commit -m "My awesome and useful commit message"
git push origin my-feature-branch
Go to https://github.com/contributor/grape-api-boilerplate.git and select your feature branch. Click the Pull Request
button and fill out the form. Pull requests are usually reviewed within a few days.
If you've been working on a change for a while, rebase with upstream/main
.
git fetch upstream
git rebase upstream/main
git push origin my-feature-branch -f
Amend your previous commit and force push the changes.
git commit --amend
git push origin my-feature-branch -f
Go back to your pull request after a minute or two and see whether it passed GitHub Actions CI. Everything should look green, otherwise fix issues and amend your commit as described above.
It's likely that your change will not be merged and that the nitpicky maintainer will ask you to do more, or fix seemingly benign problems. Hang in there!
Please do know that I really appreciate and value your time and work.