Skip to content

Commit

Permalink
Merge pull request #385 from ferhat-aram/fix/merge-request-arguments
Browse files Browse the repository at this point in the history
GitLab: merge with correct arguments
  • Loading branch information
rafaelpivato authored Dec 27, 2020
2 parents 5972a1b + 3d5074e commit 358166d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ History
1.1.2a (current)
----------------
* Current unstable
* Fixed `#384`_ affecting GitLab automatic merge

.. _#384: https://github.com/pyupio/pyup/issues/384

1.1.1 (2020-05-01)
------------------
Expand Down
2 changes: 1 addition & 1 deletion pyup/providers/gitlab.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def close_pull_request(self, bot_repo, user_repo, pull_request, comment, prefix)
self.delete_branch(user_repo, source_branch, prefix)

def _merge_merge_request(self, mr, config):
mr.merge(remove_source_branch=config.gitlab.should_remove_source_branch,
mr.merge(should_remove_source_branch=config.gitlab.should_remove_source_branch,
merge_when_pipeline_succeeds=True)

def create_pull_request(self, repo, title, body, base_branch, new_branch, pr_label, assignees, config):
Expand Down
4 changes: 2 additions & 2 deletions tests/test_gitlab.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ def test_merge_pull_request(self):
config = Config()
self.provider._merge_merge_request(mr, config)
mr.merge.assert_called_once_with(merge_when_pipeline_succeeds=True,
remove_source_branch=False)
should_remove_source_branch=False)

def test_merge_pull_request_with_remove(self):
mr = Mock()
Expand All @@ -220,7 +220,7 @@ def test_merge_pull_request_with_remove(self):
config.update_config({'gitlab': {'should_remove_source_branch': True}})
self.provider._merge_merge_request(mr, config)
mr.merge.assert_called_once_with(merge_when_pipeline_succeeds=True,
remove_source_branch=True)
should_remove_source_branch=True)

def test_create_pull_request_with_exceeding_body(self):
body = ''.join(["a" for i in range(0, 65536 + 1)])
Expand Down

0 comments on commit 358166d

Please sign in to comment.