Skip to content

Conversation

@ivanvc
Copy link
Member

@ivanvc ivanvc commented Feb 15, 2025

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.

@k8s-ci-robot
Copy link

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@codecov
Copy link

codecov bot commented Feb 15, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 69.23%. Comparing base (da267f1) to head (8b02416).
⚠️ Report is 10 commits behind head on main.

Additional details and impacted files

see 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.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update da267f1...8b02416. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ivanvc
Copy link
Member Author

ivanvc commented Feb 15, 2025

/test all

@ivanvc ivanvc force-pushed the introduce-a-min-workspace branch 2 times, most recently from d555146 to b7e86a4 Compare February 18, 2025 06:03
@ivanvc ivanvc changed the title [do not review] Go workspace Minimal changes to enable a Go workspace Feb 18, 2025
@ivanvc ivanvc force-pushed the introduce-a-min-workspace branch from b7e86a4 to eb81e5b Compare February 18, 2025 06:26
@ivanvc ivanvc marked this pull request as ready for review February 18, 2025 06:45
@ivanvc
Copy link
Member Author

ivanvc commented Feb 18, 2025

/cc @ahrtr @serathius

@ahrtr
Copy link
Member

ahrtr commented Feb 21, 2025

I will review this PR after we officially release v3.6.0, thx

@ivanvc
Copy link
Member Author

ivanvc commented Sep 24, 2025

pull-etcd-verify is failing due to the bom check. Before I managed to make it fail consistently in a just cloned repository. I have a workaround for this. I think it may be a combination of Go 1.25 and the workspace that is making it fail. I'll address it soon.

@serathius
Copy link
Member

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.

@ivanvc
Copy link
Member Author

ivanvc commented Sep 24, 2025

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 :)

@k8s-ci-robot
Copy link

k8s-ci-robot commented Oct 3, 2025

@ivanvc: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci-etcd-robustness-release36-amd64 2cab586 link true /test ci-etcd-robustness-release36-amd64
pull-etcd-govulncheck-main aba141c link true /test pull-etcd-govulncheck-main

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.

Details

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.

ivanvc and others added 5 commits October 3, 2025 15:54
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]>
@ivanvc ivanvc force-pushed the introduce-a-min-workspace branch from 0168a0d to 8b02416 Compare October 3, 2025 22:55
module go.etcd.io/etcd/api/v3

go 1.25
go 1.25.0
Copy link
Member

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?

Copy link
Member Author

@ivanvc ivanvc Oct 4, 2025

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).

@ivanvc
Copy link
Member Author

ivanvc commented Oct 4, 2025

The @k8s-ci-robot reports that pull-etcd-govulncheck-main failed. But this is an old test that we don't have anymore. We replaced it with pull-etcd-govulncheck, and the run is successful: https://prow.k8s.io/view/gs/kubernetes-ci-logs/pr-logs/pull/etcd-io_etcd/19423/pull-etcd-govulncheck/1974246855806029824.

Copy link
Member

@ahrtr ahrtr left a 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!

@k8s-ci-robot
Copy link

[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

Details Needs approval from an approver in each of these files:
  • OWNERS [ahrtr,fuweid,ivanvc,serathius]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@fuweid fuweid merged commit 2939a48 into etcd-io:main Oct 5, 2025
31 checks passed
@ivanvc ivanvc deleted the introduce-a-min-workspace branch October 7, 2025 06:42
@serathius
Copy link
Member

This is awesome!

@ivanvc ivanvc mentioned this pull request Oct 16, 2025
40 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

6 participants