Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 # FIXME: Everything in this file belongs in gatekeeper_ng_config.py | 5 # FIXME: Everything in this file belongs in gatekeeper_ng_config.py |
| 6 | 6 |
| 7 import logging | 7 import logging |
| 8 | 8 |
| 9 | 9 |
| 10 def excluded_builders(master_config): | 10 def excluded_builders(master_config): |
| 11 return master_config[0].get('*', {}).get('excluded_builders', set()) | 11 return master_config[0].get('*', {}).get('excluded_builders', set()) |
| 12 | 12 |
| 13 | 13 |
| 14 # pylint: disable=C0301 | 14 def tree_for_master(master_url, gatekeeper_trees_config): |
| 15 # FIXME: This is currently baked into: | 15 """Returns name of the tree for a given master or None if failed to detect.""" |
| 16 # https://chromium.googlesource.com/chromium/tools/build/+/master/scripts/slave/ gatekeeper_launch.py | 16 for tree_name, tree_config in gatekeeper_trees_config.iteritems(): |
| 17 # http://crbug.com/394961 | 17 if tree_name == 'non-closers': |
|
ojan
2014/08/28 03:34:15
Lets include the non-closers as a tree name for no
Sergiy Byelozyorov
2014/08/28 17:45:58
Done.
| |
| 18 MASTER_CONFIG = { | 18 continue |
| 19 'chromium-status': [ | 19 if master_url in tree_config['masters']: |
| 20 'chromium', | |
| 21 'chromium.chrome', | |
| 22 'chromium.chromiumos', | |
| 23 'chromium.gpu', | |
| 24 'chromium.linux', | |
| 25 'chromium.mac', | |
| 26 'chromium.memory', | |
| 27 'chromium.win', | |
| 28 ], | |
| 29 'blink-status': [ | |
| 30 'chromium.webkit', | |
| 31 ], | |
| 32 } | |
| 33 | |
| 34 | |
| 35 def tree_for_master(master_name): | |
| 36 for tree_name, master_names in MASTER_CONFIG.items(): | |
| 37 if master_name in master_names: | |
| 38 return tree_name | 20 return tree_name |
| 21 return None | |
|
ojan
2014/08/28 03:34:15
Instead of returning None, lets return the last bi
Sergiy Byelozyorov
2014/08/28 17:45:58
Done.
| |
| 39 | 22 |
| 40 | 23 |
| 41 def would_close_tree(master_config, builder_name, step_name): | 24 def would_close_tree(master_config, builder_name, step_name): |
| 42 # FIXME: Section support should be removed: | 25 # FIXME: Section support should be removed: |
| 43 master_config = master_config[0] | 26 master_config = master_config[0] |
| 44 builder_config = master_config.get(builder_name, {}) | 27 builder_config = master_config.get(builder_name, {}) |
| 45 if not builder_config: | 28 if not builder_config: |
| 46 builder_config = master_config.get('*', {}) | 29 builder_config = master_config.get('*', {}) |
| 47 | 30 |
| 48 # close_tree is currently unused in gatekeeper.json but planned to be. | 31 # close_tree is currently unused in gatekeeper.json but planned to be. |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 70 | 53 |
| 71 # A '*' in any of the above types means it applies to all steps. | 54 # A '*' in any of the above types means it applies to all steps. |
| 72 if '*' in closing_steps: | 55 if '*' in closing_steps: |
| 73 return True | 56 return True |
| 74 | 57 |
| 75 if step_name in closing_steps: | 58 if step_name in closing_steps: |
| 76 return True | 59 return True |
| 77 | 60 |
| 78 logging.debug('%s not in closing_steps: %s' % (step_name, closing_steps)) | 61 logging.debug('%s not in closing_steps: %s' % (step_name, closing_steps)) |
| 79 return False | 62 return False |
| OLD | NEW |