Skip to content

Commit

Permalink
upgrade to latest dependencies (#5694)
Browse files Browse the repository at this point in the history
bumping knative.dev/hack 38316f2...f2f9b6f:
  > f2f9b6f Vendorless docs (# 324)
  > 46659bc Update actions (# 323)
  > 403114f Manual shellcheck (# 321)
  > 74aa02a 🐛 Remove deps from go.mod for knative.dev/hack (# 320)
  > 34850cd Update community files (# 319)
  > da6e74c 🐛 The `go.work.sum` don't influence the dependencies resolution (# 317)
  > c4a34c3 Collect LICENSE files from all dependencies, even without vendor dir (# 316)

Signed-off-by: Knative Automation <[email protected]>
  • Loading branch information
knative-automation authored Oct 3, 2023
1 parent 2658c41 commit f9598dc
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 35 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ require (
google.golang.org/grpc v1.36.0
gopkg.in/go-playground/webhooks.v3 v3.13.0
gopkg.in/yaml.v2 v2.3.0
knative.dev/hack v0.0.0-20230919151801-38316f28f0bf
knative.dev/hack v0.0.0-20230926181829-f2f9b6f91263
)

require (
Expand Down
9 changes: 4 additions & 5 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.4 h1:L8R9j+yAqZuZjsqh/z+F1NCffTKKLShY6zXTItVIZ8M=
github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ=
github.com/google/go-github v17.0.0+incompatible h1:N0LgJ1j65A7kfXrZnUDaYCs/Sf4rEjNlfyDHW9dolSY=
github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ=
github.com/google/go-github/v32 v32.1.0 h1:GWkQOdXqviCPx7Q7Fj+KyPoGm4SwHRh8rheoPhd27II=
Expand Down Expand Up @@ -206,8 +206,8 @@ github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4=
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk=
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
Expand Down Expand Up @@ -528,7 +528,6 @@ gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU=
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
Expand All @@ -539,8 +538,8 @@ honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9
honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
honnef.co/go/tools v0.0.1-2020.1.5 h1:nI5egYTGJakVyOryqLs1cQO5dO0ksin5XXs2pspk75k=
honnef.co/go/tools v0.0.1-2020.1.5/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
knative.dev/hack v0.0.0-20230919151801-38316f28f0bf h1:Hyyc838y8572zTWTuL2ymWAiAhL2ujz7OLlB/KMtHF0=
knative.dev/hack v0.0.0-20230919151801-38316f28f0bf/go.mod h1:dx0YG3YWqJu653e9tjcT0Q1ZdS9JJXLKbUhzr4EB0g8=
knative.dev/hack v0.0.0-20230926181829-f2f9b6f91263 h1:e6r9J1YopzSh6tDCpyKhVBfRUlZ2r0KRo9wupRjdRF4=
knative.dev/hack v0.0.0-20230926181829-f2f9b6f91263/go.mod h1:yk2OjGDsbEnQjfxdm0/HJKS2WqTLEFg/N6nUs6Rqx3Q=
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
31 changes: 21 additions & 10 deletions vendor/knative.dev/hack/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,16 @@ entrypoint functionality.

This is a helper script to run the presubmit tests. To use it:

1. Source this script.
1. Source this script:
```bash
source "$(go run knative.dev/hack/cmd/script presubmit-tests.sh)"
```

1. [optional] Define the function `build_tests()`. If you don't define this
function, the default action for running the build tests is to:

- run `go build` on the entire repo
- run `/hack/verify-codegen.sh` (if it exists)
- run `hack/verify-codegen.sh` (if it exists)
- check licenses in all go packages

1. [optional] Customize the default build test runner, if you're using it. Set
Expand Down Expand Up @@ -70,7 +73,7 @@ skipped.
### Sample presubmit test script

```bash
source vendor/knative.dev/hack/presubmit-tests.sh
source "$(go run knative.dev/hack/cmd/script presubmit-tests.sh)"

function post_build_tests() {
echo "Cleaning up after build tests"
Expand Down Expand Up @@ -99,7 +102,10 @@ This is a helper script for Knative E2E test scripts. To use it:
[here](https://github.com/knative/toolbox/blob/main/kntest/pkg/kubetest2/gke/README.md) to the `initialize` function
call if the default values don't fit your needs.

1. Source the script.
1. Source the script:
```bash
source "$(go run knative.dev/hack/cmd/script e2e-tests.sh)"
```

1. [optional] Write the `knative_setup()` function, which will set up your
system under test (e.g., Knative Serving).
Expand Down Expand Up @@ -166,8 +172,7 @@ for Knative Serving to be up before running the tests. It also requires that the
test cluster is created in a specific region, `us-west2`.
```bash

source vendor/knative.dev/hack/e2e-tests.sh
source "$(go run knative.dev/hack/cmd/script e2e-tests.sh)"
function knative_setup() {
start_latest_knative_serving
Expand Down Expand Up @@ -201,7 +206,10 @@ This is a helper script for Knative performance test scripts. In combination
with specific Prow jobs, it can automatically manage the environment for running
benchmarking jobs for each repo. To use it:
1. Source the script.
1. Source the script:
```bash
source "$(go run knative.dev/hack/cmd/script performance-tests.sh)"
```
1. [optional] Customize GCP project settings for the benchmarks. Set the
following environment variables if the default value doesn't fit your needs:
Expand Down Expand Up @@ -238,7 +246,7 @@ benchmarking jobs for each repo. To use it:
This script will update `Knative serving` and the given benchmark.
```bash
source vendor/knative.dev/hack/performance-tests.sh
source "$(go run knative.dev/hack/cmd/script performance-tests.sh)"
function update_knative() {
echo ">> Updating serving"
Expand All @@ -257,7 +265,10 @@ main $@
This is a helper script for Knative release scripts. To use it:
1. Source the script.
1. Source the script:
```bash
source "$(go run knative.dev/hack/cmd/script release.sh)"
```
1. [optional] By default, the release script will run
`./test/presubmit-tests.sh` as the release validation tests. If you need to
Expand Down Expand Up @@ -313,7 +324,7 @@ This is a helper script for Knative release scripts. To use it:
### Sample release script
```bash
source vendor/knative.dev/hack/release.sh
source "$(go run knative.dev/hack/cmd/script release.sh)"
function build_release() {
# config/ contains the manifests
Expand Down
4 changes: 3 additions & 1 deletion vendor/knative.dev/hack/embed.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ limitations under the License.

package hack

import "embed"
import (
"embed"
)

//go:embed *.sh
var Scripts embed.FS
2 changes: 0 additions & 2 deletions vendor/knative.dev/hack/go.work.sum

This file was deleted.

49 changes: 34 additions & 15 deletions vendor/knative.dev/hack/library.sh
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,30 @@ function foreach_go_module() {
# global env var: FLOATING_DEPS
# --upgrade will set GOPROXY to direct unless it is already set.
function go_update_deps() {
# The go.work.sum will be truncated if it exists. This is to allow the
# `go mod tidy` to resolve the dependencies, without the influence of the
# sums from the workspace.
__clean_goworksum_if_exists
foreach_go_module __go_update_deps_for_module "$@"
__remove_goworksum_if_empty
}

function __clean_goworksum_if_exists() {
if [ -f "$REPO_ROOT_DIR/go.work.sum" ]; then
echo "=== Cleaning the go.work.sum file"
true > "$REPO_ROOT_DIR/go.work.sum"
fi
}

function __remove_goworksum_if_empty() {
if [ -f "$REPO_ROOT_DIR/go.work" ]; then
echo "=== Syncing the go workspace"
go work sync
fi
if ! [ -s "$REPO_ROOT_DIR/go.work.sum" ]; then
echo "=== Removing empty go.work.sum"
rm -f "$REPO_ROOT_DIR/go.work.sum"
fi
}

function __go_update_deps_for_module() {
Expand Down Expand Up @@ -731,26 +754,22 @@ function __go_update_deps_for_module() {
fi
eval "$orig_pipefail_opt"

if ! [[ "${FORCE_VENDOR:-false}" == "true" ]] && ! [ -d vendor ]; then
return 0
fi

group "Removing unwanted vendor files"
if [[ "${FORCE_VENDOR:-false}" == "true" ]] || [ -d vendor ]; then
group "Removing unwanted vendor files"
find vendor/ \( -name "OWNERS" \
-o -name "OWNERS_ALIASES" \
-o -name "BUILD" \
-o -name "BUILD.bazel" \
-o -name "*_test.go" \) -exec rm -f {} +

# Remove unwanted vendor files
find vendor/ \( -name "OWNERS" \
-o -name "OWNERS_ALIASES" \
-o -name "BUILD" \
-o -name "BUILD.bazel" \
-o -name "*_test.go" \) -exec rm -f {} +
export GOFLAGS=-mod=vendor

export GOFLAGS=-mod=vendor
group "Removing broken symlinks"
remove_broken_symlinks ./vendor
fi

group "Updating licenses"
update_licenses third_party/VENDOR-LICENSE "./..."

group "Removing broken symlinks"
remove_broken_symlinks ./vendor
)
}

Expand Down
2 changes: 1 addition & 1 deletion vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ gopkg.in/go-playground/webhooks.v3/github
gopkg.in/yaml.v2
# honnef.co/go/tools v0.0.1-2020.1.5
## explicit; go 1.11
# knative.dev/hack v0.0.0-20230919151801-38316f28f0bf
# knative.dev/hack v0.0.0-20230926181829-f2f9b6f91263
## explicit; go 1.18
knative.dev/hack
# go.opencensus.io => go.opencensus.io v0.20.2

0 comments on commit f9598dc

Please sign in to comment.