Skip to content

Commit

Permalink
CI: Add explicit static check script vendor test
Browse files Browse the repository at this point in the history
Update the `check_vendor()` function in the static check script to run
our current vendoring tool (`dep`) in check mode. This will ensure our
vendoring does not get silently broken [1].

Fixes kata-containers#1506.

[1] - See for example kata-containers/runtime#1442.

Signed-off-by: James O. D. Hunt <[email protected]>
  • Loading branch information
jodh-intel committed Apr 29, 2019
1 parent 50f3b03 commit 830983f
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions .ci/static-checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -581,11 +581,15 @@ check_files()
exit 1
}

# Ensure that changes to vendored code are accompanied by an update to the
# vendor tooling config file. If not, the user simply hacked the vendor files
# rather than following the correct process:
# Perform vendor checks:
#
# - https://github.com/kata-containers/community/blob/master/VENDORING.md
# - Ensure that changes to vendored code are accompanied by an update to the
# vendor tooling config file. If not, the user simply hacked the vendor files
# rather than following the correct process:
#
# https://github.com/kata-containers/community/blob/master/VENDORING.md
#
# - Ensure vendor metadata is valid.
check_vendor()
{
local files
Expand Down Expand Up @@ -615,6 +619,14 @@ check_vendor()
[ -n "$result" ] || die "PR changes vendor files, but does not update ${vendor_ctl_file}"
fi
fi

info "Checking vendoring metadata"

# Get the vendoring tool
go get github.com/golang/dep/cmd/dep

# Check, but don't touch!
dep ensure -no-vendor -dry-run
}

main()
Expand Down

0 comments on commit 830983f

Please sign in to comment.