Skip to content

Commit

Permalink
Add CONTRIBUTING.md and development.md (#56)
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
majakurcius committed Oct 31, 2020
1 parent 4f46df1 commit d6bdfac
Show file tree
Hide file tree
Showing 6 changed files with 139 additions and 43 deletions.
29 changes: 0 additions & 29 deletions .github/ ISSUE_TEMPLATE/bug-report.md

This file was deleted.

14 changes: 0 additions & 14 deletions .github/ ISSUE_TEMPLATE/feature-request.md

This file was deleted.

46 changes: 46 additions & 0 deletions CONTRIBUTING.md
@@ -0,0 +1,46 @@
<h1>
<img alt="logo" src="./docs/assets/logo-small.png" width="28px" />
Codeowners Validator - contributing
</h1>

🎉🚀🤘 Thanks for your interest in the Codeowners Validator project! 🤘🚀🎉

This document contains contribution guidelines for this repository. Read it before you start contributing.

## Contributing

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.

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.

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!

### Ready for action? Start developing!

To start contributing, follow these steps:

1. Fork the `codeowners-validator` repository.

2. Clone the repository locally.

> **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`.
3. Set the `codeowners-validator` repository as upstream:

```bash
git remote add upstream git@github.com:mszostok/codeowners-validator.git
```

4. Fetch all the remote branches for this repository:

```bash
git fetch --all
```

5. Set the master branch to point to upstream:

```bash
git branch -u upstream/master master
```

You're all set! 🚀 Read the [development](./docs/development.md) document for further instructions.
4 changes: 4 additions & 0 deletions README.md
Expand Up @@ -142,6 +142,10 @@ Application exits with different status codes which allow you to easily distingu
| **2** | The application was closed because the OS sends a termination signal (SIGINT or SIGTERM). |
| **3** | The CODEOWNERS validation failed - executed checks found some issues. |

## Contributing

Contributions are greatly appreciated! The project follows the typical GitHub pull request model. See [CONTRIBUTING.md](CONTRIBUTING.md) for more details.

## Roadmap

The [codeowners-validator roadmap uses Github milestones](https://github.com/mszostok/codeowners-validator/milestone/1) to track the progress of the project.
Expand Down
1 change: 1 addition & 0 deletions docs/README.md
Expand Up @@ -5,6 +5,7 @@

Welcome to the Codeowners Validator documentation.

+ [Development](./development.md)
+ [GitHub Action](./gh-action.md)
+ [GitHub personal access token](./gh-token.md)
+ [Release](./release.md)
88 changes: 88 additions & 0 deletions docs/development.md
@@ -0,0 +1,88 @@
[← back to docs](./README.md)

# Development

This document contains development instructions. Read it to learn how to develop this project.

# Table of Contents

<!-- toc -->

- [Prerequisites](#prerequisites)
- [Dependency management](#dependency-management)
- [Testing](#testing)
* [Unit tests](#unit-tests)
* [Lint tests](#lint-tests)
* [Integration tests](#integration-tests)
- [Build a binary](#build-a-binary)

<!-- tocstop -->

## Prerequisites

* [Go](https://golang.org/dl/) 1.15 or higher
* [Docker](https://www.docker.com/)
* Make

Helper scripts may introduce additional dependencies. However, all helper scripts support the `INSTALL_DEPS` environment variable flag.
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.
If you do not want to install any additional tools, or you want to ensure reproducible script
results, export `INSTALL_DEPS=true`. This way, the proper tool version will be automatically installed and used.

## Dependency management

This project uses `go modules` for dependency management. To install all required dependencies, use the following command:

```bash
go mod download
```

## Testing

### Unit tests

To run all unit tests, execute:

```bash
make test-unit
```

To generate the unit test coverage HTML report, execute:

```bash
make test-unit-cover-html
```

> **NOTE:** The generated report opens automatically in your default browser.
### Lint tests

To check your code for errors, such as typos, wrong formatting, security issues, etc., execute:

```bash
make test-lint
```

To automatically fix detected lint issues, execute:

```bash
make fix-lint-issues
```

### Integration tests

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).

> **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.
> At the moment, the `codeowners-validator` repository owner is responsible for running these tests.
## Build a binary

To generate a binary for this project, execute:
```bash
make build
```

This command generates a binary named `codeowners-validator` in the root directory.

[↑ Back to top](#table-of-contents)

0 comments on commit d6bdfac

Please sign in to comment.