| 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 """buildbucket module implements buildbucket-buildbot integration. | 5 """buildbucket module implements buildbucket-buildbot integration. |
| 6 | 6 |
| 7 The main entry point is buildbucket.setup() that accepts master configuration | 7 The main entry point is buildbucket.setup() that accepts master configuration |
| 8 dict with other buildbucket parameters and configures master to run builds | 8 dict with other buildbucket parameters and configures master to run builds |
| 9 scheduled on buildbucket service. | 9 scheduled on buildbucket service. |
| 10 | 10 |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 assert all(isinstance(b, basestring) for b in buckets), ( | 72 assert all(isinstance(b, basestring) for b in buckets), ( |
| 73 'all buckets must be strings') | 73 'all buckets must be strings') |
| 74 | 74 |
| 75 if dry_run is None: | 75 if dry_run is None: |
| 76 dry_run = 'POLLER_DRY_RUN' in os.environ | 76 dry_run = 'POLLER_DRY_RUN' in os.environ |
| 77 | 77 |
| 78 integrator = BuildBucketIntegrator( | 78 integrator = BuildBucketIntegrator( |
| 79 buckets, build_params_hook=build_params_hook, | 79 buckets, build_params_hook=build_params_hook, |
| 80 max_lease_count=max_lease_count) | 80 max_lease_count=max_lease_count) |
| 81 | 81 |
| 82 buildbucket_service_factory = functools.partial( | 82 buildbucket_service = client.create_buildbucket_service( |
| 83 client.create_buildbucket_service, active_master, buildbucket_hostname, | 83 active_master, buildbucket_hostname, verbose) |
| 84 verbose) | |
| 85 | 84 |
| 86 poller = BuildBucketPoller( | 85 poller = BuildBucketPoller( |
| 87 integrator=integrator, | 86 integrator=integrator, |
| 88 poll_interval=poll_interval, | 87 poll_interval=poll_interval, |
| 89 dry_run=dry_run) | 88 dry_run=dry_run) |
| 90 status = BuildBucketStatus( | 89 status = BuildBucketStatus( |
| 91 integrator, | 90 integrator, |
| 92 buildbucket_service_factory=buildbucket_service_factory, | 91 buildbucket_service, |
| 93 dry_run=dry_run) | 92 dry_run=dry_run) |
| 94 config.setdefault('change_source', []).append(poller) | 93 config.setdefault('change_source', []).append(poller) |
| 95 config.setdefault('status', []).append(status) | 94 config.setdefault('status', []).append(status) |
| OLD | NEW |