Skip to content
This repository was archived by the owner on May 31, 2025. It is now read-only.

Commit b976394

Browse files
Run tests for pull requests from all branches
1 parent f4adc43 commit b976394

File tree

2 files changed

+9
-12
lines changed

2 files changed

+9
-12
lines changed

bb_master_config/git_hub_pullrequest_poller.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
# Grabbed from https://github.com/buildbot/buildbot/pull/2585, mid-review. The
1818
# only changes here a few bug fixes that are pending there.
1919

20+
2021
from __future__ import absolute_import
2122
from __future__ import print_function
2223

@@ -64,11 +65,11 @@ def checkConfig(self,
6465
project='',
6566
pullrequest_filter=True,
6667
token=None,
67-
repository_link="https",
68+
repository_type="https",
6869
**kwargs):
69-
if repository_link not in ["https", "svn", "git", "ssh"]:
70+
if repository_type not in ["https", "svn", "git", "ssh"]:
7071
config.error(
71-
"repository_link must be one of {https, svn, git, ssh}")
72+
"repository_type must be one of {https, svn, git, ssh}")
7273
base.ReconfigurablePollingChangeSource.checkConfig(
7374
self, name=self.name, **kwargs)
7475

@@ -84,7 +85,7 @@ def reconfigService(self,
8485
pullrequest_filter=True,
8586
token=None,
8687
pollAtLaunch=False,
87-
repository_link="https",
88+
repository_type="https",
8889
**kwargs):
8990
yield base.ReconfigurablePollingChangeSource.reconfigService(
9091
self, name=self.name, **kwargs)
@@ -101,16 +102,13 @@ def reconfigService(self,
101102
self._http = yield httpclientservice.HTTPClientService.getService(
102103
self.master, baseURL, headers=http_headers)
103104

104-
if not branches:
105-
branches = ['master']
106-
107105
self.token = token
108106
self.owner = owner
109107
self.repo = repo
110108
self.branches = branches
111109
self.project = project
112110
self.pollInterval = pollInterval
113-
self.repository_link = link_urls[repository_link]
111+
self.repository_type = link_urls[repository_type]
114112

115113
if callable(pullrequest_filter):
116114
self.pullrequest_filter = pullrequest_filter
@@ -184,7 +182,7 @@ def _processChanges(self, github_result):
184182
revision = pr['head']['sha']
185183

186184
# Check to see if the branch is set or matches
187-
if base_branch not in self.branches:
185+
if self.branches is not None and base_branch not in self.branches:
188186
continue
189187
if (self.pullrequest_filter is not None and
190188
not self.pullrequest_filter(pr)):
@@ -194,7 +192,7 @@ def _processChanges(self, github_result):
194192
# Access title, repo, html link, and comments
195193
branch = pr['head']['ref']
196194
title = pr['title']
197-
repo = pr['head']['repo'][self.repository_link]
195+
repo = pr['head']['repo'][self.repository_type]
198196
revlink = pr['html_url']
199197
comments = pr['body']
200198
updated = datetime.strptime(pr['updated_at'],

bb_master_config/master.cfg

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,8 @@ c['change_source'].append(
8282
GitHubPullrequestPoller(
8383
owner=PUBLIC['github_organization'],
8484
repo=PUBLIC['github_repo'],
85-
branches=['dev'],
8685
token=MASTER_BB_SECRETS['github_access_token'],
87-
repository_link='git',
86+
repository_type='git',
8887
pollInterval=30,
8988
pullrequest_filter=(
9089
lambda pr: pr['user']['login'] in GITHUB_TRUSTED_USERS),

0 commit comments

Comments
 (0)