diff --git a/DEPS b/DEPS index ed90955c..7ef8947 100644 --- a/DEPS +++ b/DEPS
@@ -44,7 +44,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling V8 # and whatever else without interference from each other. - 'v8_revision': '21443fab7c619a1ddb08fd0305adb9b2c415d933', + 'v8_revision': '5ea931aa84f9bd3970b5d95ac5f2cc8243012bff', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling swarming_client # and whatever else without interference from each other.
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_exporter.py b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_exporter.py index 2124534..599b48d8 100644 --- a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_exporter.py +++ b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_exporter.py
@@ -98,6 +98,10 @@ _log.info('Create PR response: %s', response_data) + if response_data: + data, status_code = self.wpt_github.add_label(response_data['number']) + _log.info('Add label response (status %s): %s', status_code, data) + def exportable_commits_since(self, commit): """Returns SHAs of exportable commits since `commit` in chronological order.
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/wpt_github.py b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/wpt_github.py index 655c214..16a192df 100644 --- a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/wpt_github.py +++ b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/wpt_github.py
@@ -30,6 +30,19 @@ def auth_token(self): return base64.encodestring('{}:{}'.format(self.user, self.token)).strip() + def request(self, path, method, body=None): + assert path.startswith('/') + if body: + body = json.dumps(body) + opener = urllib2.build_opener(urllib2.HTTPHandler) + request = urllib2.Request(url=API_BASE + path, data=body) + request.add_header('Accept', 'application/vnd.github.v3+json') + request.add_header('Authorization', 'Basic {}'.format(self.auth_token())) + request.get_method = lambda: method + response = opener.open(request) + status_code = response.getcode() + return json.load(response), status_code + def create_pr(self, local_branch_name, desc_title, body): """Creates a PR on GitHub. @@ -52,41 +65,32 @@ "body": body, "head": pr_branch_name, "base": 'master', - "labels": [EXPORT_LABEL] } - data, status_code = self.request(path, body) + data, status_code = self.request(path, method='POST', body=body) if status_code != 201: return None return data + def add_label(self, number): + path = '/repos/w3c/web-platform-tests/issues/%d/labels' % number + body = [EXPORT_LABEL] + return self.request(path, method='POST', body=body) + def in_flight_pull_requests(self): url_encoded_label = EXPORT_LABEL.replace(' ', '%20') path = '/search/issues?q=repo:w3c/web-platform-tests%20is:open%20type:pr%20labels:{}'.format(url_encoded_label) - data, status_code = self.request(path) + data, status_code = self.request(path, method='GET') if status_code == 200: return data['items'] else: raise Exception('Non-200 status code (%s): %s' % (status_code, data)) - def request(self, path, body=None): - assert path.startswith('/') - - if body: - body = json.dumps(body) - - req = urllib2.Request(url=API_BASE + path, data=body) - req.add_header('Accept', 'application/vnd.github.v3+json') - req.add_header('Authorization', 'Basic {}'.format(self.auth_token())) - res = urllib2.urlopen(req) - status_code = res.getcode() - return json.load(res), status_code - def merge_pull_request(self, pull_request_number): path = '/repos/w3c/web-platform-tests/pulls/%d/merge' % pull_request_number body = {} - response, content = self.request(path, body) + response, content = self.request(path, method='PUT', body=body) if response['status'] == '200': return json.loads(content)