OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # Copyright 2013 The Chromium Authors. All rights reserved. | 2 # Copyright 2013 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 """Utility class to generate a Dart-specific BuildFactory. | 6 """Utility class to generate a Dart-specific BuildFactory. |
7 | 7 |
8 Based on gclient_factory.py. | 8 Based on gclient_factory.py. |
9 """ | 9 """ |
10 | 10 |
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
539 | 539 |
540 # Polls config.Master.dart_url for changes | 540 # Polls config.Master.dart_url for changes |
541 return svnpoller.SVNPoller(svnurl=config.Master.dart_url, | 541 return svnpoller.SVNPoller(svnurl=config.Master.dart_url, |
542 svnbin=chromium_utils.SVN_BIN, | 542 svnbin=chromium_utils.SVN_BIN, |
543 split_file=dart_tree_file_splitter, | 543 split_file=dart_tree_file_splitter, |
544 pollinterval=10, | 544 pollinterval=10, |
545 revlinktmpl=dart_revision_url) | 545 revlinktmpl=dart_revision_url) |
546 | 546 |
547 | 547 |
548 @staticmethod | 548 @staticmethod |
549 def get_git_poller(repo, project, revlink, branch=None, master=None): | 549 def get_git_poller(repo, project, revlink, branch=None, master=None, |
| 550 interval=None): |
550 project = '%s-%s' % (project, branch) if branch else project | 551 project = '%s-%s' % (project, branch) if branch else project |
551 branch = branch or 'master' | 552 branch = branch or 'master' |
552 master = master or 'main' | 553 master = master or 'main' |
| 554 interval = interval or 40 |
553 workdir = '/tmp/git_workdir_%s_%s_%s' % (project, branch, master) | 555 workdir = '/tmp/git_workdir_%s_%s_%s' % (project, branch, master) |
554 return gitpoller.GitPoller(repourl=repo, | 556 return gitpoller.GitPoller(repourl=repo, |
555 pollinterval=20, | 557 pollinterval=interval, |
556 project=project, | 558 project=project, |
557 branch=branch, | 559 branch=branch, |
558 workdir=workdir, | 560 workdir=workdir, |
559 revlinktmpl=revlink) | 561 revlinktmpl=revlink) |
560 | 562 |
561 @staticmethod | 563 @staticmethod |
562 def get_github_gclient_repo(project, name, branch=None): | 564 def get_github_gclient_repo(project, name, branch=None): |
563 repo = DartUtils.get_github_repo(project, name) | 565 repo = DartUtils.get_github_repo(project, name) |
564 if branch: | 566 if branch: |
565 repo = '%s@refs/remotes/origin/%s' % (repo, branch) | 567 repo = '%s@refs/remotes/origin/%s' % (repo, branch) |
566 return repo | 568 return repo |
567 | 569 |
568 @staticmethod | 570 @staticmethod |
569 def get_github_repo(project, name): | 571 def get_github_repo(project, name): |
570 return 'https://github.com/%s/%s.git' % (project, name) | 572 return 'https://github.com/%s/%s.git' % (project, name) |
571 | 573 |
572 @staticmethod | 574 @staticmethod |
573 def get_github_poller(project, name, branch=None, master=None): | 575 def get_github_poller(project, name, branch=None, master=None, interval=None): |
574 repository = 'https://github.com/%s/%s.git' % (project, name) | 576 repository = 'https://github.com/%s/%s.git' % (project, name) |
575 revlink = ('https://github.com/' + project + '/' + name + '/commit/%s') | 577 revlink = ('https://github.com/' + project + '/' + name + '/commit/%s') |
576 return DartUtils.get_git_poller(repository, name, revlink, branch, master) | 578 return DartUtils.get_git_poller(repository, name, revlink, branch, master, |
| 579 interval=interval) |
577 | 580 |
578 @staticmethod | 581 @staticmethod |
579 def get_github_mirror_poller(project, name, branch=None, master=None): | 582 def get_github_mirror_poller(project, name, branch=None, master=None): |
580 repository = '%s/%s/%s.git' % (github_mirror, project, name) | 583 repository = '%s/%s/%s.git' % (github_mirror, project, name) |
581 revlink = ('https://github.com/' + project + '/' + name + '/commit/%s') | 584 revlink = ('https://github.com/' + project + '/' + name + '/commit/%s') |
582 return DartUtils.get_git_poller(repository, name, revlink, branch, master) | 585 return DartUtils.get_git_poller(repository, name, revlink, branch, master) |
583 | 586 |
584 @staticmethod | 587 @staticmethod |
585 def prioritize_builders(buildmaster, builders): | 588 def prioritize_builders(buildmaster, builders): |
586 def get_priority(name): | 589 def get_priority(name): |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
751 builders=notifying_builders)) | 754 builders=notifying_builders)) |
752 else: | 755 else: |
753 statuses.append( | 756 statuses.append( |
754 MailNotifier(fromaddr=self._active_master.from_address, | 757 MailNotifier(fromaddr=self._active_master.from_address, |
755 mode='problem', | 758 mode='problem', |
756 sendToInterestedUsers=send_to_interested_useres, | 759 sendToInterestedUsers=send_to_interested_useres, |
757 extraRecipients=extra_recipients, | 760 extraRecipients=extra_recipients, |
758 lookup=master_utils.UsersAreEmails(), | 761 lookup=master_utils.UsersAreEmails(), |
759 builders=notifying_builders)) | 762 builders=notifying_builders)) |
760 return statuses | 763 return statuses |
OLD | NEW |