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

Side by Side Diff: appengine/findit/common/waterfall/buildbucket_client.py

Issue 1906293002: [Findit] Adding additional fields to try job metadata (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Fixing comment Created 4 years, 8 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
1 # Copyright 2015 The Chromium Authors. All rights reserved. 1 # Copyright 2015 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 """"Serves as a client for selected APIs in Buildbucket.""" 5 """"Serves as a client for selected APIs in Buildbucket."""
6 6
7 import collections 7 import collections
8 import json 8 import json
9 import logging 9 import logging
10 10
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 70
71 This corresponds to the Build in Buildbucket. 71 This corresponds to the Build in Buildbucket.
72 """ 72 """
73 73
74 # Build statuses. 74 # Build statuses.
75 SCHEDULED = 'SCHEDULED' 75 SCHEDULED = 'SCHEDULED'
76 STARTED = 'STARTED' 76 STARTED = 'STARTED'
77 COMPLETED = 'COMPLETED' 77 COMPLETED = 'COMPLETED'
78 78
79 def __init__(self, raw_json_data): 79 def __init__(self, raw_json_data):
80 self.response = raw_json_data
80 self.id = raw_json_data.get('id') 81 self.id = raw_json_data.get('id')
81 self.url = raw_json_data.get('url') 82 self.url = raw_json_data.get('url')
82 self.status = raw_json_data.get('status') 83 self.status = raw_json_data.get('status')
83 self.request_time = raw_json_data.get('created_ts') 84 self.request_time = raw_json_data.get('created_ts')
84 self.updated_time = raw_json_data.get('updated_ts') 85 self.updated_time = raw_json_data.get('updated_ts')
85 self.end_time = raw_json_data.get('completed_ts') 86 self.end_time = raw_json_data.get('completed_ts')
87 self.buildbucket_response = raw_json_data
stgao 2016/04/22 00:37:53 Why we save two copies of the same data?
lijeffrey 2016/04/22 00:50:53 Oops, removed.
86 result_details_json = json.loads( 88 result_details_json = json.loads(
87 raw_json_data.get('result_details_json', '{}')) or {} 89 raw_json_data.get('result_details_json', '{}')) or {}
88 self.report = result_details_json.get('properties', {}).get('report', {}) 90 self.report = result_details_json.get('properties', {}).get('report', {})
89 91
90 92
91 class BuildbucketError(object): 93 class BuildbucketError(object):
92 """Represents an error returned by Buildbucket.""" 94 """Represents an error returned by Buildbucket."""
93 95
94 # Error reasons. 96 # Error reasons.
95 BUILD_NOT_FOUND = 'BUILD_NOT_FOUND' 97 BUILD_NOT_FOUND = 'BUILD_NOT_FOUND'
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 else: 185 else:
184 error_content = { 186 error_content = {
185 'error': { 187 'error': {
186 'reason': status_code, 188 'reason': status_code,
187 'message': content 189 'message': content
188 } 190 }
189 } 191 }
190 json_results.append(error_content) 192 json_results.append(error_content)
191 193
192 return _ConvertFuturesToResults(json_results) 194 return _ConvertFuturesToResults(json_results)
OLDNEW
« no previous file with comments | « no previous file | appengine/findit/model/wf_try_job_data.py » ('j') | appengine/findit/model/wf_try_job_data.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698