aboutsummaryrefslogtreecommitdiff
path: root/contrib/cirrus
diff options
context:
space:
mode:
authorChris Evich <cevich@redhat.com>2022-09-21 15:08:18 -0400
committerChris Evich <cevich@redhat.com>2022-09-23 10:53:42 -0400
commit69ac1e36c43f4ce1616716882347067ee9f40c72 (patch)
treeb1392d9f3c1c27280ed447857a3f0e4f11ca5405 /contrib/cirrus
parent25dc2759e10bf0293f14a2205291ab7dd53eccf4 (diff)
downloadpodman-69ac1e36c43f4ce1616716882347067ee9f40c72.tar.gz
podman-69ac1e36c43f4ce1616716882347067ee9f40c72.tar.bz2
podman-69ac1e36c43f4ce1616716882347067ee9f40c72.zip
Cirrus: Catch use of deprecated io/ioutil package
At the time of this commit, there's no easier way to detect this using `golangci-lint` or the go tool (that I could find). A future update to the `go list` command may support detection, for now use a CI script. Signed-off-by: Chris Evich <cevich@redhat.com>
Diffstat (limited to 'contrib/cirrus')
-rwxr-xr-xcontrib/cirrus/runner.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/contrib/cirrus/runner.sh b/contrib/cirrus/runner.sh
index 6b2d123f2..5b1bc8d5c 100755
--- a/contrib/cirrus/runner.sh
+++ b/contrib/cirrus/runner.sh
@@ -233,6 +233,25 @@ function _run_consistency() {
SUGGESTION="run 'make generate-bindings' and commit all changes" ./hack/tree_status.sh
make completions
SUGGESTION="run 'make completions' and commit all changes" ./hack/tree_status.sh
+
+ if [[ -z "$CIRRUS_TAG" ]] && \
+ req_env_vars CIRRUS_CHANGE_IN_REPO CIRRUS_PR DEST_BRANCH
+ then
+ local base diffs regex i
+ # Prevent this check from detecting itself
+ i=i
+ msg "#####"
+ msg "Verifying no change adds new calls to ${i}o/${i}outil."
+ base=$(git merge-base $DEST_BRANCH $CIRRUS_CHANGE_IN_REPO)
+ diffs=$(git diff $base $CIRRUS_CHANGE_IN_REPO -- '*.go' ':^vendor/')
+ regex=$(echo -e "^(\\+.+${i}o/${i}outil)|(\\+.+${i}outil\\..+)")
+ if egrep -q "$regex"<<<"$diffs"; then
+ die "Found attempted use of deprecated ${i}outils:
+$(egrep -B 5 -A 5 "$regex"<<<"$diffs")"
+ fi
+ else
+ msg "Skipping check for ${i}o/${i}outil addition."
+ fi
}
function _run_build() {