Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added prow job for depstat #22137

Merged
merged 12 commits into from
May 14, 2021
24 changes: 24 additions & 0 deletions config/jobs/kubernetes/sig-arch/kubernetes-depstat.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
presubmits:
kubernetes/kubernetes:
- name: kubernetes-depstat
decorate: true
always_run: true
skip_report: true
spec:
containers:
- image: golang
command: ["/bin/bash"]
args: ["-c", "set -euo;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think one of the tests is failing because it expects a ] at the end of this line. So should I have the entire thing in one line to fix this? '-'

@dims @spiffxp

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BASE_SHA="${PULL_BASE_SHA:-""}"; ARTIFACTS="${ARTIFACTS:-/tmp/artifacts}";
mkdir -p "${ARTIFACTS}";
cd "$ARTIFACTS"
go install github.com/kubernetes-sigs/depstat@latest;
cd /go/src/k8s.io/kubernetes
function write_report() { depstat stats --json; };
function diff_reports() { diff "$1" "$2"; };
write_report > "${ARTIFACTS}/stats.json";
if [ -n "${BASE_SHA}" ]; then
git checkout -b base "${BASE_SHA}";
write_report > "${ARTIFACTS}/stats-base.json";
diff_reports "${ARTIFACTS}"/stats-base.json "${ARTIFACTS}"/stats.json;
fi;"]