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

Unified Diff: appengine/findit/handlers/flake/check_flake.py

Issue 2416303002: [Findit] Adding support for triaging suspected builds from flake analysis (Closed)
Patch Set: Clean up and adding unit tests Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: appengine/findit/handlers/flake/check_flake.py
diff --git a/appengine/findit/handlers/flake/check_flake.py b/appengine/findit/handlers/flake/check_flake.py
index 4e23f629df1cf44f2b2424c4509dc87b33da8bcf..94eeb2a64cb01b53070a7b0fa7b1b8e6272f3867 100644
--- a/appengine/findit/handlers/flake/check_flake.py
+++ b/appengine/findit/handlers/flake/check_flake.py
@@ -2,7 +2,8 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-from google.appengine.api import users
+import time
+from datetime import datetime
from common import auth_util
from common import constants
@@ -10,9 +11,23 @@ from common import time_util
from common.base_handler import BaseHandler
from common.base_handler import Permission
from model import analysis_status
+from model import triage_status
+from model.base_triaged_model import TriagedModel
from waterfall.flake import initialize_flake_pipeline
+def _GetSuspectedFlakeAnalysisAndTriageResult(analysis):
+ if analysis.suspected_flake_build_number is not None:
+ return {
+ 'build_number': analysis.suspected_flake_build_number,
+ 'triage_result': (
+ analysis.triage_history[-1].triage_result if analysis.triage_history
+ else triage_status.UNTRIAGED)
+ }
+
+ return {}
+
+
class CheckFlake(BaseHandler):
PERMISSION_LEVEL = Permission.ANYONE
@@ -49,21 +64,25 @@ class CheckFlake(BaseHandler):
'return_code': 401,
}
+ suspected_flake = _GetSuspectedFlakeAnalysisAndTriageResult(analysis)
+
data = {
'pass_rates': [],
'analysis_status': analysis.status_description,
- 'suspected_flake_build_number': (
- analysis.suspected_flake_build_number),
'master_name': master_name,
'builder_name': builder_name,
'build_number': build_number,
'step_name': step_name,
'test_name': test_name,
+ 'version_number': analysis.version_number,
+ 'suspected_flake': suspected_flake,
+ 'triage_history': TriagedModel.GetTriageHistory(analysis),
'request_time': time_util.FormatDatetime(
analysis.request_time),
'task_number': len(analysis.data_points),
'error': analysis.error_message,
'iterations_to_rerun': analysis.iterations_to_rerun,
+ 'show_debug_info': self._ShowDebugInfo()
}
data['pending_time'] = time_util.FormatDuration(

Powered by Google App Engine
This is Rietveld 408576698