Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitLab: merge with correct arguments #385

Merged
merged 5 commits into from
Dec 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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