Merge pull request #58849 from cblecker/staging-speed

Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Only run verify-staging-godeps if staging/godeps are touched

**What this PR does / why we need it**:
I had a lightbulb moment. On presubmit, we only verify godeps if one of the following is changed:
- The godep scripts
- The Godeps/ dir
- The vendor/ dir

The same should apply to verifying the staging godeps, adding in the staging dir itself. The logic being, if we don't touch Godeps/vendor, we don't touch the script that generates stuff, and we don't make changes to the staging dir itself (like adding/removing imports), then we don't need to verify godeps.

Note that post-submit CI jobs will still check these, as I'm copying the same logic that's in verify-godeps

This seems too easy, so *please* point out if I'm missing something.

**Release note**:
```release-note
NONE
```
pull/6/head
Kubernetes Submit Queue 2018-01-31 09:33:45 -08:00 committed by GitHub
commit aa12b9b7cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 0 deletions

View File

@ -25,6 +25,7 @@ readonly branch=${1:-${KUBE_VERIFY_GIT_BRANCH:-master}}
if ! [[ ${KUBE_FORCE_VERIFY_CHECKS:-} =~ ^[yY]$ ]] && \
! kube::util::has_changes_against_upstream_branch "${branch}" 'Godeps/' && \
! kube::util::has_changes_against_upstream_branch "${branch}" 'vendor/' && \
! kube::util::has_changes_against_upstream_branch "${branch}" 'hack/lib/' && \
! kube::util::has_changes_against_upstream_branch "${branch}" 'hack/.*godep'; then
exit 0
fi

View File

@ -19,4 +19,17 @@ set -o nounset
set -o pipefail
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
source "${KUBE_ROOT}/hack/lib/init.sh"
readonly branch=${1:-${KUBE_VERIFY_GIT_BRANCH:-master}}
if ! [[ ${KUBE_FORCE_VERIFY_CHECKS:-} =~ ^[yY]$ ]] && \
! kube::util::has_changes_against_upstream_branch "${branch}" 'staging/' && \
! kube::util::has_changes_against_upstream_branch "${branch}" 'build/' && \
! kube::util::has_changes_against_upstream_branch "${branch}" 'Godeps/' && \
! kube::util::has_changes_against_upstream_branch "${branch}" 'vendor/' && \
! kube::util::has_changes_against_upstream_branch "${branch}" 'hack/lib/' && \
! kube::util::has_changes_against_upstream_branch "${branch}" 'hack/.*godep'; then
exit 0
fi
KUBE_VERBOSE="${KUBE_VERBOSE:-3}" KUBE_RUN_COPY_OUTPUT=N ${KUBE_ROOT}/hack/update-staging-godeps.sh -d -f "$@"