| OLD | NEW |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 """Top-level presubmit script for catapult. | 5 """Top-level presubmit script for catapult. |
| 6 | 6 |
| 7 See https://www.chromium.org/developers/how-tos/depottools/presubmit-scripts | 7 See https://www.chromium.org/developers/how-tos/depottools/presubmit-scripts |
| 8 for more details about the presubmit API built into depot_tools. | 8 for more details about the presubmit API built into depot_tools. |
| 9 """ | 9 """ |
| 10 import re | 10 import re |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 r'^tracing[\\/]test_data[\\/].*', | 37 r'^tracing[\\/]test_data[\\/].*', |
| 38 r'^tracing[\\/]third_party[\\/].*', | 38 r'^tracing[\\/]third_party[\\/].*', |
| 39 r'^telemetry[\\/]support[\\/]html_output[\\/]results-template.html', | 39 r'^telemetry[\\/]support[\\/]html_output[\\/]results-template.html', |
| 40 ) | 40 ) |
| 41 | 41 |
| 42 | 42 |
| 43 _CATAPULT_BUG_ID_RE = re.compile(r'#[1-9]\d*') | 43 _CATAPULT_BUG_ID_RE = re.compile(r'#[1-9]\d*') |
| 44 _RIETVELD_BUG_ID_RE = re.compile(r'[1-9]\d*') | 44 _RIETVELD_BUG_ID_RE = re.compile(r'[1-9]\d*') |
| 45 _RIETVELD_REPOSITORY_NAMES = frozenset({'chromium', 'v8'}) | 45 _RIETVELD_REPOSITORY_NAMES = frozenset({'chromium', 'v8'}) |
| 46 | 46 |
| 47 | |
| 48 def GetPreferredTryMasters(project, change): | |
| 49 return { | |
| 50 'tryserver.client.catapult': { | |
| 51 'Catapult Android Tryserver': {'defaulttests'}, | |
| 52 'Catapult Linux Tryserver': {'defaulttests'}, | |
| 53 'Catapult Mac Tryserver': {'defaulttests'}, | |
| 54 'Catapult Windows Tryserver': {'defaulttests'}, | |
| 55 } | |
| 56 } | |
| 57 | |
| 58 | |
| 59 def CheckChangeLogBug(input_api, output_api): | 47 def CheckChangeLogBug(input_api, output_api): |
| 60 # Show a presubmit message if there is no BUG= line. | 48 # Show a presubmit message if there is no BUG= line. |
| 61 if input_api.change.BUG is None: | 49 if input_api.change.BUG is None: |
| 62 return [output_api.PresubmitNotifyResult( | 50 return [output_api.PresubmitNotifyResult( |
| 63 'If this change has associated Catapult and/or Rietveld bug(s), add a ' | 51 'If this change has associated Catapult and/or Rietveld bug(s), add a ' |
| 64 '"BUG=<bug>(, <bug>)*" line to the patch description where <bug> can ' | 52 '"BUG=<bug>(, <bug>)*" line to the patch description where <bug> can ' |
| 65 'be one of the following: catapult:#NNNN, ' + | 53 'be one of the following: catapult:#NNNN, ' + |
| 66 ', '.join('%s:NNNNNN' % n for n in _RIETVELD_REPOSITORY_NAMES) + '.')] | 54 ', '.join('%s:NNNNNN' % n for n in _RIETVELD_REPOSITORY_NAMES) + '.')] |
| 67 | 55 |
| 68 # Throw a presubmit error if the BUG= line is provided but empty. | 56 # Throw a presubmit error if the BUG= line is provided but empty. |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 sys.path.remove(input_api.PresubmitLocalPath()) | 126 sys.path.remove(input_api.PresubmitLocalPath()) |
| 139 return results | 127 return results |
| 140 | 128 |
| 141 | 129 |
| 142 def CheckChangeOnUpload(input_api, output_api): | 130 def CheckChangeOnUpload(input_api, output_api): |
| 143 return CheckChange(input_api, output_api) | 131 return CheckChange(input_api, output_api) |
| 144 | 132 |
| 145 | 133 |
| 146 def CheckChangeOnCommit(input_api, output_api): | 134 def CheckChangeOnCommit(input_api, output_api): |
| 147 return CheckChange(input_api, output_api) | 135 return CheckChange(input_api, output_api) |
| OLD | NEW |