[master] Auto-update dependencies (#2421)

Produced via:
  `./hack/update-deps.sh --upgrade && ./hack/update-codegen.sh`
/assign dprotaso grantr samodell
/cc dprotaso grantr samodell
This commit is contained in:
Matt Moore 2020-04-30 13:20:43 -07:00 committed by GitHub
parent 97fe5d54db
commit 4450f6d41f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 14 deletions

4
Gopkg.lock generated
View File

@ -501,14 +501,14 @@
[[projects]]
branch = "master"
digest = "1:31bd9c0a200618a3325145139d59d17726c7ffaa2ae4d88480de3ee5137714bb"
digest = "1:6891ecd71836af843aa41478590fb59bae583c7b1659882e9a0c3336f260457c"
name = "knative.dev/test-infra"
packages = [
"scripts",
"tools/dep-collector",
]
pruneopts = "UT"
revision = "bf3e6802597ac31776a8e3e62b32d51744b2ae77"
revision = "f4c4853375cf2714a7e913c6c7d59ca7ce7e2363"
[solve-meta]
analyzer-name = "dep"

View File

@ -498,24 +498,25 @@ function run_go_tool() {
${tool} "$@"
}
# Run dep-collector to update licenses.
# Run go-licenses to update licenses.
# Parameters: $1 - output file, relative to repo root dir.
# $2...$n - directories and files to inspect.
# $2 - directory to inspect.
function update_licenses() {
cd ${REPO_ROOT_DIR} || return 1
cd "${REPO_ROOT_DIR}" || return 1
local dst=$1
local dir=$2
shift
run_go_tool knative.dev/test-infra/tools/dep-collector dep-collector $@ > ./${dst}
run_go_tool github.com/google/go-licenses go-licenses save "${dir}" --save_path="${dst}" --force || return 1
# Hack to make sure directories retain write permissions after save. This
# can happen if the directory being copied is a Go module.
# See https://github.com/google/go-licenses/issues/11
chmod -R +w "${dst}"
}
# Run dep-collector to check for forbidden liceses.
# Parameters: $1...$n - directories and files to inspect.
# Run go-licenses to check for forbidden licenses.
function check_licenses() {
# Fetch the google/licenseclassifier for its license db
rm -fr ${GOPATH}/src/github.com/google/licenseclassifier
GOFLAGS="" go get -u github.com/google/licenseclassifier
# Check that we don't have any forbidden licenses in our images.
run_go_tool knative.dev/test-infra/tools/dep-collector dep-collector -check $@
# Check that we don't have any forbidden licenses.
run_go_tool github.com/google/go-licenses go-licenses check "${REPO_ROOT_DIR}/..." || return 1
}
# Run the given linter on the given files, checking it exists first.

View File

@ -49,6 +49,9 @@ function pr_only_contains() {
# List changed files in the current PR.
# This is implemented as a function so it can be mocked in unit tests.
function list_changed_files() {
# Avoid warning when there are more than 1085 files renamed:
# https://stackoverflow.com/questions/7830728/warning-on-diff-renamelimit-variable-when-doing-git-push
git config diff.renames 0
git --no-pager diff --name-only ${PULL_BASE_SHA}..${PULL_SHA}
}
@ -198,7 +201,7 @@ function default_build_test_runner() {
create_junit_xml _build_tests Build_Go "${errors_go}"
# Check that we don't have any forbidden licenses in our images.
subheader "Checking for forbidden licenses"
report_build_test Check_Licenses check_licenses ${go_pkg_dirs} || failed=1
report_build_test Check_Licenses check_licenses || failed=1
return ${failed}
}