Skip to content

Commit d6bdfac

Browse files
authored
Add CONTRIBUTING.md and development.md (#56)
- Add the `CONTRIBUTING.md` document - Add the `docs/development.md` document - Add **Contributing** section to the main `README.md` - Update `docs/README.md`'s table of contents - Delete duplicate issue templates
1 parent 4f46df1 commit d6bdfac

6 files changed

Lines changed: 139 additions & 43 deletions

File tree

.github/ ISSUE_TEMPLATE/bug-report.md

Lines changed: 0 additions & 29 deletions
This file was deleted.

.github/ ISSUE_TEMPLATE/feature-request.md

Lines changed: 0 additions & 14 deletions
This file was deleted.

CONTRIBUTING.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<h1>
2+
<img alt="logo" src="./docs/assets/logo-small.png" width="28px" />
3+
Codeowners Validator - contributing
4+
</h1>
5+
6+
🎉🚀🤘 Thanks for your interest in the Codeowners Validator project! 🤘🚀🎉
7+
8+
This document contains contribution guidelines for this repository. Read it before you start contributing.
9+
10+
## Contributing
11+
12+
Before proposing or adding changes, check the [existing issues](https://github.com/mszostok/codeowners-validator/issues) and make sure the discussion/work has not already been started to avoid duplication.
13+
14+
If you'd like to see a new feature implemented, use this [feature request template](https://github.com/mszostok/codeowners-validator/issues/new?assignees=&labels=&template=feature_request.md) to create an issue.
15+
16+
Similarly, if you spot a bug, use this [bug report template](https://github.com/mszostok/codeowners-validator/issues/new?assignees=mszostok&labels=bug&template=bug_report.md) to let us know!
17+
18+
### Ready for action? Start developing!
19+
20+
To start contributing, follow these steps:
21+
22+
1. Fork the `codeowners-validator` repository.
23+
24+
2. Clone the repository locally.
25+
26+
> **TIP:** This project uses Go modules, so you can check it out locally wherever you want. It doesn't need to be checked out in `$GOPATH`.
27+
28+
3. Set the `codeowners-validator` repository as upstream:
29+
30+
```bash
31+
git remote add upstream git@github.com:mszostok/codeowners-validator.git
32+
```
33+
34+
4. Fetch all the remote branches for this repository:
35+
36+
```bash
37+
git fetch --all
38+
```
39+
40+
5. Set the master branch to point to upstream:
41+
42+
```bash
43+
git branch -u upstream/master master
44+
```
45+
46+
You're all set! 🚀 Read the [development](./docs/development.md) document for further instructions.

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,10 @@ Application exits with different status codes which allow you to easily distingu
142142
| **2** | The application was closed because the OS sends a termination signal (SIGINT or SIGTERM). |
143143
| **3** | The CODEOWNERS validation failed - executed checks found some issues. |
144144

145+
## Contributing
146+
147+
Contributions are greatly appreciated! The project follows the typical GitHub pull request model. See [CONTRIBUTING.md](CONTRIBUTING.md) for more details.
148+
145149
## Roadmap
146150

147151
The [codeowners-validator roadmap uses Github milestones](https://github.com/mszostok/codeowners-validator/milestone/1) to track the progress of the project.

docs/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
Welcome to the Codeowners Validator documentation.
77

8+
+ [Development](./development.md)
89
+ [GitHub Action](./gh-action.md)
910
+ [GitHub personal access token](./gh-token.md)
1011
+ [Release](./release.md)

docs/development.md

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
[← back to docs](./README.md)
2+
3+
# Development
4+
5+
This document contains development instructions. Read it to learn how to develop this project.
6+
7+
# Table of Contents
8+
9+
<!-- toc -->
10+
11+
- [Prerequisites](#prerequisites)
12+
- [Dependency management](#dependency-management)
13+
- [Testing](#testing)
14+
* [Unit tests](#unit-tests)
15+
* [Lint tests](#lint-tests)
16+
* [Integration tests](#integration-tests)
17+
- [Build a binary](#build-a-binary)
18+
19+
<!-- tocstop -->
20+
21+
## Prerequisites
22+
23+
* [Go](https://golang.org/dl/) 1.15 or higher
24+
* [Docker](https://www.docker.com/)
25+
* Make
26+
27+
Helper scripts may introduce additional dependencies. However, all helper scripts support the `INSTALL_DEPS` environment variable flag.
28+
By default, this flag is set to `false`. This way, the scripts will try to use the tools installed on your local machine. This helps speed up the development process.
29+
If you do not want to install any additional tools, or you want to ensure reproducible script
30+
results, export `INSTALL_DEPS=true`. This way, the proper tool version will be automatically installed and used.
31+
32+
## Dependency management
33+
34+
This project uses `go modules` for dependency management. To install all required dependencies, use the following command:
35+
36+
```bash
37+
go mod download
38+
```
39+
40+
## Testing
41+
42+
### Unit tests
43+
44+
To run all unit tests, execute:
45+
46+
```bash
47+
make test-unit
48+
```
49+
50+
To generate the unit test coverage HTML report, execute:
51+
52+
```bash
53+
make test-unit-cover-html
54+
```
55+
56+
> **NOTE:** The generated report opens automatically in your default browser.
57+
58+
### Lint tests
59+
60+
To check your code for errors, such as typos, wrong formatting, security issues, etc., execute:
61+
62+
```bash
63+
make test-lint
64+
```
65+
66+
To automatically fix detected lint issues, execute:
67+
68+
```bash
69+
make fix-lint-issues
70+
```
71+
72+
### Integration tests
73+
74+
This project supports the integration tests that are defined in the [tests](../tests) package. The tests are executed against [`gh-codeowners/codeowners-samples`](https://github.com/gh-codeowners/codeowners-samples).
75+
76+
> **CAUTION:** Currently, running the integration tests both on external PRs and locally by external contributors is not supported, as the teams used for testing are visible only to the organization members.
77+
> At the moment, the `codeowners-validator` repository owner is responsible for running these tests.
78+
79+
## Build a binary
80+
81+
To generate a binary for this project, execute:
82+
```bash
83+
make build
84+
```
85+
86+
This command generates a binary named `codeowners-validator` in the root directory.
87+
88+
[↑ Back to top](#table-of-contents)

0 commit comments

Comments
 (0)