| OLD | NEW |
| 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 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 Chromium. | 5 """Top-level presubmit script for Chromium. |
| 6 | 6 |
| 7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts | 7 See http://dev.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 | 10 |
| (...skipping 1731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1742 | 1742 |
| 1743 def GetPreferredTryMasters(project, change): | 1743 def GetPreferredTryMasters(project, change): |
| 1744 import re | 1744 import re |
| 1745 files = change.LocalPaths() | 1745 files = change.LocalPaths() |
| 1746 | 1746 |
| 1747 import os | 1747 import os |
| 1748 import json | 1748 import json |
| 1749 with open(os.path.join( | 1749 with open(os.path.join( |
| 1750 change.RepositoryRoot(), 'testing', 'commit_queue', 'config.json')) as f: | 1750 change.RepositoryRoot(), 'testing', 'commit_queue', 'config.json')) as f: |
| 1751 cq_config = json.load(f) | 1751 cq_config = json.load(f) |
| 1752 cq_trybots = cq_config.get('trybots', {}) | 1752 cq_verifiers = cq_config.get('verifiers_no_patch', {}) |
| 1753 builders = cq_trybots.get('launched', {}) | 1753 cq_try_jobs = cq_verifiers.get('try_job_verifier', {}) |
| 1754 for master, master_config in cq_trybots.get('triggered', {}).iteritems(): | 1754 builders = cq_try_jobs.get('launched', {}) |
| 1755 |
| 1756 for master, master_config in cq_try_jobs.get('triggered', {}).iteritems(): |
| 1755 for triggered_bot in master_config: | 1757 for triggered_bot in master_config: |
| 1756 builders.get(master, {}).pop(triggered_bot, None) | 1758 builders.get(master, {}).pop(triggered_bot, None) |
| 1757 | 1759 |
| 1758 # Explicitly iterate over copies of dicts since we mutate them. | 1760 # Explicitly iterate over copies of dicts since we mutate them. |
| 1759 for master in builders.keys(): | 1761 for master in builders.keys(): |
| 1760 for builder in builders[master].keys(): | 1762 for builder in builders[master].keys(): |
| 1761 # Do not trigger presubmit builders, since they're likely to fail | 1763 # Do not trigger presubmit builders, since they're likely to fail |
| 1762 # (e.g. OWNERS checks before finished code review), and we're | 1764 # (e.g. OWNERS checks before finished code review), and we're |
| 1763 # running local presubmit anyway. | 1765 # running local presubmit anyway. |
| 1764 if 'presubmit' in builder: | 1766 if 'presubmit' in builder: |
| 1765 builders[master].pop(builder) | 1767 builders[master].pop(builder) |
| 1766 | 1768 |
| 1767 return builders | 1769 return builders |
| OLD | NEW |