From 462c2723806b91e4a0a888d2521a5ce778433949 Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Fri, 6 Oct 2017 18:28:46 -0400 Subject: [PATCH] Improve diagnostics of upstreaming WPT changes. --- tests/wpt/update/github.py | 8 ++++++++ tests/wpt/update/upstream.py | 1 + 2 files changed, 9 insertions(+) diff --git a/tests/wpt/update/github.py b/tests/wpt/update/github.py index 19d2cc50bdb..fb08309c21d 100644 --- a/tests/wpt/update/github.py +++ b/tests/wpt/update/github.py @@ -46,6 +46,7 @@ class GitHub(object): if 200 <= resp.status_code < 300: return resp.json() else: + print resp.status_code, resp.json() raise GitHubError(resp.status_code, resp.json()) def repo(self, owner, name): @@ -159,6 +160,13 @@ class Issue(object): def path(self, suffix): return urljoin(self.repo.path("issues/%i/" % self.number), suffix) + def add_label(self, label): + """Add a label to the issue. + + :param label: The name of the label + """ + self.repo.gh.post(self.path("labels"), [label]) + def add_comment(self, message): """Add a comment to the issue diff --git a/tests/wpt/update/upstream.py b/tests/wpt/update/upstream.py index b3451278f15..459a3fd54ec 100644 --- a/tests/wpt/update/upstream.py +++ b/tests/wpt/update/upstream.py @@ -339,6 +339,7 @@ class PRAddComment(Step): """Add an issue comment indicating that the code has been reviewed already""" def create(self, state): state.pr.issue.add_comment("Code reviewed upstream.") + state.pr.issue.add_label("servo-export") class MergePR(Step):