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.
Minimum Golang version required: 1.18
.
On MacOS run:
brew install go
For other OS, follow the installation instructions.
Git is used as version control for etcd-wrapper. On MacOS run:
brew install git
If you do not have git installed already then please follow the installation instructions.
In order to test etcd-wrapper 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 docker
For other OS, follow the installation instructions.
To interact with the local Kubernetes cluster you will need kubectl. On MacOS run:
brew install kubernetes-cli
For other OS, follow the installation instructions.
Clone the repository from Github:
git clone https://github.com/gardener/etcd-wrapper.git
For every change following make targets are recommended to run.
# build the code changes
> make build
# ensure that all required checks pass
> make check
# ensure that all tests pass
> make test
All 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.
To raise a pull request do the following:
- Create a fork of etcd-wrapper
- Add etcd-wrapper as upstream remote via
git remote add upstream https://github.com/gardener/etcd-wrapper
- It is recommended that you create a git branch and push all your changes for the pull-request.
4. 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. There are two ways to do this:
- You can keep all the commits as is and once the PR has been reviewed, the maintainer can use
squash and merge
functionality offered natively by github. - If you wish to squash your own commits, then you can do this via
interactive git rebase
command. 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