diff --git a/go.mod b/go.mod index 7941a6655..67ff0da32 100644 --- a/go.mod +++ b/go.mod @@ -22,7 +22,7 @@ require ( knative.dev/eventing v0.13.1 knative.dev/pkg v0.0.0-20200304185554-312b1be35ceb knative.dev/serving v0.13.0 - knative.dev/test-infra v0.0.0-20200229011351-4dac123b9a3d + knative.dev/test-infra v0.0.0-20200317044931-e97f2ecc90ce sigs.k8s.io/yaml v1.1.0 ) diff --git a/go.sum b/go.sum index 8354f028e..55fcbcab0 100644 --- a/go.sum +++ b/go.sum @@ -598,8 +598,8 @@ knative.dev/pkg v0.0.0-20200304185554-312b1be35ceb h1:cgpFaVF0jb7z+zJGzq30HMfxMm knative.dev/pkg v0.0.0-20200304185554-312b1be35ceb/go.mod h1:pgODObA1dTyhNoFxPZTTjNWfx6F0aKsKzn+vaT9XO/Q= knative.dev/serving v0.13.0 h1:HkkTVBi6EWoFJcgjXgAVUFdKdxZRulb38dnfnkBYCrQ= knative.dev/serving v0.13.0/go.mod h1:x2n255JS2XBI39tmjZ8CwTxIf9EKNMCrkVuiOttLRm0= -knative.dev/test-infra v0.0.0-20200229011351-4dac123b9a3d h1:YlscBzPOL3Rfyl8844/wHhJNL5uiHDdyaRn6IEVvv64= -knative.dev/test-infra v0.0.0-20200229011351-4dac123b9a3d/go.mod h1:xcdUkMJrLlBswIZqL5zCuBFOC22WIPMQoVX1L35i0vQ= +knative.dev/test-infra v0.0.0-20200317044931-e97f2ecc90ce h1:XTqgZ7XLDcRcmGxBwjnEkmQDHT6xg25skjGe6K1H0Cs= +knative.dev/test-infra v0.0.0-20200317044931-e97f2ecc90ce/go.mod h1:xcdUkMJrLlBswIZqL5zCuBFOC22WIPMQoVX1L35i0vQ= modernc.org/cc v1.0.0/go.mod h1:1Sk4//wdnYJiUIxnW8ddKpaOJCF37yAdqYnkxUpaYxw= modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk= modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k= diff --git a/vendor/knative.dev/test-infra/scripts/markdown-link-check-config.rc b/vendor/knative.dev/test-infra/scripts/markdown-link-check-config.rc index 9d802a0d4..49b042e82 100644 --- a/vendor/knative.dev/test-infra/scripts/markdown-link-check-config.rc +++ b/vendor/knative.dev/test-infra/scripts/markdown-link-check-config.rc @@ -1,5 +1,5 @@ # For help, see # https://github.com/raviqqe/liche/blob/master/README.md -# Don't check localhost links --x "^https?://localhost($|[:/].*)" +# Don't check localhost links and don't check templated links +-x "(^https?://localhost($|[:/].*))|(^https://.*{{.*$)" diff --git a/vendor/knative.dev/test-infra/scripts/presubmit-tests.sh b/vendor/knative.dev/test-infra/scripts/presubmit-tests.sh index c14f25171..a7f95657d 100644 --- a/vendor/knative.dev/test-infra/scripts/presubmit-tests.sh +++ b/vendor/knative.dev/test-infra/scripts/presubmit-tests.sh @@ -147,14 +147,20 @@ function markdown_build_tests() { # Default build test runner that: # * check markdown files -# * `go build` on the entire repo # * run `/hack/verify-codegen.sh` (if it exists) +# * `go build` on the entire repo # * check licenses in all go packages function default_build_test_runner() { local failed=0 - # Perform markdown build checks first + # Perform markdown build checks markdown_build_tests || failed=1 - # For documentation PRs, just check the md files + # Run verify-codegen check + if [[ -f ./hack/verify-codegen.sh ]]; then + subheader "Checking autogenerated code is up-to-date" + report_build_test Verify_CodeGen ./hack/verify-codegen.sh || failed=1 + fi + # For documentation PRs, just check the md files and run + # verify-codegen (as md files can be auto-generated in some repos). (( IS_DOCUMENTATION_PR )) && return ${failed} # Don't merge these two lines, or return code will always be 0. local go_pkg_dirs @@ -186,13 +192,9 @@ function default_build_test_runner() { # Remove unused generated binary, if any. rm -f e2e.test done - + local errors_go="$(echo -e "${errors_go1}\n${errors_go2}" | uniq)" create_junit_xml _build_tests Build_Go "${errors_go}" - if [[ -f ./hack/verify-codegen.sh ]]; then - subheader "Checking autogenerated code is up-to-date" - report_build_test Verify_CodeGen ./hack/verify-codegen.sh || failed=1 - fi # 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 diff --git a/vendor/knative.dev/test-infra/scripts/release.sh b/vendor/knative.dev/test-infra/scripts/release.sh index 915fc97f6..d23c4c33b 100644 --- a/vendor/knative.dev/test-infra/scripts/release.sh +++ b/vendor/knative.dev/test-infra/scripts/release.sh @@ -498,9 +498,30 @@ function publish_artifacts() { # Entry point for a release script. function main() { + parse_flags "$@" + + # Checkout specific branch, if necessary + local current_branch + current_branch="$(git rev-parse --abbrev-ref HEAD)" + if [[ -n "${RELEASE_BRANCH}" && -z "${FROM_NIGHTLY_RELEASE}" && "${current_branch}" != "${RELEASE_BRANCH}" ]]; then + setup_upstream + setup_branch + # When it runs in Prow, the origin is identical with upstream, and previous + # fetch already fetched release-* branches, so no need to `checkout -b` + if (( IS_PROW )); then + git checkout "${RELEASE_BRANCH}" || abort "cannot checkout branch ${RELEASE_BRANCH}" + else + git checkout -b "${RELEASE_BRANCH}" upstream/"${RELEASE_BRANCH}" || abort "cannot checkout branch ${RELEASE_BRANCH}" + fi + # HACK HACK HACK + # Rerun the release script from the release branch. Fixes https://github.com/knative/test-infra/issues/1262 + ./hack/release.sh "$@" + exit "$?" + fi + function_exists build_release || abort "function 'build_release()' not defined" [[ -x ${VALIDATION_TESTS} ]] || abort "test script '${VALIDATION_TESTS}' doesn't exist" - parse_flags "$@" + # Log what will be done and where. banner "Release configuration" if which gcloud &>/dev/null ; then @@ -533,13 +554,6 @@ function main() { fi [[ -n "${RELEASE_NOTES}" ]] && echo "- Release notes are generated from '${RELEASE_NOTES}'" - # Checkout specific branch, if necessary - if [[ -n "${RELEASE_BRANCH}" && -z "${FROM_NIGHTLY_RELEASE}" ]]; then - setup_upstream - setup_branch - git checkout upstream/${RELEASE_BRANCH} || abort "cannot checkout branch ${RELEASE_BRANCH}" - fi - if [[ -n "${FROM_NIGHTLY_RELEASE}" ]]; then build_from_nightly_release else diff --git a/vendor/modules.txt b/vendor/modules.txt index 79ab33800..429483e4f 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -525,7 +525,7 @@ knative.dev/serving/pkg/autoscaler/config knative.dev/serving/pkg/client/clientset/versioned/scheme knative.dev/serving/pkg/client/clientset/versioned/typed/serving/v1 knative.dev/serving/pkg/client/clientset/versioned/typed/serving/v1/fake -# knative.dev/test-infra v0.0.0-20200229011351-4dac123b9a3d +# knative.dev/test-infra v0.0.0-20200317044931-e97f2ecc90ce knative.dev/test-infra/scripts # sigs.k8s.io/kustomize v2.0.3+incompatible sigs.k8s.io/kustomize/pkg/commands/build