Skip to content

Commit 9604f39

Browse files
committed
more debug
1 parent 7847b7b commit 9604f39

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

lib/bots_automerge.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,19 @@ def all_checks_pass(api: github.GitHub, commit_hash: str) -> bool:
6464
def auto_merge_bots_pr(repo: str, pr: int, sha: str) -> None:
6565
api = github.GitHub(repo=repo)
6666

67+
print(f"is_cu_bot: {is_ci_bot(api, pr)}")
6768
# Make sure that the PR was made by cockpituous or github actions
68-
# if not is_ci_bot(api, pr_num):
69+
# if not is_ci_bot(api, pr):
6970
# logger.info("PR not made by CI bot, skipping automerge")
7071
# return
7172

7273
# check that all checks are green
74+
print(f"all_checks_pass: {all_checks_pass(api, sha)}")
7375
if not all_checks_pass(api, sha):
7476
logger.info("Not every check has passed, skipping automerge")
7577
return
7678

7779
logger.info("All checks green, can automerge")
80+
print("All checks green, can automerge")
7881
# merge the PR
7982
api.approve_pr(pr, sha)

run-queue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,10 +198,11 @@ failed with exit code %i. Please check the container logs for details.""" % (cmd
198198
if delivery_tag is not None:
199199
dq.channel.basic_ack(delivery_tag)
200200

201-
print(f"\n\n\njob_sub: {job_subj}")
202201
if job_subj is not None:
202+
print(f"\n\n\nrepo: {job_subj.repo}\n, pull: {job_subj.pull}\n, sha: {job_subj.sha}\n")
203203
# skip automerge if jobs don't run against a PR
204204
if job_subj.repo is not None and job_subj.pull is not None and job_subj.sha is not None:
205+
print("starting automerge")
205206
auto_merge_bots_pr(job_subj.repo, job_subj.pull, job_subj.sha)
206207
else:
207208
logging.info("Skipping automerge for job: %s", job_subj)

task/github.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,8 @@ def approve_pr(self, pr: int, sha: str) -> None:
431431
'event': 'APPROVE',
432432
'comments': 'So cool'
433433
}
434-
self.post(f'pulls/{pr}/reviews', data)
434+
rw = self.post(f'pulls/{pr}/reviews', data)
435+
print(f"post {rw}")
435436

436437
# let's not write the merge code yet :)
437438

0 commit comments

Comments
 (0)