etcd-io / etcd-io/etcd

Introduce a Go workspace

Open
#18,409 14 comments 1 reaction 0 assignees View on GitHub
area/tooling backport/v3.7 priority/important-longterm stage/tracked type/feature
Dominant language
Go
Stars
52.3k
Forks
10.5k
Avg merge
3d 1h
Merged PRs (30d)
44

Description

### What would you like to be added?

After discussing this in last week's community meeting and based on feedback from the Go team (https://github.com/golang/go/issues/68254) due to the vulnerability (GHSA-5x4g-q5rc-36jp / golang/vulndb#2952), there are several benefits to introducing a Go workspace in the project, and one of the biggest motivations is to simplify the test scripts.

I have a branch with the `go.workspace` ([diff](https://github.com/etcd-io/etcd/compare/main...ivanvc:etcd:use-a-go-workspace?expand=1)). It requires changes in the build scripts and the test libraries. It still doesn't work, but there's some progress.

I mostly based it on how kubernetes/kubernetes defines the Go workspace. However, from golang/go#68254 and the motivation to have `govulncheck` spot vulnerabilities within our modules, their suggestion is to remove `replaces` pointing to local code in `go.mod`s, but k/k still has these replaces.

I wanted to open up the discussion to get feedback and/or implementation ideas.

### Progress track

- [x] Workspace activation: #18794
- [ ] Clean up: #21937 [^1]
- [ ] verify targets
- [x] lint: #20788
- [x] gofmt: #20814
- [x] bom: #20829
- [x] dep: #20848
- [x] ~shellcheck~
- [x] goword: #20815
- [x] We can remove `go_srcs_in_module` after merging #20815 and #20812
- [x] govet: #20810
- [x] license-header: #20812 / #20818
- [x] mod-tidy: #20828
- [x] ~shellws~
- [x] ~proto-annotations~
- [x] ~genproto~
- [x] ~yamllint~
- [x] govet-shadow: #20810
- [x] ~markdown-marker~
- [x] go-versions: Somewhat blocked by https://github.com/golang/go/issues/75941 [^2]
- [x] gomodguard: #20849
- [x] `scripts/verify_grpc_experimental.sh`: #21900 [^1]
- [x] fix targets
- [x] bom: #20829
- [x] lint: #20788
- [x] yamllint: #20850 / #20857
- [x] ~sync-toolchain-directive~
- [x] scripts/fix.sh
- [x] mod-tidy: #20851
- [x] go fmt: #20858
- [x] bashws: #20860
- [x] test targets
- [x] unit: #20872
- [x] integration: #20909
- [x] e2e: #20925
- [x] grpcproxy-integration: #20954
- [x] grpcproxy-e2e: #20954
- [x] ~e2e-release~: Not needed, it runs e2e and release tests.
- [x] ~release~: Not needed, it doesn't use any module functions.
- [x] robustness: #20962
- [x] coverage: #21145
- [x] build: #21824
- [x] clean up old functions: #21826
- [x] build targets
- [x] release: #21825
- [ ] release_mod: #21938 [^1]
- [x] Miscellaneous scripts
- [x] `scripts/update_dep.sh`: #21792
- [x] run-govulncheck: #21823

### Why is this needed?

To improve the code quality and to spot vulnerabilities in our code firsthand.

[^1]: Needs 3.7 backport.
[^2]: Can be improved after the Go 1.27 release.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.