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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 # Copyright 2016 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 """Provides API wrapper for FindIt"""
6
7 from endpoints import endpoints
8
9
10 class FindItAPI(object):
11 """A wrapper around the FindIt api."""
12 def __init__(self):
13 self.client = endpoints.build_client(
14 'findit', 'v1', 'https://findit-for-me.appspot.com/_ah/api/discovery/v1'
15 '/apis/{api}/{apiVersion}/rest')
16
17 def flake(self, flake, flaky_runs):
18 body = {}
19 body['name'] = flake.name
20 body['is_step'] = flake.is_step
21 body['bug_id'] = flake.issue_id
22 body['build_steps'] = []
23 for flaky_run in flaky_runs:
24 failure_run = flaky_run.failure_run.get()
25 patchset_build_run = failure_run.parent.get()
26 for occurrence in flaky_run.flakes:
27 body['build_steps'].append({
28 'master_name': patchset_build_run.master,
29 'builder_name': patchset_build_run.builder,
30 'build_number': failure_run.buildnumber,
31 'step_name': occurrence.name
32 })
33 endpoints.retry_request(self.client.flake(body=body))
OLDNEW
« 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