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

Side by Side Diff: appengine/findit/handlers/crash/fracas_result_feedback.py

Issue 2075153003: [Findit] Add fracas analysis result feedback page. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Fix nits. Created 4 years, 6 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
(Empty)
1 # Copyright 2014 The Chromium Authors. All rights reserved.
stgao 2016/06/20 05:02:51 Hm, my comments in the original CL seems not addre
Sharu Jiang 2016/06/21 20:17:11 Sorry, forgot the comments there ><
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 import base64
6 from collections import defaultdict
7 import copy
8 from datetime import datetime
9 import json
10 import os
11
12 from google.appengine.ext import ndb
13 from google.appengine.api import users
14
15 from common import constants
16 from common import time_util
17 from common.base_handler import BaseHandler
18 from common.base_handler import Permission
19 from handlers import handlers_util
20 from handlers import result_status
21 from handlers.result_status import NO_TRY_JOB_REASON_MAP
22 from model.crash.fracas_crash_analysis import FracasCrashAnalysis
23 from model import triage_status
24
25
26 class FracasResultFeedback(BaseHandler):
27 PERMISSION_LEVEL = Permission.ANYONE
28
29 def HandleGet(self):
30 """Triggers analysis of a build failure on demand and return current result.
31
32 If the final analysis result is available, set cache-control to 1 day to
33 avoid overload by unnecessary and frequent query from clients; otherwise
34 set cache-control to 5 seconds to allow repeated query.
35
36 Serve HTML page or JSON result as requested.
37 """
38 key = ndb.Key(urlsafe=self.request.get('key'))
39
40 analysis = key.get()
41 if not analysis: # pragma: no cover.
42 return BaseHandler.CreateError(
43 'cannot find analysis for crash %s' % analysis.signature)
44
45 data = {
46 'signature': analysis.signature,
47 'version': analysis.crashed_version,
48 'channel': analysis.channel,
49 'platform': analysis.platform,
50 'regression_range': (
51 analysis.result['regression_range'] if 'regression_range' in
52 analysis.result else None),
53 'historical_metadata': analysis.historical_metadata,
54 'stack_trace': analysis.stack_trace,
55 'suspected_cls': (
56 analysis.result['suspected_cls'] if 'suspected_cls' in
57 analysis.result else None),
58 'suspected_project': (
59 analysis.result['suspected_project'] if 'suspected_project' in
60 analysis.result else None),
61 'suspected_components': (
62 analysis.result['suspected_components'] if 'suspected_components'
63 in analysis.result else None),
64 'request_time': time_util.FormatDatetime(analysis.requested_time),
65 'analysis_completed': analysis.completed,
66 'analysis_failed': analysis.failed,
67 }
68
69 return {
70 'template': 'crash/fracas_result_feedback.html',
71 'data': data,
72 }
73
74 def HandlePost(self): # pragma: no cover
75 return self.HandleGet()
OLDNEW
« no previous file with comments | « appengine/findit/crash/test/fracas_test.py ('k') | appengine/findit/handlers/crash/test/fracas_result_feedback_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698