Chromium Code Reviews| OLD | NEW |
|---|---|
| (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. | |
|
stgao
2016/10/13 06:14:38
Do you mean the UI?
lijeffrey
2016/10/14 23:45:21
Done.
| |
| 8 FINDIT = 1 | |
| 9 | |
| 10 # An analysis was triggered using Findit's API. | |
| 11 FINDIT_API = 2 | |
| 12 | |
| 13 | |
| 14 def GetDescriptionForTriggeringSource(triggering_source, manually_triggered): | |
| 15 """Returns a human-readable description for where a request came from.""" | |
| 16 template = 'The analysis was triggered %s through %s' | |
| 17 | |
| 18 def _GetTriggeringSourceDescription(triggering_source): | |
| 19 source_to_description = { | |
| 20 FINDIT: 'Findit itself', | |
| 21 FINDIT_API: 'Findit API', | |
|
stgao
2016/10/13 06:14:38
What's the difference here? "Findit API" doesn't b
lijeffrey
2016/10/14 23:45:21
changed to FINDIT_UI, FINDIT_PIPELINE, and FINDIT_
| |
| 22 } | |
| 23 return source_to_description.get(triggering_source, 'other/unknown source') | |
| 24 | |
| 25 def _GetTriggeringUserDescription(manually_triggered): | |
| 26 return 'manually' if manually_triggered else 'automatically' | |
| 27 | |
| 28 return template % (_GetTriggeringUserDescription(manually_triggered), | |
| 29 _GetTriggeringSourceDescription(triggering_source)) | |
| OLD | NEW |