From b3579d428a79e0425f4d3d9be58d76470f96fb6b Mon Sep 17 00:00:00 2001 From: Bruce Dawson Date: Wed, 8 Jun 2022 20:11:22 +0000 Subject: [PATCH] Make tree-closed a warning for presubmit --all presubmit --all should succeed regardless of the current state of the tree. Otherwise a presubmit --all bot will be flaky due to circumstances beyond its control. This is a logical follow-on to crrev.com/c/3628368 which turned some other errors into warnings for presubmit --all. Bug: 1309977 Change-Id: I6d26708f8c47916cf015dec75e27833db7ca465b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3696070 Auto-Submit: Bruce Dawson Reviewed-by: Gavin Mak Commit-Queue: Gavin Mak --- presubmit_canned_checks.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/presubmit_canned_checks.py b/presubmit_canned_checks.py index a0b581f31..5a7eaec9d 100644 --- a/presubmit_canned_checks.py +++ b/presubmit_canned_checks.py @@ -712,6 +712,10 @@ def CheckTreeIsOpen(input_api, output_api, if not status['can_commit_freely']: short_text = 'Tree state is: ' + status['general_state'] long_text = status['message'] + '\n' + json_url + if input_api.no_diffs: + return [ + output_api.PresubmitPromptWarning(short_text, long_text=long_text) + ] return [output_api.PresubmitError(short_text, long_text=long_text)] else: # TODO(bradnelson): drop this once all users are gone.