Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Catch review comments with no valid user #326

Merged
merged 1 commit into from
Jun 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 16 additions & 11 deletions time_to_first_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,17 +73,22 @@ def measure_time_to_first_response(
# so we may also get the first review comment time
if pull_request:
review_comments = pull_request.reviews(number=50) # type: ignore
for review_comment in review_comments:
if ignore_comment(
issue.issue.user,
review_comment.user,
ignore_users,
review_comment.submitted_at,
ready_for_review_at,
):
continue
first_review_comment_time = review_comment.submitted_at
break
try:
for review_comment in review_comments:
if ignore_comment(
issue.issue.user,
review_comment.user,
ignore_users,
review_comment.submitted_at,
ready_for_review_at,
):
continue
first_review_comment_time = review_comment.submitted_at
break
except TypeError as e:
print(
f"An error occurred processing review comments. Perhaps the review contains a ghost user. {e}"
)

# Figure out the earliest response timestamp
if first_comment_time and first_review_comment_time:
Expand Down