Replace `go list -m` with `go mod edit -json`, as the latter can return
the same information. This will be helpful when the project migrates to
using a Go workspace, as it will return the current module defined in
go.mod rather than all the modules from the current directory (using a
workspace, the top-level go.mod will return all the child modules from
the repository).
Signed-off-by: Ivan Valdes <ivan@vald.es>
Replace `go list -m` with `go mod edit -json`, as the latter can return
the same information. This will be helpful when the project migrates to
using a Go workspace, as it will return the current module defined in
go.mod rather than all the modules from the current directory (using a
workspace, the top-level go.mod will return all the child modules from
the repository).
Signed-off-by: Ivan Valdes <ivan@vald.es>
The GitHub release templates had the wrong version minor when there's a
prerelease part in the version (i.e., v3.6.0-rc.0). It cut until the
last dot, leaving a wrong minor version (i.e., v3.6.0-rc).
Signed-off-by: Ivan Valdes <ivan@vald.es>
Align running the code coverage upload with other workflows by
executing it from a Makefile target.
Update the current GitHub workflow to call this new target.
Signed-off-by: Ivan Valdes <ivan@vald.es>
commit 1897d8af05b3627ac4374f1d2fb285fb7af5199e
Author: Gang Li <gangligit@gmail.com>
Date: Mon Feb 3 16:35:20 2025 -0800
use uname -s to get os name
Signed-off-by: Gang Li <gangligit@gmail.com>
commit 889dd974d5873b8c5e7ccd55732279146db1bcc3
Author: Gang Li <gangligit@gmail.com>
Date: Mon Feb 3 11:34:13 2025 -0800
download correct binary for mac os
Signed-off-by: Gang Li <gangligit@gmail.com>
Signed-off-by: Gang Li <gangligit@gmail.com>
* Wrap script in functions, add a main function, and call them from it.
* Make environment variables local inside the function scope to avoid
unexpected behaviors by the running environment-supplied variables.
* Fix the typo in the "REPOSITORY" environment variable.
* Rename the input "IMAGE" to "TEST_IMAGE" to avoid clashing with the
environment variable from the Prow infrastructure.
Signed-off-by: Ivan Valdes <ivan@vald.es>
Executed both scripts below again,
- ./scripts/genproto.sh
- ./scripts/update_proto_annotations.sh
Signed-off-by: Benjamin Wang <benjamin.ahrtr@gmail.com>
Add space between ${ETCD_VER} and Path
Co-authored-by: sunfeilong <31331079+sunfeilong@users.noreply.github.com>
Signed-off-by: Ivan Valdes <ivan@vald.es>
This check is duplicated as the project uses revive's receiver-naming,
which is more robust, as the current check may have false positives.
Signed-off-by: Ivan Valdes <ivan@vald.es>
The BOM fix is called from the fix-bom target, which is also a
prerequisite for the fix target. Therefore, running `make fix` runs the
BOM fix twice.
Signed-off-by: Ivan Valdes <ivan@vald.es>
Originally this was intended to be a clean up. But after further
investigation the original code didn't work. It didn't detect tabs in
shell scripts.
Signed-off-by: Ivan Valdes <ivan@vald.es>
The original go mod tidy pass implementation was done before the `--diff`
go mod option existed. This simplifies the implementation, as temporary
files are no longer needed.
Signed-off-by: Ivan Valdes <ivan@vald.es>
The script currently fails if the version provided has the "v" prefix
(i.e., v3.6.0). Allow receiving the prefix and continue with the
process.
Signed-off-by: Ivan Valdes <ivan@vald.es>
* Please add etcd_version annotation in *.proto file with next etcd version
* Run ./scripts/genproto.sh
push_pin
* Run ./scripts/update_proto_annotations.sh
Signed-off-by: ArkaSaha30 <arkasaha30@gmail.com>
Currently, the script won't change directories into the previously
cloned repository if the temporary location exists. This may be an issue
when testing first with a dry run and later with the actual release.
Signed-off-by: Ivan Valdes <ivan@vald.es>
As `tools/mod` also contains the `go.mod` file. We should add it to the
`module_dirs` variable, so that when executing `./scripts/fix.sh`, the
proper checks and fixes can be applied.
To address the issue of broken unit tests and code coverage due to the
directory's lack of Go code, we've introduced a new doc.go file. This
file acts as a placeholder, enabling tools like golangci-lint and
go test to function correctly.
---
Discovered when working on https://github.com/etcd-io/etcd/pull/18575
The directories are checked against the following:
- Command: `find . -type f -name go.mod -exec dirname {} \;`
- Output:
```
./etcdutl
.
./tools/testgrid-analysis
./tools/rw-heatmaps
./tools/mod
./etcdctl
./tests
./server
./api
./client/internal/v2
./client/v3
./client/pkg
./pkg
```
Signed-off-by: Chun-Hung Tseng <henrybear327@gmail.com>
The tests/Dockerfile was outdated (using an obsolete Ubuntu
distribution), and it's not being used by any workflow or prow job. This
Dockerfile was the only one using `scripts/install-marker.sh`, which
used a vendorized binary generated by the etcd project. This is not
needed anymore, as marker releases now provide the binaries.
Signed-off-by: Ivan Valdes <ivan@vald.es>
The markdown linter, marker, now publishes a released version with the
tool. Given that this project is written in Rust, running this check can
now be done by using the statically compiled binary without having the
Rust local environment.
Signed-off-by: Ivan Valdes <ivan@vald.es>
As tools/mod is not part of the test library's modules, the check to verify
consistent dependency versions ignored it. Explicitly get the dependencies from
this module when running verify-dep.
Signed-off-by: Ivan Valdes <ivan@vald.es>
The bucket is already fully public so new releases don't need to run this command.
This will prevent significant terminal spam during the release process as there are thousands of objects in the bucket.
Signed-off-by: James Blair <mail@jamesblair.net>
Makefile's target `verify-dep` current behavior is to use `go list` to
check consistent dependency versions from direct dependencies. Ignoring
indirect dependencies in a multi-module project could lead to version
mismatches. If module A imports module B, module B's dependency will be
an indirect dependency in module A. Which can potentially have a version
mismatch. Therefore, use `go mod edit` with indirect dependencies, too.
So it can work with all dependencies defined in go.mod.
Fix displaying dependencies with mismatches, as the old code was
searching with grep just for the prefix, which would show other
dependencies that shared the same prefix.
Signed-off-by: Ivan Valdes <ivan@vald.es>
This commit adds a script to sync the version present in .go-version
across all go.mod files as the toolchain directive. As part of that,
this commit also modifies go.mod files that did not have synced toolchain
directives.
Additionally, this also adds a script to verify all toolchain and go
directives against the version present in .go-version as follows:
(1) The go directive <= version in .go-version
(2) The toolchain directive == version in .go-version
This script runs as part of the `make verify` target, making it run
as a presbumit by default.
Signed-off-by: Madhav Jivrajani <madhav.jiv@gmail.com>
Additionally, provide ability to opt-out of the .go-version and use a
custom one via env vars: FORCE_HOST_GO and GO_VERSION.
Signed-off-by: Madhav Jivrajani <madhav.jiv@gmail.com>