Skip to content

Latest commit

 

History

History
109 lines (70 loc) · 6.08 KB

CONTRIBUTING.md

File metadata and controls

109 lines (70 loc) · 6.08 KB

How to contribute

Firstly thanks for thinking of contributing - the project is open source and all contributions are very welcome 🙂 💥 👍

How to report a bug or suggest a new feature

How to make a contribution

Local development

How to report a bug or suggest a new feature

Create an issue, describing the bug or new feature in as much detail as you can.

How to make a contribution

Local development

Visual Studio Code

The easiest way to set up your development environment (unless you have Codespaces, which is even easier) is to use Visual Studio Code's Remote Containers functionality:

Codespaces

If you have access to GitHub Codespaces (which allows full remote development from within your browser) then all you need to do is fork the project and open it in Codespaces - easy!

Local development from scratch

Dependencies

Tools and technologies

GitHub Actions

Go

Some reasons we chose Go:

Running the tests

As above, you need Hoverfly to run the tests.

Run the tests:

go test ./... -v

Running the tests in GitHub Enterprise Cloud mode (verifying that the label checker works properly on GitHub Enterprise Cloud):

go test ./... -enterprise-cloud -v

Running the tests in Github Enterprise Server mode (verifying that the label checker works properly on GitHub Enterprise Server):

go test ./... -enterprise-server -v

The tests are table driven, which is an important concept to know when amending them.

The tests also have an integration mode which makes calls to real external services instead of using Hoverfly to virtualise the service calls. You do not need to run the tests in integration mode when contributing (they will not pass unless you are a maintainer of the project who has the designated GitHub permissions).

If you are a maintainer, and you want to run the integration tests locally, you will need to set the INPUT_REPO_TOKEN environment variable, e.g. if using a VS Code Codespace you can run:

INPUT_REPO_TOKEN=$GITHUB_TOKEN go test ./... -integration -v

You can also run the integration tests locally in GitHub Enterprise Cloud mode:

INPUT_REPO_TOKEN=$GITHUB_TOKEN go test ./... -integration -enterprise-cloud -v

(we can't run the integration tests in GitHub Enterprise Server mode as that would require having a real GitHub Enterprise Server, which would be expensive in time and money to maintain)

Updating dependencies

See the DEPENDENCIES.md