From 495c7b66b171af4d38bf069681774486d0868835 Mon Sep 17 00:00:00 2001 From: Anil Belur Date: Tue, 9 Mar 2021 14:34:53 +1000 Subject: [PATCH] Pin git review to 1.78 The latest version of module trys to look for git hook recursively within the submodules. Error: Entering 'global-jjb' cannot stat '.git/hooks/commit-msg': Not a directory fatal: run_command returned non-zero status for global-jjb Remove workaround that has been resolved in v1.28 and use lf-activate-venv to install git-review Issue: RELENG-3435 Change-Id: I67b3730dcdf5a410020c63312897bb67b42017bd Signed-off-by: Anil Belur --- .../pin-git-review-v1.78-cc90954e3c50956a.yaml | 25 ++++++++++++++++++++++ shell/gerrit-fetch-dependencies.sh | 15 +++++-------- shell/gerrit-push-patch.sh | 2 +- 3 files changed, 31 insertions(+), 11 deletions(-) create mode 100644 releasenotes/notes/pin-git-review-v1.78-cc90954e3c50956a.yaml diff --git a/releasenotes/notes/pin-git-review-v1.78-cc90954e3c50956a.yaml b/releasenotes/notes/pin-git-review-v1.78-cc90954e3c50956a.yaml new file mode 100644 index 00000000..06b5f744 --- /dev/null +++ b/releasenotes/notes/pin-git-review-v1.78-cc90954e3c50956a.yaml @@ -0,0 +1,25 @@ +--- +fixes: + - | + Pin git review to 1.78 + + The latest version of module trys to look for git hook recursively within + the submodules. + + + Error: + + .. code-block:: bash + + Running: git submodule foreach cp -p .git/hooks/commit-msg "$(git rev-parse --git-dir)/hooks/" + Problems encountered installing commit-msg hook + The following command failed with exit code 128 + "git submodule foreach cp -p .git/hooks/commit-msg "$(git rev-parse --git-dir)/hooks/"" + ----------------------- + Entering 'global-jjb' + cannot stat '.git/hooks/commit-msg': Not a directory + fatal: run_command returned non-zero status for global-jjb + + + Remove workaround that has been resolved in v1.28 and use lf-activate-venv + to install git-review diff --git a/shell/gerrit-fetch-dependencies.sh b/shell/gerrit-fetch-dependencies.sh index ed42596f..5cff012b 100644 --- a/shell/gerrit-fetch-dependencies.sh +++ b/shell/gerrit-fetch-dependencies.sh @@ -27,16 +27,11 @@ REPOS_DIR="$WORKSPACE/.repos" IFS=" " read -r -a PATCHES <<< "$(echo "$GERRIT_EVENT_COMMENT_TEXT" | grep -E '(recheck:|reverify:)' | awk -F: '{print $2}')" -# Workaround for git-review bug in v1.24 -# https://storyboard.openstack.org/#!/story/2001081 -set +u # Allow unbound variables for virtualenv -virtualenv --quiet "/tmp/v/git-review" -# shellcheck source=/tmp/v/git-review/bin/activate disable=SC1091 -source "/tmp/v/git-review/bin/activate" -pip install --quiet --upgrade "pip==9.0.3" setuptools -pip install --quiet --upgrade git-review -set -u -# End git-review workaround +# shellcheck disable=SC1090 +source ~/lf-env.sh + +lf-activate-venv "git-review==1.28" + projects=() for patch in "${PATCHES[@]}"; do diff --git a/shell/gerrit-push-patch.sh b/shell/gerrit-push-patch.sh index 30663394..aae77f59 100644 --- a/shell/gerrit-push-patch.sh +++ b/shell/gerrit-push-patch.sh @@ -47,7 +47,7 @@ echo -e "INFO: Staged for commit:\n$staged_commits\n" # shellcheck disable=SC1090 source ~/lf-env.sh -lf-activate-venv "git-review>=1.28" +lf-activate-venv "git-review==1.28" # Query for a pre-existing gerrit review query_result=$(ssh -p 29418 "$GERRIT_USER@$GERRIT_HOST" gerrit query \ -- 2.16.6