Add make target to verify deps (#2922)

Add a target that tells us when deps are not in sync.
We can decide if we want a lane for this (and whether it is required) later.

Signed-off-by: Alex Kalenyuk <akalenyu@redhat.com>
Co-authored-by: Alex Kalenyuk <akalenyu@redhat.com>
This commit is contained in:
kubevirt-bot 2023-10-09 18:20:51 +02:00 committed by GitHub
parent 163baba8b7
commit 2ea79c02d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 50 deletions

View File

@ -46,8 +46,7 @@ update-codegen:
generate: update-codegen bazel-generate generate-doc
generate-verify: generate-doc
${DO_BAZ} "./hack/verify-codegen.sh"
generate-verify: generate
git difftool -y --trust-exit-code --extcmd=./hack/diff-csv.sh
gomod-update:
@ -55,6 +54,9 @@ gomod-update:
deps-update: gomod-update bazel-generate
deps-verify: deps-update
git difftool -y --trust-exit-code --extcmd=./hack/diff-csv.sh
rpm-deps:
${DO_BAZ} "CUSTOM_REPO=${CUSTOM_REPO} ./hack/build/rpm-deps.sh"

View File

@ -4,4 +4,4 @@
# git difftool -y --extcmd=hacks/diff-csv.sh
#
# currently used for make sanity
diff --unified=1 --ignore-matching-lines='^\s*createdAt:' $@
diff -Napr --unified=1 --ignore-matching-lines='^\s*createdAt:' $@

View File

@ -1,47 +0,0 @@
#!/usr/bin/env bash
# Copyright 2017 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set -o errexit
set -o nounset
set -o pipefail
SCRIPT_ROOT=$(dirname "${BASH_SOURCE}")/..
DIFFROOT="${SCRIPT_ROOT}/pkg"
TMP_DIFFROOT="${SCRIPT_ROOT}/_tmp/pkg"
_tmp="${SCRIPT_ROOT}/_tmp"
cleanup() {
rm -rf "${_tmp}"
}
trap "cleanup" EXIT SIGINT
cleanup
mkdir -p "${TMP_DIFFROOT}"
cp -a "${DIFFROOT}"/* "${TMP_DIFFROOT}"
"${SCRIPT_ROOT}/hack/update-codegen.sh"
echo "diffing ${DIFFROOT} against freshly generated codegen"
ret=0
diff -Naupr "${DIFFROOT}" "${TMP_DIFFROOT}" -x *.bazel || ret=$?
cp -a "${TMP_DIFFROOT}"/* "${DIFFROOT}"
if [[ $ret -eq 0 ]]; then
echo "${DIFFROOT} up to date."
else
echo "${DIFFROOT} is out of date. Please run hack/update-codegen.sh"
exit 1
fi