FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix: remove default arguments for mergerequests.merge() by JohnVillalovos · Pull Request #1818 · python-gitlab/python-gitlab · GitHub

Repository navigation

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (2) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
8 changes: 4 additions & 4 deletions gitlab/v4/objects/merge_requests.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -358,8 +358,8 @@ def merge_ref(self, **kwargs: Any) -> Union[Dict[str, Any], requests.Response]:
def merge(
self,
merge_commit_message: Optional[str] = None,
should_remove_source_branch: bool = False,
merge_when_pipeline_succeeds: bool = False,
should_remove_source_branch: Optional[bool] = None,
merge_when_pipeline_succeeds: Optional[bool] = None,
**kwargs: Any,
) -> Dict[str, Any]:
"""Accept the merge request.
Expand All @@ -382,8 +382,8 @@ def merge(
data["merge_commit_message"] = merge_commit_message
if should_remove_source_branch is not None:
data["should_remove_source_branch"] = should_remove_source_branch
if merge_when_pipeline_succeeds:
data["merge_when_pipeline_succeeds"] = True
if merge_when_pipeline_succeeds is not None:
data["merge_when_pipeline_succeeds"] = merge_when_pipeline_succeeds

server_data = self.manager.gitlab.http_put(path, post_data=data, **kwargs)
if TYPE_CHECKING:
Expand Down
4 changes: 3 additions & 1 deletion tests/functional/api/test_merge_requests.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,9 @@ def test_merge_request_large_commit_message(
merge_commit_message = "large_message\r\n" * 1_000
assert len(merge_commit_message) > 10_000

mr.merge(merge_commit_message=merge_commit_message)
mr.merge(
merge_commit_message=merge_commit_message, should_remove_source_branch=False
)

result = wait_for_sidekiq(timeout=60)
assert result is True, "sidekiq process should have terminated but did not"
Expand Down

Back | FazBrowse Home | New Git URL