You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+98-4Lines changed: 98 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,6 +22,7 @@
22
22
-[**Part 4: How to create pull requests**](#part-4-how-to-create-pull-requests)
23
23
-[**4.1 Push changes to your forked repository**](#41-push-changes-to-your-forked-repository)
24
24
-[**4.2 Create a pull request on the VRMS repository**](#42-create-a-pull-request-on-the-vrms-repository)
25
+
-[**Part 5: How to review pull requests**](#part-5-how-to-review-pull-requests)
25
26
26
27
## **Part 1 : How to join the team**
27
28
@@ -45,7 +46,7 @@ Once you have accepted the GitHub invite (via email or in your GitHub notificati
45
46
46
47
1. Setup two factor authentication on your account https://github.com/hackforla/governance/issues/20
47
48
48
-
These steps are manditory in order to contribute to all HackforLA projects.
49
+
These steps are mandatory in order to contribute to all HackforLA projects.
49
50
50
51
## **Part 2: How to set up the development environment**
51
52
@@ -136,6 +137,18 @@ Note: Understanding how git remotes work will make collaborating much easier. Yo
136
137
137
138
-_Please note that the `ports` for the frontend and backend are set in this location_
138
139
140
+
1. Set up Husky for Git hooks (required for all contributors):
141
+
142
+
To help enforce code quality and prevent errors from being committed, we use [Husky](https://typicode.github.io/husky/) to manage Git hooks. Husky should install itself automatically after you install dependencies (thanks to the `prepare` script in `package.json`).
143
+
144
+
If you notice that Git hooks are not working (for example, you don't see linting or formatting checks when committing), you may need to set up Husky manually. To do this, run the following in the root of the project:
145
+
146
+
```sh
147
+
npx husky install
148
+
```
149
+
150
+
If you encounter issues, see the [Husky documentation](https://typicode.github.io/husky/#/) or reach out on Slack!
151
+
139
152
1. Take a second to review the `app.js` and `server.js` files in the `vrms/backend` folder. These two files are a blueprint for the back end, so please familiarize yourself with it. You'll see folders for the database collection models, routes for the API, and a config file which loads the necessary environment variables.
140
153
141
154
1. Start the local development servers (frontend & backend).
@@ -163,7 +176,7 @@ To run all of the tests run `npm run test:all` from the root folder.
163
176
164
177
### **2.5 Using the development database**
165
178
166
-
The application uses MongoDB. We have created a shared development database using MongoDB Cloud and MongoDB Atlas. The conection string for the development database is included in the environmental variables that you pasted into your backend/.env file in step 5 of the "Get Up and Running" setion. If you completed that step successfully you should not need to do anything else.
179
+
The application uses MongoDB. We have created a shared development database using MongoDB Cloud and MongoDB Atlas. The connection string for the development database is included in the environmental variables that you pasted into your backend/.env file in step 5 of the "Get Up and Running" section. If you completed that step successfully you should not need to do anything else.
167
180
168
181
To view and edit the development database manually, you can download [MongoDB Compass](https://www.mongodb.com/try/download/compass). To connect to the development database you will use the "DATABASE_URL" from the [document](https://docs.google.com/document/d/1yDF6UmyO-MPNrl3y_Mw0mkm_WaixlSkXzWbudCzHXDY/edit?usp=sharing) that contained the environmental variables. The string will start with "mongodb+srv://".
169
182
@@ -183,7 +196,7 @@ Developers may choose from issues with the following `role` labels:
183
196
-`role: Back End`
184
197
-`role: Database`
185
198
-`role: devops`
186
-
-*_Lead developers may choose from the above labels, as well as issues with the label:_`role: Dev Lead`
199
+
-_Lead developers may choose from the above labels, as well as issues with the label:_`role: Dev Lead`
187
200
188
201
Claiming an issue is a two step process:
189
202
@@ -210,6 +223,21 @@ You will create a new branch for each issue you work on. Doing all your work on
210
223
git checkout -b your-branch-name
211
224
```
212
225
226
+
### **3.2.1 Check for and resolve linting/prettier errors before making changes**
227
+
228
+
Before you begin working on any part of a file, always check for existing code errors in the codebase. This helps prevent introducing new issues and ensures a stable foundation for your work.
229
+
230
+
- Use your code editor's error checking tools or run the appropriate linting/compilation commands (e.g., `yarn lint (filename)`, or your IDE's error panel) to identify any errors in the files you plan to edit. (This isn't your fault, it's just an old codebase 🤷️)
231
+
- If you find errors, resolve them in a **separate commit** before starting your feature or fix work. Use a clear commit message such as:
232
+
233
+
> fix: Resolve existing linting and compilation errors
234
+
235
+
(This makes it easier for reviewers to distinguish between error fixes and your new changes.)
236
+
237
+
- If you are unsure how to fix an error, ask for help in the team Slack channel or consult the documentation.
238
+
- Only begin implementing new features or fixes after confirming the file is error-free.
239
+
- If you are unable to resolve the errors after making a reasonable effort, it is acceptable to use `--no-verify` when committing or pushing your changes. Please leave a comment in your pull request explaining why this was necessary.
240
+
213
241
### **3.3 Work on the Issue**
214
242
215
243
Every issue will contain action items you must complete before you are ready to submit a pull request. Be sure to use the checkboxes as you complete each action item so we can track your progress!
4. Fill out the "What changes did you make and why?" section of the pull request template
243
271
5. Include before & after images with your pull request if there are visual changes to the user interface
244
272
6. Request a review from another developer on the team
245
-
7. Review another developers pull request while you are waiting for your pull request to be reviewed
273
+
7. Review another developer's pull request while you are waiting for your pull request to be reviewed
274
+
275
+
## **Part 5: How to review pull requests**
276
+
277
+
Reviewing pull requests is an important part of maintaining code quality and helping team members improve their contributions. Here’s how to review a pull request on the VRMS repository:
278
+
279
+
1.**Navigate to the Pull Requests tab**
280
+
Go to the [Pull Requests](https://github.com/hackforla/VRMS/pulls) section of the repository to see open pull requests.
281
+
282
+
2.**Select a pull request to review**
283
+
Choose a pull request that is ready for review (look for those assigned to you or marked as "Ready for review").
284
+
285
+
3.**Read the pull request description**
286
+
Review the summary, linked issue(s), and any screenshots or documentation provided by the author.
287
+
288
+
4.**Check the code changes**
289
+
290
+
- Click on the "Files changed" tab to see the code diff.
291
+
- Look for code quality, readability, and adherence to project conventions.
292
+
- Ensure the code addresses the issue and does not introduce bugs.
293
+
294
+
5.**Run the code locally (optional but recommended)**
295
+
296
+
- Pull the branch to your local machine.
297
+
- Follow the setup instructions to test the changes.
298
+
- Run tests to verify nothing is broken.
299
+
300
+
6.**Leave feedback**
301
+
302
+
- Use GitHub’s review tools to comment on specific lines or leave general feedback.
303
+
- Be constructive and respectful in your comments.
304
+
305
+
7.**Approve or request changes**
306
+
307
+
- If the pull request is ready, click "Approve".
308
+
- If changes are needed, click "Request changes" and specify what needs to be addressed.
309
+
310
+
8.**Merge the pull request (if authorized)**
311
+
- If you have permission and the pull request meets all requirements, you may merge it.
312
+
- Otherwise, notify the author or a maintainer that it is ready to merge.
313
+
314
+
**Tip:** You can use the following helpful git alias to quickly check out a pull request locally:
315
+
316
+
```sh
317
+
# This git alias allows you to quickly check out a pull request by its number.
318
+
# eg "git pr 1820 vrms"
319
+
git config alias.pr '!f() { \
320
+
# If no arguments are provided, print usage instructions
321
+
if [ $# -lt 1 ]; then \
322
+
echo "Usage: git pr <id> [<remote>] # assuming <remote>[=origin] is on GitHub"; \
This allows you to run `git pr <PR_NUMBER>` to fetch and check out a pull request by its number. For example: `git pr 1234 upstream`.
336
+
337
+
**Resources:**
338
+
339
+
-[GitHub: Reviewing proposed changes in a pull request](https://docs.github.com/en/github/collaborating-with-pull-requests/reviewing-changes-in-pull-requests)
0 commit comments