-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
base: main
Are you sure you want to change the base?
Conversation
Skipping CI for Draft Pull Request. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: ivanvc The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted filessee 34 files with indirect coverage changes @@ Coverage Diff @@
## main #19423 +/- ##
==========================================
+ Coverage 68.60% 68.88% +0.27%
==========================================
Files 418 421 +3
Lines 35722 35857 +135
==========================================
+ Hits 24508 24701 +193
+ Misses 9766 9735 -31
+ Partials 1448 1421 -27 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 |
scripts/updatebom.sh
Outdated
@@ -14,7 +14,7 @@ function bom_fixlet { | |||
# shellcheck disable=SC2207 | |||
modules=($(modules_for_bom)) | |||
|
|||
if GOFLAGS=-mod=mod run_go_tool "github.com/appscodelabs/license-bill-of-materials" \ |
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.
GOFLAGS=-mod=mod
is this even a correct flag? Could we remove it regardless of workspace migration?
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.
Yes, I think so. This should predate Go 1.1113.
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.
Ah, never mind. Actually, I believe, due to the note in bom_pass
, we may need to leave the -mod=mod
flag in the tests. But you're right. There's no need for it to be here, as test_lib.sh
doesn't define a GOFLAGS=-mod
that we need to override. I'll open a pull request for this change.
I will review this PR after we officially release v3.6.0, thx |
eb81e5b
to
9ed8ecc
Compare
9ed8ecc
to
d3c2c0b
Compare
d3c2c0b
to
ba87efb
Compare
/test all |
ba87efb
to
ffa3c8a
Compare
/test all |
ffa3c8a
to
e34b154
Compare
/test all |
e34b154
to
d61efa2
Compare
/test pull-etcd-release-tests pull-etcd-verify |
/test all |
d61efa2
to
bfcaa23
Compare
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. Point all forbidden dependencies to a common virtual place (top-level FORBIDDEN_DEPENDENCY). For the workspace to function we need all dependencies to be consistent across the repository. That means that the current approach with FORBIDDEN_DEPENDENCY doesn't work, because they are pointing to different directories. Set the fictional v3.999.999 version for these dependencies, so they are consitent, and they don't clash with the actual depdendencies references in other modules. 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]>
bfcaa23
to
a56793e
Compare
/test pull-etcd-release-tests pull-etcd-verify |
@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. Instructions 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. |
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.