From 404802dc3457e922e28423cf6cdf46c9c6e3c9d6 Mon Sep 17 00:00:00 2001 From: Gerald Combs Date: Fri, 11 Dec 2020 15:54:55 -0800 Subject: [PATCH] Tools: skip commit validation for merge trains. Skip commit validation if it looks like we're in a GitLab merge train. --- tools/validate-commit.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/validate-commit.py b/tools/validate-commit.py index 55254e238f..8f0dde3a23 100755 --- a/tools/validate-commit.py +++ b/tools/validate-commit.py @@ -209,6 +209,12 @@ is checked so that maintainers can rebase your change and make minor edits.\ def main(): args = parser.parse_args() commit = args.commit + + if(os.getenv('CI_MERGE_REQUEST_EVENT_TYPE') == 'merge_train'): + print("If we were on the love train, people all over the world would be joining hands for this merge request.\nInstead, we're on a merge train so we're skipping commit validation checks. ") + return 0 + + cmd = ['git', 'show', '--no-patch', '--format=%h%n%an%n%ae%n%B', commit, '--'] output = subprocess.check_output(cmd, universal_newlines=True)