Skip to content

Commit ddf768b

Browse files
authored
Fix the problem with automerging (#192)
Ensure we're sending in a string instead of a list.
1 parent 5fc67ce commit ddf768b

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

miss_islington/status_change.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,15 +109,13 @@ async def merge_pr(gh, pr, sha, is_automerge=False):
109109
pr_number = pr["number"]
110110
async for commit in gh.getiter(f"/repos/python/cpython/pulls/{pr_number}/commits"):
111111
if commit["sha"] == sha:
112-
pr_title = ""
113-
pr_commit_msg = ""
114-
115112
if is_automerge:
116113
pr_commit_msg = util.normalize_message(pr["body"])
117114
pr_title = f"{pr['title']} (GH-{pr_number})"
118115
else:
119-
pr_commit_msg = commit["commit"]["message"].split("\n")
120-
pr_title = f"{pr_commit_msg[0]}"
116+
commit_msg = commit["commit"]["message"].split("\n")
117+
pr_commit_msg = "\n".join(commit_msg[1:])
118+
pr_title = f"{commit_msg[0]}"
121119

122120
data = {
123121
"commit_title": pr_title,

tests/test_status_change.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,10 @@ async def test_ci_passed_with_awaiting_merge_label_pr_is_merged():
104104
gh.put_data["commit_title"]
105105
== "bpo-32720: Fixed the replacement field grammar documentation. (GH-5544)"
106106
)
107+
assert (
108+
gh.put_data["commit_message"]
109+
== "\n`arg_name` and `element_index` are defined as `digit`+ instead of `integer`.\n(cherry picked from commit 7a561afd2c79f63a6008843b83733911d07f0119)\n\nCo-authored-by: Mariatta <[email protected]>"
110+
)
107111

108112

109113
async def test_ci_passed_with_no_awaiting_merge_label_pr_is_not_merged():
@@ -255,6 +259,10 @@ async def test_awaiting_merge_label_added_and_ci_passed_pr_is_merged():
255259
gh.put_data["commit_title"]
256260
== "bpo-32720: Fixed the replacement field grammar documentation. (GH-5544)"
257261
)
262+
assert (
263+
gh.put_data["commit_message"]
264+
== "\n`arg_name` and `element_index` are defined as `digit`+ instead of `integer`.\n(cherry picked from commit 7a561afd2c79f63a6008843b83733911d07f0119)\n\nCo-authored-by: Mariatta <[email protected]>"
265+
)
258266

259267

260268
async def test_awaiting_merge_webhook_ci_failure_pr_is_not_merged():

0 commit comments

Comments
 (0)