Add a debug output for cases when approved_at==0

This commit is contained in:
Mikhail f. Shiryaev 2023-01-20 16:38:44 +01:00
parent 914af887f2
commit 697c0b1f5b
No known key found for this signature in database
GPG Key ID: 4B02ED204C7D93F4

View File

@ -7,6 +7,7 @@ import logging
from datetime import datetime
from os import getenv
from pprint import pformat
from typing import Dict, List
from github.PullRequestReview import PullRequestReview
@ -104,6 +105,12 @@ class Reviews:
)
approved_at = max(review.submitted_at for review in approved.values())
if approved_at == datetime.fromtimestamp(0):
logging.info(
"Unable to get `datetime.fromtimestamp(0)`, "
"here's debug info about reviews: %s",
"\n".join(pformat(review) for review in self.reviews.values()),
)
if approved_at < last_changed:
logging.info(