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

Side by Side Diff: appengine/findit/handlers/flake/check_flake.py

Issue 2536953002: [Findit] Add link to swarming tasks. (Closed)
Patch Set: . Created 4 years 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/handlers/flake/test/check_flake_test.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 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 import logging 5 import logging
6 6
7 from google.appengine.api import users 7 from google.appengine.api import users
8 from google.appengine.ext import ndb 8 from google.appengine.ext import ndb
9 9
10 from common import auth_util 10 from common import auth_util
11 from common.base_handler import BaseHandler 11 from common.base_handler import BaseHandler
12 from common.base_handler import Permission 12 from common.base_handler import Permission
13 from lib import time_util 13 from lib import time_util
14 from model import analysis_status 14 from model import analysis_status
15 from model import triage_status 15 from model import triage_status
16 from model.flake.flake_analysis_request import FlakeAnalysisRequest 16 from model.flake.flake_analysis_request import FlakeAnalysisRequest
17 from model.flake.master_flake_analysis import MasterFlakeAnalysis 17 from model.flake.master_flake_analysis import MasterFlakeAnalysis
18 from waterfall.flake import flake_analysis_service 18 from waterfall.flake import flake_analysis_service
19 from waterfall.flake import triggering_sources 19 from waterfall.flake import triggering_sources
20 20
21 21
22 SWARMING_TASK_BASE_URL = 'https://chromium-swarm.appspot.com'
23
24
22 def _GetSuspectedFlakeAnalysisAndTriageResult(analysis): 25 def _GetSuspectedFlakeAnalysisAndTriageResult(analysis):
23 if analysis.suspected_flake_build_number is not None: 26 if analysis.suspected_flake_build_number is not None:
24 return { 27 return {
25 'build_number': analysis.suspected_flake_build_number, 28 'build_number': analysis.suspected_flake_build_number,
26 'triage_result': ( 29 'triage_result': (
27 analysis.triage_history[-1].triage_result if analysis.triage_history 30 analysis.triage_history[-1].triage_result if analysis.triage_history
28 else triage_status.UNTRIAGED) 31 else triage_status.UNTRIAGED)
29 } 32 }
30 33
31 return {} 34 return {}
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 data['pending_time'] = time_util.FormatDuration( 179 data['pending_time'] = time_util.FormatDuration(
177 analysis.request_time, 180 analysis.request_time,
178 analysis.start_time or time_util.GetUTCNow()) 181 analysis.start_time or time_util.GetUTCNow())
179 if analysis.status != analysis_status.PENDING: 182 if analysis.status != analysis_status.PENDING:
180 data['duration'] = time_util.FormatDuration( 183 data['duration'] = time_util.FormatDuration(
181 analysis.start_time, 184 analysis.start_time,
182 analysis.end_time or time_util.GetUTCNow()) 185 analysis.end_time or time_util.GetUTCNow())
183 186
184 coordinates = [] 187 coordinates = []
185 for data_point in analysis.data_points: 188 for data_point in analysis.data_points:
186 coordinates.append([data_point.build_number, data_point.pass_rate]) 189 if data_point.task_id:
190 task_url = '%s/task?id=%s' % (
191 SWARMING_TASK_BASE_URL, data_point.task_id)
192 coordinates.append([
193 data_point.build_number, data_point.pass_rate, task_url])
194 else:
195 coordinates.append([
196 data_point.build_number, data_point.pass_rate, None])
187 197
188 # Order by build number from earliest to latest. 198 # Order by build number from earliest to latest.
189 coordinates.sort(key=lambda x: x[0]) 199 coordinates.sort(key=lambda x: x[0])
190 200
191 data['pass_rates'] = coordinates 201 data['pass_rates'] = coordinates
192 return { 202 return {
193 'template': 'flake/result.html', 203 'template': 'flake/result.html',
194 'data': data 204 'data': data
195 } 205 }
OLDNEW
« no previous file with comments | « no previous file | appengine/findit/handlers/flake/test/check_flake_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698