From 3d86df068a7a78f8faa9ac6437ff4fc19f5cebcc Mon Sep 17 00:00:00 2001 From: Lee Yarwood Date: Mon, 7 Dec 2020 12:52:39 +0000 Subject: [PATCH] tools: Allow check-cherry-picks.sh to be disabled by an env var The checks performed by this script aren't always useful to downstream consumers of the repo so allow them to disable the script without having to make changes to tox.ini. NOTE(lyarwood): This backport has Ie8a672fd21184c810bfe9c0e3a49582189bf2111 squashed into it to ensure the introduced env var is passed into the pep8 tox env. tox: Add passenv DISABLE_CHERRY_PICK_CHECK to pep8 I4f551dc4b57905cab8aa005c5680223ad1b57639 introduced the environment variable to disable the check-cherry-pick.sh script but forgot to allow it to be passed into the pep8 tox env. Change-Id: I4f551dc4b57905cab8aa005c5680223ad1b57639 (cherry picked from commit 610396f8ad5fe8c3abb7731fcd42c81e5246a938) --- tools/check-cherry-picks.sh | 5 +++++ tox.ini | 2 ++ 2 files changed, 7 insertions(+) diff --git a/tools/check-cherry-picks.sh b/tools/check-cherry-picks.sh index 5a449c520b72..5ca6ded20339 100755 --- a/tools/check-cherry-picks.sh +++ b/tools/check-cherry-picks.sh @@ -4,6 +4,11 @@ # to verify that they're all on either master or stable/ branches # +# Allow this script to be disabled by a simple env var +if [ ${DISABLE_CHERRY_PICK_CHECK:-0} -eq 1 ]; then + exit 0 +fi + commit_hash="" # Check if the patch is a merge patch by counting the number of parents. diff --git a/tox.ini b/tox.ini index 7d8c74da3940..61969cf56879 100644 --- a/tox.ini +++ b/tox.ini @@ -49,6 +49,8 @@ commands = description = Run style checks. envdir = {toxworkdir}/shared +passenv = + DISABLE_CHERRY_PICK_CHECK commands = {[testenv:mypy]commands} bash tools/flake8wrap.sh {posargs}