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

Unified Diff: appengine/chromium_try_flakes/findit/findit.py

Issue 2387153002: Report all flakes reported to issue tracker also to FindIt (Closed)
Patch Set: Addressed comments Created 4 years, 2 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: appengine/chromium_try_flakes/findit/findit.py
diff --git a/appengine/chromium_try_flakes/findit/findit.py b/appengine/chromium_try_flakes/findit/findit.py
new file mode 100644
index 0000000000000000000000000000000000000000..bb9ea24504d9a0c983ac16ad71d2069a4743f3da
--- /dev/null
+++ b/appengine/chromium_try_flakes/findit/findit.py
@@ -0,0 +1,33 @@
+# Copyright 2016 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""Provides API wrapper for FindIt"""
+
+from endpoints import endpoints
+
+
+class FindItAPI(object):
+ """A wrapper around the FindIt api."""
+ def __init__(self):
+ self.client = endpoints.build_client(
+ 'findit', 'v1', 'https://findit-for-me.appspot.com/_ah/api/discovery/v1'
+ '/apis/{api}/{apiVersion}/rest')
+
+ def flake(self, flake, flaky_runs):
+ body = {}
+ body['name'] = flake.name
+ body['is_step'] = flake.is_step
+ body['bug_id'] = flake.issue_id
+ body['build_steps'] = []
+ for flaky_run in flaky_runs:
+ failure_run = flaky_run.failure_run.get()
+ patchset_build_run = failure_run.parent.get()
+ for occurrence in flaky_run.flakes:
+ body['build_steps'].append({
+ 'master_name': patchset_build_run.master,
+ 'builder_name': patchset_build_run.builder,
+ 'build_number': failure_run.buildnumber,
+ 'step_name': occurrence.name
+ })
+ endpoints.retry_request(self.client.flake(body=body))
« no previous file with comments | « appengine/chromium_try_flakes/findit/__init__.py ('k') | appengine/chromium_try_flakes/findit/test/__init__.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698