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

Side by Side Diff: appengine/findit/waterfall/flake/triggering_sources.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 unified diff | Download patch
« no previous file with comments | « appengine/findit/waterfall/flake/trigger_flake_analyses_pipeline.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 # Copyright 2016 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 """Sources for from where a flake analysis was triggered."""
6
7 # An analysis was triggered directly through Findit's UI.
8 FINDIT_UI = 1
9
10 # An analysis was triggered using Findit's API.
11 FINDIT_API = 2
12
13 # An analysis was triggered using Findit's normal analysis pipeline.
14 FINDIT_PIPELINE = 3
15
16
17 def GetDescriptionForTriggeringSource(triggering_source, manually_triggered):
18 """Returns a human-readable description for where a request came from."""
19 template = 'The analysis was triggered %s through %s'
20
21 def _GetTriggeringSourceDescription(triggering_source):
22 source_to_description = {
23 FINDIT_UI: 'Findit UI',
24 FINDIT_API: 'Findit API',
25 FINDIT_PIPELINE: 'Findit pipeline'
26 }
27 return source_to_description.get(triggering_source, 'other/unknown source')
28
29 def _GetTriggeringUserDescription(manually_triggered):
30 return 'manually' if manually_triggered else 'automatically'
31
32 return template % (_GetTriggeringUserDescription(manually_triggered),
33 _GetTriggeringSourceDescription(triggering_source))
OLDNEW
« no previous file with comments | « appengine/findit/waterfall/flake/trigger_flake_analyses_pipeline.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698