Skip to content

Commit d50da5b

Browse files
committed
feat: update instructions
1 parent 6f49db9 commit d50da5b

File tree

2 files changed

+21
-24
lines changed

2 files changed

+21
-24
lines changed

CONTRIBUTING.md

Lines changed: 12 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,13 @@ You might also want to try VSCode with [this WSL extension](https://marketplace.
4141
- mise will automatically install and manage the Ruby version specified in [`.ruby-version`](.ruby-version) with `mise i`
4242
- Verify that mise is working by running `mise --version`
4343
2. Install MySQL
44-
- **macOS**: Use Homebrew - see [MySQL Homebrew installation guide](https://formulae.brew.sh/formula/mysql)
45-
- **Windows**: Use WSL2 with Ubuntu - follow [MySQL WSL installation guide](https://dev.mysql.com/doc/mysql-installation-excerpt/8.0/en/linux-installation.html)
46-
- **Linux/Ubuntu**: Follow [official MySQL APT repository installation](https://dev.mysql.com/doc/mysql-installation-excerpt/8.0/en/linux-installation-apt-repo.html)
47-
- For Docker setup (recommended), see the README for MySQL container setup instructions
44+
- **macOS**: [Use Homebrew](https://formulae.brew.sh/formula/[email protected])
45+
- **Windows**: Use WSL2 with Ubuntu - follow [the MariaDB install guide from digital ocean](https://www.digitalocean.com/community/tutorials/how-to-install-mariadb-on-ubuntu-20-04#step-1-installing-mariadb)
46+
47+
- **Linux/Ubuntu**: Follow [the MariaDB install guide from digital ocean](https://www.digitalocean.com/community/tutorials/how-to-install-mariadb-on-ubuntu-20-04#step-1-installing-mariadb)
48+
- Alternative (Docker): with docker installed run `mise docker-db` to start
49+
the DB only (after cloning the repo)
50+
4851
3. Clone the project and switch to its directory
4952
4. Run `mise setup`
5053
5. Run `mise server` and visit <http://localhost:3000/> to see the AWBW portal page.
@@ -63,7 +66,7 @@ For Docker-based development (recommended):
6366

6467
## Credentials
6568

66-
These credentials also work for staging:
69+
These credentials also work for [staging](https://awbw-staging-xzek4.ondigitalocean.app/):
6770

6871
- User
6972
- email: <[email protected]>
@@ -76,22 +79,17 @@ These credentials also work for staging:
7679

7780
[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/rubyforgood/awbw/tree/main?quickstart=1)
7881

79-
[![Clone and open in VSCode Dev Container](https://img.shields.io/static/v1?label=Dev%20Containers&message=Clone%20and%20Open%20in%20VSCode&color=blue&logo=visualstudiocode)](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/rubyforgood/awbw)
80-
8182
1. Create the container:
8283
- To run the container on a Github VM, follow the Codespace link above. You can connect to the Codespace using VSCode or the VSCode web editor.
8384
- Or follow instructions to [create a new Codespace.](https://docs.github.com/en/codespaces/developing-in-a-codespace/creating-a-codespace-for-a-repository)
84-
- To clone this repo and run the container locally, follow instructions to [install VSCode and Docker](https://code.visualstudio.com/docs/devcontainers/containers). Click the Dev Container link above. Don't forget to add a git remote pointing to your fork once the container is setup and you want to push changes.
85-
2. 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
86-
3. Run `bin/start`. On the Ports tab, visit the forwarded port 3000 URL marked as Application to see the AWBW portal page.
85+
2. 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 `mise setup` script needs to run
86+
3. Run `mise server`. On the Ports tab, visit the forwarded port 3000 URL marked as Application to see the AWBW portal page.
8787
4. Login as a sample user with the default [credentials](#credentials).
8888

8989
## Troubleshooting 👷🏼‍♀️
9090

9191
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.
9292

93-
- _"My RBENV installation didn't work!"_ - The rbenv repository provides a [rbenv-doctor script](https://github.com/rbenv/rbenv-installer#rbenv-doctor) to verify the installation and check if a ruby version is installed
94-
9593
# 🤝 Code Contribution Workflow
9694

9795
1. **Identify an unassigned issue**. Read more [here](#issues) about how to pick a good issue.
@@ -131,17 +129,8 @@ Users that are frequent contributors and are involved in discussion (join the sl
131129

132130
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.
133131

134-
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.
135-
<https://github.com/Mon-Ouie/pry-remote>
136-
137132
If you want to connect via Shopify Ruby LSP VSCode extension or rdbg, start the server with `bundle exec rdbg -O -n -c -- bin/rails server -p 3000`
138133

139-
### Codespaces
140-
141-
When running tests in browser, visit the forwarded port 6080 URL to see the browser in Codespaces. You can also visit this port to access the GUI desktop in Codespaces.
142-
143-
In VSCode Run and Debug view, there are some helpful defaults for running RSpec tests in browser at your cursor as well as attaching to a live server. Make sure the Ruby LSP server is started before debugging.
144-
145134
## Squashing commits
146135

147136
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! :)
@@ -186,8 +175,8 @@ Before submitting a pull request, run all tests and lints. Fix any broken tests
186175

187176
#### Local testing
188177

189-
- Run all tests with `bundle exec rspec`
190-
- You can run a single test with `bundle exec rspec {path_to_test_name}_spec.rb` or on a specific line by appending `:LineNumber`
178+
- Run all tests with `mise spec` (or `mise docker-spec` if using docker)
179+
- You can run a single test with `mise spec {path_to_test_name}_spec.rb` or on a specific line by appending `:LineNumber`
191180
- If you need to skip a failing test, place `pending("Reason you are skipping the test")` into the `it` block rather than skipping with `xit`. This will allow rspec to deliver the error message without causing the test suite to fail.
192181

193182
```ruby

mise.toml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ run = "bin/setup"
99
description = "Start the rails server"
1010
run = "bin/rails s"
1111

12+
[tasks.spec]
13+
description = "Run RSpec tests"
14+
run = "bundle exec rspec"
15+
1216
[tasks.docker-up]
1317
description = "Start Docker containers for development"
1418
run = "docker compose up -d"
@@ -23,7 +27,7 @@ run = "docker compose logs -f"
2327

2428
[tasks.docker-db]
2529
description = "Starts a MySql database in docker"
26-
run = "docker compose up -d db"
30+
run = "docker compose up -d database"
2731

2832
[tasks.docker-console]
2933
depends = ["docker-up"]
@@ -39,3 +43,7 @@ run = "docker compose exec web bin/rails dbconsole"
3943
depends = ["docker-up"]
4044
description = "Provide commands to exec from the docker container. Ex: mise docker-exec rails db:migrate"
4145
run = "docker compose exec web"
46+
47+
[tasks.docker-spec]
48+
description = "Run RSpec tests in Docker"
49+
run = "docker compose exec -e RAILS_ENV=test web bundle exec rspec"

0 commit comments

Comments
 (0)