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

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: Addressing comments 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
« no previous file with comments | « no previous file | appengine/findit/model/wf_try_job_data.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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')
86 result_details_json = json.loads( 87 result_details_json = json.loads(
87 raw_json_data.get('result_details_json', '{}')) or {} 88 raw_json_data.get('result_details_json', '{}')) or {}
88 self.report = result_details_json.get('properties', {}).get('report', {}) 89 self.report = result_details_json.get('properties', {}).get('report', {})
89 90
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 else: 184 else:
184 error_content = { 185 error_content = {
185 'error': { 186 'error': {
186 'reason': status_code, 187 'reason': status_code,
187 'message': content 188 'message': content
188 } 189 }
189 } 190 }
190 json_results.append(error_content) 191 json_results.append(error_content)
191 192
192 return _ConvertFuturesToResults(json_results) 193 return _ConvertFuturesToResults(json_results)
OLDNEW
« no previous file with comments | « no previous file | appengine/findit/model/wf_try_job_data.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698