We ♥ contributors! By participating in this project, you agree to abide by the Ruby for Good code of conduct.
If you're new here, here are some things you should know:
- Issues tagged "Help Wanted" are self-contained and great for new contributors
- Pull Requests are reviewed within a week or so
- Ensure your build passes linting and tests and addresses the issue requirements
- This project relies entirely on volunteers, so please be patient with communication
If you have any questions about an issue, comment on the issue, open a new issue, or ask in the RubyForGood slack. human-essentials has a #human-essentials
channel in the Slack. Our channel in slack also contains a zoom link for office hours every day office hours are held.
Many helpful members are available to answer your questions. Just ask, and someone will be there to help you!
You won't be yelled at for giving your best effort. The worst that can happen is that you'll be politely asked to change something. We appreciate any sort of contributions, and don't want a wall of rules to get in the way of that.
- Install Ruby
- Install the version specified in
.ruby-version
. - Visit the Install Ruby on Rails guide by GoRails for Ubuntu, Windows, and macOSX setup.
⚠️ Follow only the Installing Ruby step, as our project setup differs⚠️ It is highly recommended you use a ruby version manager such as rbenv, asdf, or rvm. - Verify that your Ruby installation works by running
ruby -v
.
- Install the version specified in
- Install Postgres
- Follow one of these guides: MacOSX, Ubuntu.
- Do you develop on Windows? We'd love to hear (and for you to submit a PR explaining) how you do it. 🙏🏻
- Create a
database.yml
file onconfig/
directory with your database configurations. You can also copy the existing files calleddatabase.yml.example
and.env.example
and change the credentials.
- Follow one of these guides: MacOSX, Ubuntu.
- Clone the project and switch to its directory
- Run
bin/setup
- Run
bin/start
and visit http://localhost:3000/ to see the human essentials page. - Log in as a sample user with the default credentials.
These credentials also work for staging:
Super Users 🦸🏽♀️
username: [email protected]
password: password!
Bank Users 🏦
Organization Admin
Email: [email protected]
Password: password!
User
Email: [email protected]
Password: password!
Partner Users 👥
Verified Partner
Email: [email protected]
Password: password!
Invited Partner
Email: [email protected]
Password: password!
Unverified Partner
Email: [email protected]
Password: password!
Recertification Required Partner
Email: [email protected]
Password: password!
- Follow the link above or follow instructions to create a new Codespace.; You can use the web editor, or even better open the Codespace in VSCode
- Wait for the container to start. This will take a few (10-15) minutes since Ruby needs to be installed, the database needs to be created, and the
bin/setup
script needs to run - Run
bin/start
and visit the URL that pops in VSCode up to see the human essentials page - Login as a sample user with the default credentials.
Please let us know by opening up an issue! We have many new contributors come through and it is likely what you experienced will happen to them as well.
- "My RBENV installation didn't work!" - The rbenv repository provides a rbenv-doctor script to verify the installation and check if a ruby version is installed
-
Identify an unassigned issue. Read more here about how to pick a good issue.
-
Assign it to avoid duplicated efforts (or request assignment by adding a comment).
-
Fork the repo if you're not a contributor yet. Read about becoming a contributor here.
-
Create a new branch for the issue using the format
XXX-brief-description-of-feature
, whereXXX
is the issue number. -
Commit fixes locally using descriptive messages that indicate the affected parts of the app. Read debugging tips here.
-
If you create a new model run
bundle exec annotate
from the root of the app -
Create RSpec tests to validate that your work fixes the issue (if you need help with this, please reach out!). Read guidelines here.
-
Run the tests and make sure all tests pass successfully; if any fail, fix the issues causing the failures. Read guidelines here.
-
Final commit if tests needed fixing.
-
Squash smaller commits. Read guidelines here.
-
Push up the branch
-
Create a pull request and indicate the addressed issue (e.g.
Resolves #1
) in the title, which will ensure the issue gets closed automatically when the pull request gets merged. Read PR guidelines here. -
Code review: At this point, someone will work with you on doing a code review. The automated tests will run linting, rspec, and brakeman tests. If the automated tests give 👍 to the PR merging, we can then do any additional (staging) testing as needed.
-
Merge: Finally if all looks good the core team will merge your code in; if your feature branch was in this main repository, the branch will be deleted after the PR is merged.
-
Deploys are currently done about once a week! Read the deployment process here.
Please feel free to contribute! While we welcome all contributions to this app, pull-requests that address outstanding Issues and have appropriate test coverage for them will be strongly prioritized. In particular, addressing issues that are tagged with the next milestone should be prioritized higher.
All work is organized by issues.
Find issues here.
If you would like to contribute, please ask for an issue to be assigned to you.
If you would like to contribute something that is not represented by an issue, please make an issue and assign yourself.
Only take multiple issues if they are related and you can solve all of them at the same time with the same pull request.
Users that are frequent contributors and are involved in discussion (join the slack channel! :)) may be given direct Contributor access to the Repo so they can submit Pull Requests directly instead of Forking first.
If starting server directly, via rail s
or rail console
, or built-in debugger in RubyMine, or running bundle exec rspec path/to/spec.rb:line_no
, then you can use binding.pry
to debug. Drop the pry where you want the execution to pause.
If starting via Procfile with bin/start
, then drop a binding.remote_pry
into the line where you want execution to pause at. Then run pry-remote
in the terminal to connect to it.
https://github.com/Mon-Ouie/pry-remote
Consider the balance of "polluting the git log with commit messages" vs. "providing useful detail about the history of changes in the git log". If you have several smaller commits that serve a one purpose, you are encouraged to squash them into a single commit. There's no hard and fast rule here about this (for now), just use your best judgement. Please don't squash other people's commits. Everyone who contributes here deserves credit for their work! :)
Only commit the schema.rb only if you have committed anything that would change the DB schema (i.e. a migration).
Try to keep your PRs limited to one particular issue, and don't make changes that are out of scope for that issue. If you notice something that needs attention but is out of scope, please create a new issue.
If you are so inclined, you can open a draft PR as you continue to work on it. Sometimes we want to get a PR up there and going so that other people can review it or provide feedback, but maybe it's incomplete. This is OK, but if you do it, please tag your PR with in-progress
label so that we know not to review / merge it.
Add a test for your change. If you are adding functionality or fixing a bug, you should add a test!
If you are inexperienced in writing tests or get stuck on one, please reach out for help :). You probably don't need to write new tests when simple re-stylings are done (ie. the page may look slightly different but the Test suite is unaffected by those changes).
If you need to see a browser/system spec run in the browser, you can use the following env variable:
NOT_HEADLESS=true bundle exec rspec
We've added magic_test which makes creating browser specs much easier. It allows you to record actions on the browser running the specs and easily paste them into the spec. You can do this by adding magic_test
within your system spec:
it "does some browser stuff" do
magic_test
end
and run the spec using this command: MAGIC_TEST=1 NOT_HEADLESS=true bundle exec rspec <path_to_spec>
See videos of it in action here
- Before submitting a pull request, run all tests and rake tasks with
bundle exec rake
and run lints withbin/lint
. Fix any broken tests and lints before submitting a pull request. - You can run all the tests without rake tasks with
bundle exec rspec
- You can run a single test with
bundle exec rspec {path_to_test_name}_spec.rb
or on a specific line by appending:LineNumber
- If you need to skip a failing test, place
pending("Reason you are skipping the test")
into theit
block rather than skipping withxit
. This will allow rspec to deliver the error message without causing the test suite to fail.
it "works!" do
pending("Need to implement this")
expect(my_code).to be_valid
end