8000 Disable miss-islington comments in check_run as well (#583) · python/miss-islington@be7cbdd · GitHub
[go: up one dir, main page]

Skip to content

Commit be7cbdd

Browse files
authored
Disable miss-islington comments in check_run as well (#583)
1 parent 2e6fc49 commit be7cbdd

File tree

3 files changed

+15
-12
lines changed

3 files changed

+15
-12
lines changed

miss_islington/check_run.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
router = routing.Router()
99

1010
TITLE_RE = re.compile(r"\[(?P<branch>\d+\.\d+)\].+?(?P<pr>\d+)\)")
11-
AUTOMERGE_TRAILER = "Automerge-Triggered-By"
1211

1312

1413
@router.register("check_run", action="completed")
@@ -19,7 +18,8 @@ async def check_run_completed(event, gh, *args, **kwargs):
1918
sha = event.data["check_run"]["head_sha"]
2019

2120
if event.data["sender"]["login"] == "miss-islington":
22-
await check_ci_status_and_approval(gh, sha, leave_comment=True)
21+
# Leave comment temporarily disabled when automerge not used. See #577.
22+
await check_ci_status_and_approval(gh, sha, leave_comment=False)
2323
else:
2424
pr_for_commit = await util.get_pr_for_commit(gh, sha)
2525
if pr_for_commit:

miss_islington/status_change.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -115,13 +115,13 @@ async def check_ci_status_and_approval(
115115
status = "it's a success"
116116
message = f"Status check is done, and {status} {emoji}."
117117
if not success:
118-
if is_automerge:
119-
participants = await util.get_gh_participants(gh, pr_number)
120-
else:
121-
original_pr_number = title_match.group("pr")
122-
participants = await util.get_gh_participants(
123-
gh, original_pr_number
124-
)
118+
# if is_automerge:
119+
participants = await util.get_gh_participants(gh, pr_number)
120+
# else:
121+
# original_pr_number = title_match.group("pr")
122+
# participants = await util.get_gh_participants(
123+
# gh, original_pr_number
124+
# )
125125
message = f"{participants}: {message}"
126126
await util.leave_comment(
127127
gh,

tests/test_check_run.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ async def test_check_run_completed_ci_passed_with_awaiting_merge_label_pr_is_mer
7575

7676
gh = FakeGH(getitem=getitem, getiter=getiter)
7777
await check_run.router.dispatch(event, gh)
78-
assert len(gh.post_data["body"]) is not None # leaves a comment
78+
# Leave comment temporarily disabled when automerge not used. See #577.
79+
# assert len(gh.post_data["body"]) is not None # leaves a comment
7980
assert gh.put_data["sha"] == sha # is merged
8081
assert gh.put_data["merge_method"] == "squash"
8182
assert (
@@ -278,7 +279,8 @@ async def test_check_run_completed_failure_with_awaiting_merge_label_pr_is_not_m
278279

279280
gh = FakeGH(getitem=getitem)
280281
await check_run.router.dispatch(event, gh)
281-
assert len(gh.post_data["body"]) is not None # leaves a comment
282+
# Leave comment temporarily disabled when automerge not used. See #577.
283+
# assert len(gh.post_data["body"]) is not None # leaves a comment
282284
assert not hasattr(gh, "put_data") # is not merged
283285

284286

@@ -350,7 +352,8 @@ async def test_check_run_completed_timed_out_with_awaiting_merge_label_pr_is_not
350352

351353
gh = FakeGH(getitem=getitem, getiter=getiter)
352354
await check_run.router.dispatch(event, gh)
353-
assert len(gh.post_data["body"]) is not None # leaves a comment
355+
# Leave comment temporarily disabled when automerge not used. See #577.
356+
# assert len(gh.post_data["body"]) is not None # leaves a comment
354357
assert not hasattr(gh, "put_data") # is not merged
355358

356359

0 commit comments

Comments
 (0)
0