Project: etcd (Orchestration & Management / Coordination & Service Discovery)
File: CONTRIBUTING.md

etcd is Apache 2.0 licensed and accepts contributions via GitHub pull requests. This document outlines the basics of contributing to etcd. This is a rough outline of what a contributor's workflow looks like: * If you have any questions, please reach out using one of the methods listed in [contact]. Before making a change please look through the resources below to learn more about etcd and tools used for development. Please learn about version control system used in etcd. Read the Read the Watch Watch All the work in the etcd project is tracked in [GitHub issue tracker]. Issues should be properly labeled making it easy to find something for you. Depending on your interest and experience you should check different labels: If you are just starting, check issues labeled with [good first issue]. When you feel more comfortable in your contributions, check out [help wanted]. Advanced contributors can try to help with issues labeled [priority/important] covering the most relevant work at the time. If any of the aforementioned labels don't have unassigned issues, please [contact] one of the [maintainers] asking to triage more issues. The project could always use some help to deflake tests. are the currently open flaky test issues. For more, because etcd uses Kubernetes' prow infrastructure to run CI jobs, the past test results can be viewed at . | Tests | Status | | -- | | | periodics e2e-amd64 | ](https://testgrid.k8s.io/q/summary/sig-etcd-periodics/ci-etcd-e2e-amd64) | | presubmit build | ](https://testgrid.k8s.io/q/summary/sig-etcd-presubmits/pull-etcd-build) | | presubmit e2e-amd64 | ](https://testgrid.k8s.io/q/summary/sig-etcd-presubmits/pull-etcd-e2e-amd64) | | presubmit unit-test | ](https://testgrid.k8s.io/q/summary/sig-etcd-presubmits/pull-etcd-unit-test) | | presubmit verify | ](https://testgrid.k8s.io/q/summary/sig-etcd-presubmits/pull-etcd-verify) | | postsubmit build | ](https://testgrid.k8s.io/q/summary/sig-etcd-postsubmits/post-etcd-build) | If you find any flaky tests on testgrid, please Check to see if an issue has already been opened for this test. If not, open an issue with the `type/flake` label. Try to reproduce the flaky test on your machine via `stress`, for example, to reproduce the failure of `TestPeriodicSkipRevNotChange`: ```bash cd server/etcdserver/api/v3compactor go test -v -c -count 1 -run "^TestPeriodicSkipRevNotChange$" stress -p=8 ./v3compactor.test ``` Fix it. The etcd project supports two options for development: Manually set up the local environment. Automatically set up . For both options, the only supported architecture is `linux-amd64`. Bug reports for other environments will generally be ignored. Supporting new environments requires the introduction of proper tests and maintainer support that is currently lacking in the etcd project. If you would like etcd to support your preferred environment you can [file an issue]. This is the original etcd development environment, is most supported, and is backward compatible for the development of older etcd versions. Follow the steps below to set up the environment: Install Go by following . Please check the minimal go version in . Install build tools: `make`: For Debian-based distributions you can run `sudo apt-get install build-essential` `protoc`: You can download it for your os. Use version . `yamllint`: For Debian-based distribution you can run `sudo apt-get install yamllint` Verify that everything is installed by running `make build` Note: `make build` runs with `-v`. Other build flags can be added through env `GOBUILDFLAGS`, if required. Eg., ```console GOBUILDFLAGS="-buildmode=pie" make build ``` This is a more recently added environment that aims to make it faster for new contributors to get started with

This option is supported for etcd versions 3.6 onwards. This option can be on a system running Visual Studio Code and Docker, or in a remote cloud-based environment. To get started, create a codespace for this repository by clicking this ](https://github.com/codespaces/new?hidereposelect=true&ref=main&repo=11225014) A codespace will open in a web-based version of Visual Studio Code. The is fully configured with the software needed for this project. Note: Dev containers is an open spec which is supported by and . etcd code should follow the coding style suggested by the Golang community. See the for details. Please ensure that your change passes static analysis (requires ): `make verify` to verify if all checks pass. `make verify-*` to verify a single check, for example, `make verify-bom` to verify if `bill-of-materials.json` file is up-to-date. `make fix` to fix all checks. `make fix-*` to fix a single check, for example, `make fix-bom` to update `bill-of-materials.json`. Please ensure that your change passes tests. `make test-unit` to run unit tests. `make test-integration` to run integration tests. `make test-e2e` to run e2e tests. All changes are expected to come with a unit test. All new features are expected to have either e2e or integration tests. etcd follows a rough convention for commit messages: First line: Should start with the name of the package (for example `etcdserver`, `etcdctl`) followed by the `:` character. Describe the `what` behind the change Optionally, the author might provide the `why` behind the change in the main commit message body. Last line should be `Signed-off-by: firstname lastname <email@example.com>` (can be automatically generate by providing `--signoff` to git commit command). Example of commit message: ``` etcdserver: add grpc interceptor to log info on incoming requests To improve debuggability of etcd v3. Added a grpc interceptor to log info on incoming requests to etcd server. The log output includes remote client info, request content (with value field redacted), request handling latency, response size, etc. Uses zap logger if available, otherwise uses capnslog. Signed-off-by: FirstName LastName <github@github.com> ``` Please follow the guide. If you are still working on the pull request, you can convert it to a draft by clicking `Convert to draft` link just below the list of reviewers. Multiple small PRs are preferred over single large ones (>500 lines of code). Please make sure there is an associated issue for each PR you submit. Create one if it doesn't exist yet, and close the issue once the PR gets merged and has been backported to previous stable releases, if necessary. If there are multiple PRs linked to the same issue, refrain from closing the issue until all PRs have been merged and, if needed, backported to previous stable releases. Before requesting review please ensure that all GitHub checks were successful. It might happen that some unrelated tests on your PR are failing, due to their flakiness. In such cases please [file an issue] to deflake the problematic test and ask one of [maintainers] to rerun the tests. If all checks were successful feel free to reach out for review from people that were involved in the original discussion or [maintainers]. Depending on the complexity of the PR it might require between 1 and 2 maintainers to approve your change before merging. Thanks for contributing!