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

Bitbucket: fix merge_pull_request. POSTparams --> data #1438

Merged
merged 4 commits into from
Jul 30, 2024
Merged
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
10 changes: 6 additions & 4 deletions atlassian/bitbucket/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2211,10 +2211,10 @@
project_key: str,
repository_slug: str,
pr_id: int,
pr_version: Optional[int],
merge_message: str,
close_source_branch: bool = False,
merge_strategy: Union[str, MergeStrategy] = MergeStrategy.MERGE_COMMIT,
pr_version: Optional[int] = None,
):
"""
Merge pull request
Expand All @@ -2224,21 +2224,23 @@
:param project_key: PROJECT
:param repository_slug: my_shiny_repo
:param pr_id: 2341
:param pr_version:
:param merge_message: "feat: add new file handler"
:param pr_version:
:param close_source_branch: True
:param merge_strategy: "squash"
:return:
"""
url = "{}/merge".format(self._url_pull_request(project_key, repository_slug, pr_id))
params = {
params = {}
data = {

Check warning on line 2235 in atlassian/bitbucket/__init__.py

View check run for this annotation

Codecov / codecov/patch

atlassian/bitbucket/__init__.py#L2234-L2235

Added lines #L2234 - L2235 were not covered by tests
"type": "pullrequest",
"message": merge_message,
"close_source_branch": close_source_branch,
"merge_strategy": MergeStrategy(merge_strategy).value,
}
if not self.cloud:
params["version"] = pr_version
return self.post(url, params=params)
return self.post(url, data=data, params=params)

Check warning on line 2243 in atlassian/bitbucket/__init__.py

View check run for this annotation

Codecov / codecov/patch

atlassian/bitbucket/__init__.py#L2243

Added line #L2243 was not covered by tests

def reopen_pull_request(self, project_key, repository_slug, pr_id, pr_version):
"""
Expand Down