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

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

Issue 2416303002: [Findit] Adding support for triaging suspected builds from flake analysis (Closed)
Patch Set: Rebase 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 2396879d8253d17d7b7f3a4aed1c3af72d5482ae..ad92803f28630c867ddaa25ef16531d34062e438 100644
--- a/appengine/findit/handlers/flake/check_flake.py
+++ b/appengine/findit/handlers/flake/check_flake.py
@@ -2,16 +2,31 @@
# 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
+
from common import auth_util
from common import constants
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 waterfall.flake import initialize_flake_pipeline
from waterfall.flake import triggering_sources
+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
@@ -51,23 +66,30 @@ 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,
'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()
}
+ if (users.is_current_user_admin() and analysis.completed and
+ analysis.triage_history):
+ data['triage_history'] = analysis.GetTriageHistory()
+
data['pending_time'] = time_util.FormatDuration(
analysis.request_time,
analysis.start_time or time_util.GetUTCNow())
« no previous file with comments | « appengine/findit/handlers/build_failure.py ('k') | appengine/findit/handlers/flake/test/check_flake_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698