How to contribute? ​
Contributions are always welcome!
In order to contribute ensure that you have the development environment setup and you familiarize yourself with required steps to build, verify-quality and test.
Setting up development environment ​
Installing Go ​
Minimum Golang version required: 1.18. On MacOS run:
brew install goFor other OS, follow the installation instructions.
Installing Git ​
Git is used as version control for dependency-watchdog. On MacOS run:
brew install gitIf you do not have git installed already then please follow the installation instructions.
Installing Docker ​
In order to test dependency-watchdog containers you will need a local kubernetes setup. Easiest way is to first install Docker. This becomes a pre-requisite to setting up either a vanilla KIND/minikube cluster or a local Gardener cluster.
On MacOS run:
brew install -cash dockerFor other OS, follow the installation instructions.
Installing Kubectl ​
To interact with the local Kubernetes cluster you will need kubectl. On MacOS run:
brew install kubernetes-cliFor other IS, follow the installation instructions.
Get the sources ​
Clone the repository from Github:
git clone https://github.com/gardener/dependency-watchdog.gitUsing Makefile ​
For every change following make targets are recommended to run.
# build the code changes
> make build
# ensure that all required checks pass
> make verify # this will check formatting, linting and will run unit tests
# if you do not wish to run tests then you can use the following make target.
> make checkAll tests should be run and the test coverage should ideally not reduce. Please ensure that you have read testing guidelines.
Before raising a pull request ensure that if you are introducing any new file then you must add licesence header to all new files. To add license header you can run this make target:
> make add-license-headers
# This will add license headers to any file which does not already have it.NOTE: Also have a look at the Makefile as it has other targets that are not mentioned here.
Raising a Pull Request ​
To raise a pull request do the following:
- Create a fork of dependency-watchdog
- Add dependency-watchdog as upstream remote via
git remote add upstream https://github.com/gardener/dependency-watchdog- It is recommended that you create a git branch and push all your changes for the pull-request.
- Ensure that while you work on your pull-request, you continue to rebase the changes from upstream to your branch. To do that execute the following command:
git pull --rebase upstream master- We prefer clean commits. If you have multiple commits in the pull-request, then squash the commits to a single commit. You can do this via
interactive git rebasecommand. For example if your PR branch is ahead of remote origin HEAD by 5 commits then you can execute the following command and pick the first commit and squash the remaining commits.
git rebase -i HEAD~5 #actual number from the head will depend upon how many commits your branch is ahead of remote origin master