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

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

Issue 2188733003: Implement functionality to cc relevant owners. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: implement functionality to cc relevant owners Created 4 years, 5 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
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 5e43fd1fadd0a88a907116f68af3efdc160fc045..f89e115761231214153384ee8a9f72d0113e02f7 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/deps_updater.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/deps_updater.py
@@ -5,6 +5,7 @@
"""Pull latest revisions of a W3C test repo and make a local commit."""
import argparse
+import json
import time
from webkitpy.common.webkit_finder import WebKitFinder
@@ -28,6 +29,8 @@ class DepsUpdater(object):
self.keep_w3c_repos_around = False
self.target = None
self.auto_update = False
+ self.directory_dict = {}
+ self.email_list = []
dcampb 2016/07/27 20:54:57 Why not assign these two to variables and return t
qyearsley 2016/07/27 21:38:57 I agree, if these attributes were removed and the
def main(self, argv=None):
self.parse_args(argv)
@@ -65,8 +68,13 @@ class DepsUpdater(object):
self.commit_changes_if_needed(chromium_commitish, import_commitish)
if self.auto_update:
try_bots = self.host.builders.all_try_builder_names()
+ with open('directory_owners.json') as data_file:
qyearsley 2016/07/27 21:38:57 Would this work if the current working directory i
+ self.parse_directory_owners(data_file)
+ self.print_('## Attempting to CC relevant parties.')
dcampb 2016/07/27 20:54:57 Just a comment change: 'Gathering directory owner
+ _, out = self.run(['git', 'diff', 'master', '--name-only'])
+ self.parse_imported_test_changes(out, self.directory_dict)
self.print_('## Uploading change list.')
- self.check_run(['git', 'cl', 'upload', '-f', '-m', 'W3C auto test importer'])
+ self.check_run(['git', 'cl', 'upload', '-f', '-m', 'W3C auto test importer'] + self.email_list)
self.print_('## Triggering try jobs.')
for try_bot in try_bots:
self.run(['git', 'cl', 'try', '-b', try_bot])
@@ -88,7 +96,7 @@ class DepsUpdater(object):
self.check_run(['git', 'commit', '-a', '-m', '\'Modified Test Expectations from W3C Test Auto-roller\''])
self.check_run(['git', 'cl', 'upload', '-m', '\'Wrote lines to TestExpectations\''])
else:
- self.print_('No Failures, committing patch.')
+ self.print_('No Failures, landing patch.')
quit()
self.run(['git', 'cl', 'land', '-f'])
qyearsley 2016/07/27 21:38:57 Somewhat separate from this CL: If possible, it w
return 0
@@ -297,6 +305,21 @@ class DepsUpdater(object):
sets[result_type].add(line.split()[0])
return sets
+ def parse_imported_test_changes(self, results, directory_dict):
+ folders_changed = set()
+ for line in results.splitlines():
+ line = line.strip('third_party/WebKit/LayoutTests/')
qyearsley 2016/07/27 21:38:56 I wonder if there's a way that we can avoid having
+ directory_sep = line.rfind('/')
+ line = line[:directory_sep]
qyearsley 2016/07/27 21:38:56 This looks like it may be the same as: line = s
+ if line in directory_dict and line not in folders_changed:
+ self.email_list.append('--cc=' + directory_dict[line])
+ folders_changed.add(line)
dcampb 2016/07/27 20:54:57 So I'm guessing this function: 1. Looks for the l
+
+ def parse_directory_owners(self, data_file):
+ data = json.load(data_file)
+ for dict_set in data:
dcampb 2016/07/27 20:54:57 dict_set --> directory_dictionary
+ self.directory_dict[dict_set['directory']] = dict_set['notification-email']
+
def check_run(self, command):
return_code, out = self.run(command)
if return_code:

Powered by Google App Engine
This is Rietveld 408576698