OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 """This module is to handle manual triage of analysis result. | 5 """This module is to handle manual triage of analysis result. |
6 | 6 |
7 This handler will flag the analysis result as correct or incorrect. | 7 This handler will flag the analysis result as correct or incorrect. |
8 TODO: work on an automatic or semi-automatic way to triage analysis result. | 8 TODO: work on an automatic or semi-automatic way to triage analysis result. |
9 """ | 9 """ |
10 | 10 |
11 from datetime import timedelta | 11 from datetime import timedelta |
12 | 12 |
13 from google.appengine.api import users | 13 from google.appengine.api import users |
14 from google.appengine.ext import ndb | 14 from google.appengine.ext import ndb |
15 import pytz.gae | 15 import pytz.gae |
16 | 16 |
17 from common import time_util | 17 from common import time_util |
18 from common.base_handler import BaseHandler | 18 from common.base_handler import BaseHandler, Permission |
19 from common.base_handler import Permission | |
20 from model import result_status | 19 from model import result_status |
21 from model.wf_analysis import WfAnalysis | 20 from model.wf_analysis import WfAnalysis |
22 from waterfall import buildbot | 21 from waterfall import buildbot |
23 from waterfall.try_job_util import GetSuspectedCLsWithFailures | 22 from waterfall.try_job_util import GetSuspectedCLsWithFailures |
24 | 23 |
25 MATCHING_ANALYSIS_HOURS_AGO_START = 24 | 24 MATCHING_ANALYSIS_HOURS_AGO_START = 24 |
26 MATCHING_ANALYSIS_HOURS_AGO_END = 24 | 25 MATCHING_ANALYSIS_HOURS_AGO_END = 24 |
27 MATCHING_ANALYSIS_END_BOUND_TIME_ZONE = 'US/Pacific' | 26 MATCHING_ANALYSIS_END_BOUND_TIME_ZONE = 'US/Pacific' |
28 | 27 |
29 | 28 |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 # already logged in. | 205 # already logged in. |
207 user_name = users.get_current_user().email().split('@')[0] | 206 user_name = users.get_current_user().email().split('@')[0] |
208 success, original_analysis = _UpdateAnalysisResultStatus( | 207 success, original_analysis = _UpdateAnalysisResultStatus( |
209 master_name, builder_name, build_number, is_correct, user_name) | 208 master_name, builder_name, build_number, is_correct, user_name) |
210 num_duplicate_analyses = 0 | 209 num_duplicate_analyses = 0 |
211 if success: | 210 if success: |
212 num_duplicate_analyses = _TriageAndCountDuplicateResults( | 211 num_duplicate_analyses = _TriageAndCountDuplicateResults( |
213 original_analysis, is_correct, user_name) | 212 original_analysis, is_correct, user_name) |
214 return {'data': {'success': success, | 213 return {'data': {'success': success, |
215 'num_duplicate_analyses': num_duplicate_analyses}} | 214 'num_duplicate_analyses': num_duplicate_analyses}} |
OLD | NEW |