Reverse reviews so latest it obtained
This commit is contained in:
parent
9c311d0bf0
commit
02f1a80f9e
1 changed files with 2 additions and 1 deletions
|
@ -18,7 +18,7 @@ def pr_to_task_name(pr: PullRequest) -> str:
|
||||||
|
|
||||||
|
|
||||||
def get_my_review(me, pr: PullRequest):
|
def get_my_review(me, pr: PullRequest):
|
||||||
for review in pr.get_reviews():
|
for review in pr.get_reviews().reversed:
|
||||||
if review.user.login == me.login:
|
if review.user.login == me.login:
|
||||||
return review
|
return review
|
||||||
|
|
||||||
|
@ -56,6 +56,7 @@ def todoist_repo_prs():
|
||||||
existing_task = todoist.items.get_by_id(existing_task_id)
|
existing_task = todoist.items.get_by_id(existing_task_id)
|
||||||
task_completed = is_task_completed(existing_task)
|
task_completed = is_task_completed(existing_task)
|
||||||
if my_review:
|
if my_review:
|
||||||
|
print(pr, my_review, my_review.commit_id, pr.head.sha)
|
||||||
if my_review.commit_id == pr.head.sha and not task_completed:
|
if my_review.commit_id == pr.head.sha and not task_completed:
|
||||||
logger.info(
|
logger.info(
|
||||||
"Completing task to review '{}', because I already did it".format(
|
"Completing task to review '{}', because I already did it".format(
|
||||||
|
|
Reference in a new issue