Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1120)

Unified Diff: third_party/WebKit/Tools/Scripts/webkitpy/w3c/deps_updater.py

Issue 2248913003: In deps_updater.py: After updating, set commit and close on CQ failure. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Tools/Scripts/webkitpy/w3c/deps_updater.py
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/deps_updater.py b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/deps_updater.py
index dd0eef76a3a324c7993ef85f4356327ecb1f4d6c..2a5a74130f849495730e87023aa2634ffedb24ff 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/deps_updater.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/deps_updater.py
@@ -73,7 +73,9 @@ class DepsUpdater(object):
has_changes = self.commit_changes_if_needed(chromium_commitish, import_commitish)
if self.auto_update and has_changes:
- self.do_auto_update()
+ commit_successful = self.do_auto_update()
+ if not commit_successful:
+ return 1
return 0
def parse_args(self, argv):
@@ -269,6 +271,9 @@ class DepsUpdater(object):
and that change has been committed. There may be newly-failing tests,
so before being able to commit these new changes, we may need to update
TestExpectations or download new baselines.
+
+ Returns:
+ True if successfully committed, False otherwise.
"""
email_list = self.get_directory_owners_to_cc()
self.print_('## Uploading change list.')
@@ -276,13 +281,19 @@ class DepsUpdater(object):
self.trigger_try_jobs()
if self.has_failing_results():
self.write_test_expectations()
- # TODO(qyearsley): After writing test expectations, the CL needs
- # to be tried again on the try bots, and closed if it fails.
- else:
- self.print_('No Failures, committing patch.')
- self.run(['git', 'cl', 'land', '-f', '--auth-refresh-token-json', self.auth_refresh_token_json])
- # TODO(qyearsley): Attempting to land should trigger the CQ -- if
- # the CQ fails, we should abort and close the CL.
+ command = ['git', 'cl', 'set-commit', '--rietveld']
+ if self.auth_refresh_token_json:
+ command += ['--auth-refresh-token-json', self.auth_refresh_token_json]
+ self.run(command)
+ if self.has_failing_results():
+ self.print_('## CL has failing results when trying to land; aborting.')
+ command = ['git', 'cl', 'set-close']
+ if self.auth_refresh_token_json:
+ command += ['--auth-refresh-token-json', self.auth_refresh_token_json]
+ self.run(command)
+ return False
+ return True
+
def get_directory_owners_to_cc(self):
"""Returns a list of email addresses to CC for the current import."""
@@ -325,7 +336,7 @@ class DepsUpdater(object):
def generate_upload_command(self, email_list):
message = 'W3C auto test importer\n\nTBR=qyearsley@chromium.org'
- command = ['git', 'cl', 'upload', '-f', '-m', message]
+ command = ['git', 'cl', 'upload', '-f', '-m', message, '--rietveld']
command += ['--cc=' + email for email in email_list]
if self.auth_refresh_token_json:
command += ['--auth-refresh-token-json', self.auth_refresh_token_json]
@@ -385,5 +396,5 @@ class DepsUpdater(object):
self.run([self.host.executable, script_path])
message = '\'Modifies TestExpectations and/or downloads new baselines for tests\''
self.check_run(['git', 'commit', '-a', '-m', message])
- self.check_run(['git', 'cl', 'upload', '-m', message,
+ self.check_run(['git', 'cl', 'upload', '-m', message, '--rietveld'
'--auth-refresh-token-json', self.auth_refresh_token_json])
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698