From 5a9be308e347d0641ba704ea1bc62d8d7ff9cf59 Mon Sep 17 00:00:00 2001 From: Mirko Bonadei Date: Wed, 17 Nov 2021 11:02:46 +0100 Subject: [PATCH] Remove self TBR to avoid setting Code-Review+1. No-Presubmit: True Bug: chromium:1260482 Change-Id: I988b4056ff2425f8ec764ab816a7966368b5c65a Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/238160 Reviewed-by: Christoffer Jansson Commit-Queue: Mirko Bonadei Cr-Commit-Position: refs/heads/main@{#35363} --- tools_webrtc/autoroller/roll_deps.py | 8 ++------ .../autoroller/unittests/roll_deps_test.py | 14 ++++---------- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/tools_webrtc/autoroller/roll_deps.py b/tools_webrtc/autoroller/roll_deps.py index 1d07ed7947..224f5842e6 100755 --- a/tools_webrtc/autoroller/roll_deps.py +++ b/tools_webrtc/autoroller/roll_deps.py @@ -524,12 +524,8 @@ def GenerateCommitMessage( else: commit_msg.append('No update to Clang.\n') - # TBR needs to be non-empty for Gerrit to process it. - git_author = _RunCommand(['git', 'config', 'user.email'], - working_dir=CHECKOUT_SRC_DIR)[0].splitlines()[0] - tbr_authors = git_author + ',' + tbr_authors - - commit_msg.append('TBR=%s' % tbr_authors) + if tbr_authors: + commit_msg.append('TBR=%s' % tbr_authors) commit_msg.append('BUG=None') return '\n'.join(commit_msg) diff --git a/tools_webrtc/autoroller/unittests/roll_deps_test.py b/tools_webrtc/autoroller/unittests/roll_deps_test.py index 87863bb04f..81620121e2 100755 --- a/tools_webrtc/autoroller/unittests/roll_deps_test.py +++ b/tools_webrtc/autoroller/unittests/roll_deps_test.py @@ -280,16 +280,10 @@ class TestRollChromiumRevision(unittest.TestCase): current_commit_pos = 'cafe' new_commit_pos = 'f00d' - with mock.patch('roll_deps._RunCommand', self.fake): - # We don't really care, but it's needed to construct the message. - self.fake.AddExpectation(['git', 'config', 'user.email'], - _returns=('nobody@nowhere.no', None), - _ignores=['working_dir']) - - commit_msg = GenerateCommitMessage(NO_CHROMIUM_REVISION_UPDATE, - current_commit_pos, - new_commit_pos, changed_deps, - added_paths, removed_paths) + commit_msg = GenerateCommitMessage(NO_CHROMIUM_REVISION_UPDATE, + current_commit_pos, + new_commit_pos, changed_deps, + added_paths, removed_paths) return [l.strip() for l in commit_msg.split('\n')]