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
Create an issue, describing the bug or new feature in as much detail as you can.
- Create an issue describing the change you are proposing.
- Create a pull request. The project uses the fork and pull model:
- Fork the project
- Make your changes on your fork
- Write a good commit message(s) for your changes
- Create the pull request for your changes
- Update the tests or add new tests to cover the new behaviour.
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:
- System requirements
- Fork the project
- Open the local project folder in a container
- Everything will then be setup for you. You'll be able to run the tests locally.
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!
- Go
- Hoverfly (for running the tests)
- General documentation
- The Label Checker is a Docker container action
Some reasons we chose Go:
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)
See the DEPENDENCIES.md