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

Unified Diff: appengine/findit/waterfall/flake/flake_analysis_service.py

Issue 2411893002: [Findit] Adding metadata for manually vs automatically triggered flake analyses (Closed)
Patch Set: Addressing comments 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/waterfall/flake/flake_analysis_service.py
diff --git a/appengine/findit/waterfall/flake/flake_analysis_service.py b/appengine/findit/waterfall/flake/flake_analysis_service.py
index b1ba62540f50da745f723a1252922e5bca375034..dee4cb85a4f33c0bb470d8c43833fae125d8d1e3 100644
--- a/appengine/findit/waterfall/flake/flake_analysis_service.py
+++ b/appengine/findit/waterfall/flake/flake_analysis_service.py
@@ -176,19 +176,21 @@ def _IsAuthorizedUser(user_email):
user_email.endswith('@google.com'))
-def ScheduleAnalysisForFlake(request, user_email, is_admin):
+def ScheduleAnalysisForFlake(request, user_email, is_admin, triggering_source):
"""Schedules an analysis on the flake in the given request if needed.
Args:
request (FlakeAnalysisRequest): The request to analyze a flake.
user_email (str): The email of the requester.
is_admin (bool): Whether the requester is an admin.
+ triggering_source (int): Where the request is coming from, either Findit
+ UI (check flake page), pipeline (from analysis) or Findit API.
Returns:
True if an analysis was scheduled; False if a new analysis is not needed;
None if the user has no permission to.
"""
- assert len(request.build_steps) > 0, 'At least 1 build step is needed!'
+ assert len(request.build_steps), 'At least 1 build step is needed!'
if not is_admin and not _IsAuthorizedUser(user_email):
return None
@@ -207,7 +209,8 @@ def ScheduleAnalysisForFlake(request, user_email, is_admin):
build_step.wf_master_name, build_step.wf_builder_name,
build_step.wf_build_number, build_step.wf_step_name,
request.name, allow_new_analysis=True,
- manually_triggered=manually_triggered,
+ manually_triggered=manually_triggered, user_email=user_email,
+ triggering_source=triggering_source,
queue_name=constants.WATERFALL_ANALYSIS_QUEUE)
if analysis:
# TODO: put this in a transaction.
@@ -219,7 +222,7 @@ def ScheduleAnalysisForFlake(request, user_email, is_admin):
analysis.key)
return True
else:
- logging.info('But no new analysis was not triggered!')
+ logging.error('But new analysis was not triggered!')
else:
logging.info('No new analysis is needed: %s', request)
« no previous file with comments | « appengine/findit/model/flake/master_flake_analysis.py ('k') | appengine/findit/waterfall/flake/initialize_flake_pipeline.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698