diff --git a/rhodecode/subscribers.py b/rhodecode/subscribers.py --- a/rhodecode/subscribers.py +++ b/rhodecode/subscribers.py @@ -58,31 +58,33 @@ def add_renderer_globals(event): def auto_merge_pr_if_needed(event): - from rhodecode.model.db import PullRequest - from rhodecode.model.pull_request import ( - PullRequestModel, ChangesetStatus, MergeCheck - ) - - pr_event_data = event.as_dict()['pullrequest'] - pull_request = PullRequest.get(pr_event_data['pull_request_id']) - calculated_status = pr_event_data['status'] - if (calculated_status == ChangesetStatus.STATUS_APPROVED - and PullRequestModel().is_automatic_merge_enabled(pull_request)): - user = pull_request.author.AuthUser() - - merge_check = MergeCheck.validate( - pull_request, user, translator=lambda x: x, fail_early=True - ) - if merge_check.merge_possible: - from rhodecode.lib.base import vcs_operation_context - extras = vcs_operation_context( - event.request.environ, repo_name=pull_request.target_repo.repo_name, - username=user.username, action='push', - scm=pull_request.target_repo.repo_type) - from rc_ee.lib.celerylib.tasks import auto_merge_repo - auto_merge_repo.apply_async( - args=(pull_request.pull_request_id, extras), countdown=3 - ) + #TODO To be re-enabled later + pass + # from rhodecode.model.db import PullRequest + # from rhodecode.model.pull_request import ( + # PullRequestModel, ChangesetStatus, MergeCheck + # ) + # + # pr_event_data = event.as_dict()['pullrequest'] + # pull_request = PullRequest.get(pr_event_data['pull_request_id']) + # calculated_status = pr_event_data['status'] + # if (calculated_status == ChangesetStatus.STATUS_APPROVED + # and PullRequestModel().is_automatic_merge_enabled(pull_request)): + # user = pull_request.author.AuthUser() + # + # merge_check = MergeCheck.validate( + # pull_request, user, translator=lambda x: x, fail_early=True + # ) + # if merge_check.merge_possible: + # from rhodecode.lib.base import vcs_operation_context + # extras = vcs_operation_context( + # event.request.environ, repo_name=pull_request.target_repo.repo_name, + # username=user.username, action='push', + # scm=pull_request.target_repo.repo_type) + # from rc_ee.lib.celerylib.tasks import auto_merge_repo + # auto_merge_repo.apply_async( + # args=(pull_request.pull_request_id, extras), countdown=3 + # ) def set_user_lang(event):