Skip to content

Commit e3b7941

Browse files
committed
add contributing guide
1 parent 51938a0 commit e3b7941

File tree

2 files changed

+53
-3
lines changed

2 files changed

+53
-3
lines changed

CONTRIBUTING.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Contributing
2+
3+
Thank you for your interest in contributing to the Hooks gem! This document outlines how to contribute to the project, including setting up your development environment, running tests, and releasing new versions.
4+
5+
## Getting Started
6+
7+
To get your development environment set up, you simply need to run the following command:
8+
9+
```bash
10+
script/bootstrap
11+
```
12+
13+
> Note: This command assumes you have a Ruby version manager like `rbenv` installed.
14+
15+
## Running Tests
16+
17+
After writing some code or making changes, you will need to run the following commands to ensure everything is working correctly:
18+
19+
1. Run unit tests:
20+
21+
```bash
22+
script/test
23+
```
24+
25+
2. Run integration tests:
26+
27+
```bash
28+
script/integration
29+
```
30+
31+
3. Run acceptance tests:
32+
33+
```bash
34+
script/acceptance
35+
```
36+
37+
## Linting and Formatting
38+
39+
This project also requires that the linter must be run and pass before any code is committed. You can run the linter with the following command (with autocorrect enabled):
40+
41+
```bash
42+
script/lint -A
43+
```
44+
45+
## Releasing a new version
46+
47+
1. Update [`lib/hooks/version.rb`](lib/hooks/version.rb) with the next version number
48+
2. Run `bundle install` to update gem version contained in the lockfile
49+
3. Commit your changes and open a pull request
50+
4. When the pull request is approved and merged into `main`, the [`.github/workflows/release.yml`](.github/workflows/release.yml) workflow will automatically run to release the new version to RubyGems and GitHub Packages 🎉.

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -283,8 +283,8 @@ end
283283

284284
What these steps have done is set up a Hooks server that listens for incoming webhook requests at `/webhooks/hello` and `/webhooks/goodbye`. The `/hello` endpoint will respond with a success message without any authentication, while the `/goodbye` endpoint will require a valid `Authorization` header that matches the secret defined in the environment variable `GOODBYE_API_KEY`. Before the `/goodbye` endpoint enters the defined handler, it will first check the authentication plugin to ensure the request is valid.
285285

286-
### Authentication
286+
To see a live working version of this example, check out the [spec/acceptance/](spec/acceptance/) directory in this repository, which is used for acceptance testing the Hooks framework. It contains a complete example of how to set up a Hooks server with custom plugins, authentication, and more.
287287

288-
TODO
288+
### Authentication
289289

290-
See the [Auth Plugins](docs/auth_plugins.md) documentation for more information on how to create your own custom authentication plugins.
290+
See the [Auth Plugins](docs/auth_plugins.md) documentation for even more information on how to create your own custom authentication plugins.

0 commit comments

Comments
 (0)