| OLD | NEW |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 """Provides API wrapper for FindIt""" | 5 """Provides API wrapper for FindIt""" |
| 6 | 6 |
| 7 import httplib2 | 7 import httplib2 |
| 8 | 8 |
| 9 from endpoints import endpoints | 9 from endpoints_client import endpoints |
| 10 | 10 |
| 11 from google.appengine.api import app_identity | 11 from google.appengine.api import app_identity |
| 12 | 12 |
| 13 | 13 |
| 14 DISCOVERY_URL = ('https://findit-for-me%s.appspot.com/_ah/api/discovery/v1/' | 14 DISCOVERY_URL = ('https://findit-for-me%s.appspot.com/_ah/api/discovery/v1/' |
| 15 'apis/{api}/{apiVersion}/rest') | 15 'apis/{api}/{apiVersion}/rest') |
| 16 | 16 |
| 17 | 17 |
| 18 class FindItAPI(object): | 18 class FindItAPI(object): |
| 19 """A wrapper around the FindIt api.""" | 19 """A wrapper around the FindIt api.""" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 37 failure_run = flaky_run.failure_run.get() | 37 failure_run = flaky_run.failure_run.get() |
| 38 patchset_build_run = flaky_run.failure_run.parent().get() | 38 patchset_build_run = flaky_run.failure_run.parent().get() |
| 39 for occurrence in flaky_run.flakes: | 39 for occurrence in flaky_run.flakes: |
| 40 body['build_steps'].append({ | 40 body['build_steps'].append({ |
| 41 'master_name': patchset_build_run.master, | 41 'master_name': patchset_build_run.master, |
| 42 'builder_name': patchset_build_run.builder, | 42 'builder_name': patchset_build_run.builder, |
| 43 'build_number': failure_run.buildnumber, | 43 'build_number': failure_run.buildnumber, |
| 44 'step_name': occurrence.name | 44 'step_name': occurrence.name |
| 45 }) | 45 }) |
| 46 endpoints.retry_request(self.client.flake(body=body)) | 46 endpoints.retry_request(self.client.flake(body=body)) |
| OLD | NEW |