From 919d0f1f7b64c14826b69808317bf9ae1e0b3778 Mon Sep 17 00:00:00 2001 From: David Galloway Date: Wed, 30 Sep 2020 12:24:36 -0400 Subject: [PATCH] ceph-pr-commits: Don't require signed commits for doc/ dir Signed-off-by: David Galloway --- ceph-pr-commits/build/build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/ceph-pr-commits/build/build b/ceph-pr-commits/build/build index 758d49fe..a22a3c5f 100644 --- a/ceph-pr-commits/build/build +++ b/ceph-pr-commits/build/build @@ -1,9 +1,25 @@ #!/bin/bash +# Don't require signed commits if only docs changed. +# Modified from ceph-docs/build/build. +# I tried using the excluded-regions parameter for the ghprb plugin but since +# this job/check is required, it hung with 'Expected — Waiting for status to be reported' +cd "$WORKSPACE/ceph" +if git rev-parse --verify ${GIT_COMMIT}^2; then + files="$(git diff --name-only ${GIT_COMMIT}^1...${GIT_COMMIT}^2)" + echo -e "changed files:\n$files" + if [ $(echo "$files" | grep -v '^doc/' | wc -l) -gt 0 ]; then + echo "Not a docs only change. Will proceed with signed commit check." + cd - + else + echo "Only the doc/ dir changed. No need to check for signed commits." + exit 0 + fi +fi + # the following two methods exist in scripts/build_utils.sh pkgs=( "pytest" ) install_python_packages "pkgs[@]" - cd "$WORKSPACE" timeout 600 $VENV/py.test -vs --junitxml="$WORKSPACE/report.xml" "$WORKSPACE/ceph-build/ceph-pr-commits/build/test_commits.py" -- 2.39.5