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

Side by Side Diff: appengine/findit/handlers/try_job_dashboard.py

Issue 2259513003: [Findit] Display last build bucket response to try job dashboard (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Created 4 years, 4 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 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.
chanli 2016/08/17 21:17:38 Nit: Add an empty line?
lijeffrey 2016/08/18 23:59:14 Done.
4 from datetime import datetime 4 from datetime import datetime
5 from datetime import time 5 from datetime import time
6 from datetime import timedelta 6 from datetime import timedelta
7 import json
7 8
8 from common.base_handler import BaseHandler 9 from common.base_handler import BaseHandler
9 from common.base_handler import Permission 10 from common.base_handler import Permission
10 from model.wf_try_job_data import WfTryJobData 11 from model.wf_try_job_data import WfTryJobData
11 12
12 13
13 NOT_AVAILABLE = 'N/A' 14 NOT_AVAILABLE = 'N/A'
14 15
15 16
16 # TODO(lijeffrey): Refactor formatting functions into a separate module that 17 # TODO(lijeffrey): Refactor formatting functions into a separate module that
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 78
78 for try_job_data in try_job_data_list: 79 for try_job_data in try_job_data_list:
79 try_job_display_data = { 80 try_job_display_data = {
80 'master_name': try_job_data.master_name, 81 'master_name': try_job_data.master_name,
81 'builder_name': try_job_data.builder_name, 82 'builder_name': try_job_data.builder_name,
82 'build_number': try_job_data.build_number, 83 'build_number': try_job_data.build_number,
83 'try_job_type': try_job_data.try_job_type, 84 'try_job_type': try_job_data.try_job_type,
84 'pending_time': _FormatDuration( 85 'pending_time': _FormatDuration(
85 try_job_data.request_time, try_job_data.start_time), 86 try_job_data.request_time, try_job_data.start_time),
86 'request_time': _FormatDatetime(try_job_data.request_time), 87 'request_time': _FormatDatetime(try_job_data.request_time),
87 'try_job_url': try_job_data.try_job_url 88 'try_job_url': try_job_data.try_job_url,
89 'last_buildbucket_response': json.dumps(
90 try_job_data.last_buildbucket_response, sort_keys=True)
chanli 2016/08/17 21:17:38 I'm not so sure about this, but what will happen i
stgao 2016/08/18 16:52:03 Could the conversion from json to string be handle
lijeffrey 2016/08/18 23:59:14 Unfortunately indent on the template side doesn't
88 } 91 }
89 92
90 if not try_job_data.end_time and not try_job_data.error: 93 if not try_job_data.end_time and not try_job_data.error:
91 try_job_display_data['elapsed_time'] = ( 94 try_job_display_data['elapsed_time'] = (
92 _FormatDuration(try_job_data.request_time, datetime.utcnow()) if 95 _FormatDuration(try_job_data.request_time, datetime.utcnow()) if
93 try_job_data.request_time else None) 96 try_job_data.request_time else None)
94 try_job_display_data['status'] = ( 97 try_job_display_data['status'] = (
95 'running' if try_job_data.start_time else 'pending') 98 'running' if try_job_data.start_time else 'pending')
96 try_jobs_in_progress.append(try_job_display_data) 99 try_jobs_in_progress.append(try_job_display_data)
97 elif try_job_data.error: 100 elif try_job_data.error:
(...skipping 13 matching lines...) Expand all
111 'end_date': _FormatDatetime(end_date), 114 'end_date': _FormatDatetime(end_date),
112 'try_jobs_in_progress': try_jobs_in_progress, 115 'try_jobs_in_progress': try_jobs_in_progress,
113 'try_jobs_with_error': try_jobs_with_error, 116 'try_jobs_with_error': try_jobs_with_error,
114 'successfully_completed_try_jobs': successfully_completed_try_jobs 117 'successfully_completed_try_jobs': successfully_completed_try_jobs
115 } 118 }
116 119
117 return { 120 return {
118 'template': 'try_job_dashboard.html', 121 'template': 'try_job_dashboard.html',
119 'data': data 122 'data': data
120 } 123 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698