| 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 import ast | 5 import ast |
| 6 import os | 6 import os |
| 7 | 7 |
| 8 from buildbot.schedulers.basic import SingleBranchScheduler | 8 from buildbot.schedulers.basic import SingleBranchScheduler |
| 9 from buildbot.status.mail import MailNotifier | 9 from buildbot.status.mail import MailNotifier |
| 10 | 10 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 c['projectURL'] = Master.project_url | 34 c['projectURL'] = Master.project_url |
| 35 c['buildbotURL'] = active_master_cls.buildbot_url | 35 c['buildbotURL'] = active_master_cls.buildbot_url |
| 36 | 36 |
| 37 # This sets c['db_url'] to the database connect string in found in | 37 # This sets c['db_url'] to the database connect string in found in |
| 38 # the .dbconfig in the master directory, if it exists. If this is | 38 # the .dbconfig in the master directory, if it exists. If this is |
| 39 # a production host, it must exist. | 39 # a production host, it must exist. |
| 40 chromium_utils.DatabaseSetup( | 40 chromium_utils.DatabaseSetup( |
| 41 c, | 41 c, |
| 42 require_dbconfig=active_master_cls.is_production_host) | 42 require_dbconfig=active_master_cls.is_production_host) |
| 43 | 43 |
| 44 if builders['master_type'] == 'waterfall': | 44 # TODO(dpranke): crbug.com/492876. Rework this when we add support for |
| 45 # multiple schedulers. |
| 46 if 'git_repo_url' in builders: |
| 45 change_source = gitiles_poller.GitilesPoller(builders['git_repo_url']) | 47 change_source = gitiles_poller.GitilesPoller(builders['git_repo_url']) |
| 46 c['change_source'] = [change_source] | 48 c['change_source'] = [change_source] |
| 47 tag_comparator = change_source.comparator | 49 tag_comparator = change_source.comparator |
| 48 else: | 50 else: |
| 49 assert builders['master_type'] == 'tryserver' | |
| 50 c['change_source'] = [] | 51 c['change_source'] = [] |
| 51 c['mergeRequests'] = False | 52 c['mergeRequests'] = False |
| 52 tag_comparator = None | 53 tag_comparator = None |
| 53 | 54 |
| 54 c['builders'] = [] | 55 c['builders'] = [] |
| 55 for builder_name, builder_data in builders['builders'].items(): | 56 for builder_name, builder_data in builders['builders'].items(): |
| 56 c['builders'].append({ | 57 c['builders'].append({ |
| 57 'auto_reboot': builder_data.get('auto_reboot', True), | 58 'auto_reboot': builder_data.get('auto_reboot', True), |
| 58 'name': builder_name, | 59 'name': builder_name, |
| 59 'factory': m_annotator.BaseFactory(), | 60 'factory': m_annotator.BaseFactory(), |
| (...skipping 30 matching lines...) Expand all Loading... |
| 90 templates=builders['templates'], | 91 templates=builders['templates'], |
| 91 tagComparator=tag_comparator, | 92 tagComparator=tag_comparator, |
| 92 enable_http_status_push=active_master_cls.is_production_host) | 93 enable_http_status_push=active_master_cls.is_production_host) |
| 93 | 94 |
| 94 # TODO: AutoSetupMaster's settings for the following are too low to be | 95 # TODO: AutoSetupMaster's settings for the following are too low to be |
| 95 # useful for most projets. We should fix that. | 96 # useful for most projets. We should fix that. |
| 96 c['buildHorizon'] = 3000 | 97 c['buildHorizon'] = 3000 |
| 97 c['logHorizon'] = 3000 | 98 c['logHorizon'] = 3000 |
| 98 # Must be at least 2x the number of slaves. | 99 # Must be at least 2x the number of slaves. |
| 99 c['eventHorizon'] = 200 | 100 c['eventHorizon'] = 200 |
| OLD | NEW |