From b28e60280dbcea68820b2844248631e948155126 Mon Sep 17 00:00:00 2001 From: Dongge Liu Date: Wed, 13 Sep 2023 14:32:16 +1000 Subject: [PATCH] Fix non-exist comments --- service/gcbrun_experiment.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/service/gcbrun_experiment.py b/service/gcbrun_experiment.py index a5b9f19f5..b52281fff 100644 --- a/service/gcbrun_experiment.py +++ b/service/gcbrun_experiment.py @@ -37,12 +37,14 @@ def get_comments(pull_request_number): repo = github_obj.get_repo('google/fuzzbench') pull = repo.get_pull(pull_request_number) pull_comments = list(pull.get_comments()) + last_pull_comment = pull_comments[-1] if pull_comments else '' issue = repo.get_issue(pull_request_number) issue_comments = list(issue.get_comments()) + last_issue_comment = issue_comments[-1] if issue_comments else '' # Github only returns comments if from the pull object when a pull request # is open. If it is a draft, it will only return comments from the issue # object. - return pull_comments[-1], issue_comments[-1] + return last_pull_comment, last_issue_comment def get_latest_gcbrun_command(comment):