Skip to content

Commit

Permalink
Merge a081c3d into 5618fac
Browse files Browse the repository at this point in the history
  • Loading branch information
gforcada committed Jul 13, 2018
2 parents 5618fac + a081c3d commit 3bf936f
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/mr.roboto/src/mr/roboto/subscriber.py
Expand Up @@ -441,8 +441,12 @@ def run(self):
"""Trigger the dependencies jenkins job"""
branch = self.pull_request['head']['ref']

if self.repo_name == 'buildout.coredev':
self.log('Do not run dependencies jenkins job on buildout.coredev')
if not self.is_core_package():
base_branch = self.pull_request['base']['ref']
key = f'{self.repo_full_name}/{base_branch}'
self.log(
f'No dependencies jenkins job run on a non-core package {key}',
)
return

settings = self.event.request.registry.settings
Expand All @@ -465,6 +469,12 @@ def run(self):
f'pull request {self.short_url}',
)

def is_core_package(self):
base_branch = self.pull_request['base']['ref']
key = f'{self.repo_full_name}/{base_branch}'
sources = self.event.request.registry.settings['sources_file']
return key in sources


@subscriber(MergedPullRequest)
class UpdateCoredevCheckouts(PullRequestSubscriber):
Expand Down

0 comments on commit 3bf936f

Please sign in to comment.