events: add event system for RepoEvents

This commit is contained in:
Daniel Dourvaris 2016-07-06 06:00:18 +03:00
parent 9875dca82f
commit 9727a3880f
13 changed files with 325 additions and 22 deletions

View file

@ -271,6 +271,7 @@ class TestPullRequestModel:
'6126b7bfcc82ad2d3deaee22af926b082ce54cc6',
MergeFailureReason.NONE)
merge_extras['repository'] = pull_request.target_repo.repo_name
PullRequestModel().merge(
pull_request, pull_request.author, extras=merge_extras)
@ -308,6 +309,7 @@ class TestPullRequestModel:
'6126b7bfcc82ad2d3deaee22af926b082ce54cc6',
MergeFailureReason.MERGE_FAILED)
merge_extras['repository'] = pull_request.target_repo.repo_name
PullRequestModel().merge(
pull_request, pull_request.author, extras=merge_extras)
@ -364,6 +366,7 @@ class TestIntegrationMerge(object):
pull_request = pr_util.create_pull_request(
approved=True, mergeable=True)
# TODO: johbo: Needed for sqlite, try to find an automatic way for it
merge_extras['repository'] = pull_request.target_repo.repo_name
Session().commit()
with mock.patch.dict(rhodecode.CONFIG, extra_config, clear=False):
@ -379,6 +382,7 @@ class TestIntegrationMerge(object):
pull_request = pr_util.create_pull_request(
approved=True, mergeable=True)
# TODO: johbo: Needed for sqlite, try to find an automatic way for it
merge_extras['repository'] = pull_request.target_repo.repo_name
Session().commit()
with mock.patch('rhodecode.EXTENSIONS.PRE_PUSH_HOOK') as pre_pull:
@ -400,6 +404,7 @@ class TestIntegrationMerge(object):
# all data is pre-computed, that's why just updating the DB is not
# enough.
merge_extras['locked_by'] = locked_by
merge_extras['repository'] = pull_request.target_repo.repo_name
# TODO: johbo: Needed for sqlite, try to find an automatic way for it
Session().commit()
merge_status = PullRequestModel().merge(