-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Minimal changes to enable a Go workspace #19423
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Skipping CI for Draft Pull Request. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted filessee 32 files with indirect coverage changes @@ Coverage Diff @@
## main #19423 +/- ##
==========================================
+ Coverage 68.61% 69.23% +0.61%
==========================================
Files 422 422
Lines 34819 34819
==========================================
+ Hits 23891 24106 +215
+ Misses 9516 9322 -194
+ Partials 1412 1391 -21 Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
|
/test all |
d555146 to
b7e86a4
Compare
b7e86a4 to
eb81e5b
Compare
|
/cc @ahrtr @serathius |
|
I will review this PR after we officially release v3.6.0, thx |
eb81e5b to
9ed8ecc
Compare
9ed8ecc to
d3c2c0b
Compare
|
|
|
Using depguard looks great. Could we separate PR to migrate to depguard? That would allow us to make smaller, more intentional steps and main PR smaller. |
Great idea! I'll open a PR shortly :) |
c7d7744 to
5bb72fa
Compare
|
@ivanvc: The following tests failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
Introduce a new Go workspace that references all the current submodules. To preserve the current behavior, point all of the current FORBIDDEN_DEPENCENCY virtual dependencies to the same path. Add scripts/update_go_workspace.sh that generates the Go workspace file (go.work) based on the submodules found in the project (excluding the tools) and creates the go.work.sum file after running go mod download. Added this script to the fix Makefile target. Even though, the number of modules in the etcd repository is small, by adding an automated way of updating the go.work modules future proofs the project in case there are new modules or removal of them. Remove the workaround to forbid dependencies through the FORBIDDEN_DEPENDENCY replace. This can be done through a linter rather than at the go.mod level. Using the go.mod approach also brings issues with the workspace, as all the dependencies (including replaces) need to have a consistent version and point to the same place. Co-authored-by: Tim Hockin <[email protected]> Signed-off-by: Ivan Valdes <[email protected]>
Introduce a new `verify-go-workspace` make target executed by the `verify` target. The pull-etcd-verify presubmit prow job will execute it. It ensures that the Go workspace (`go.work` and `go.work.sum`) is in sync. Signed-off-by: Ivan Valdes <[email protected]>
Add checking for the Go toolchain directive in the go.work file too. Signed-off-by: Ivan Valdes <[email protected]>
Remove `GOFLAGS=-mod=mod` from the execution of license-bill-of-materials. Signed-off-by: Ivan Valdes <[email protected]>
Signed-off-by: Ivan Valdes <[email protected]>
0168a0d to
8b02416
Compare
| module go.etcd.io/etcd/api/v3 | ||
|
|
||
| go 1.25 | ||
| go 1.25.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why set to 1.25.0 while toolchain is on 1.25.1?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Human error due to rebasing 😅😆
Nevermind, this is the minimum Go version. We usually leave w/o the patch until a dependency forces us to set it to the "0" patch (1.25.0 in this case).
|
The @k8s-ci-robot reports that |
ahrtr
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks for the great work!
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ahrtr, fuweid, ivanvc, serathius The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
This is awesome! |
This pull request is a follow-up on #19314.
It introduces minimal changes to enable a workspace in the project. We can iterate on it later to remove the script nuances of looping over the modules to execute commands, as they can now be executed from the top level of the repository.
Part of #18409.
Please read https://github.com/etcd-io/etcd/blob/main/CONTRIBUTING.md#contribution-flow.