Skip to content

TypeError when measuring time to first response #173

@christopherlo93

Description

@christopherlo93

I was testing this with PRs in my org that were closed in the last two weeks:

Traceback (most recent call last):
  File "/action/workspace/issue_metrics.py", line 331, in <module>
    main()
  File "/action/workspace/issue_metrics.py", line 286, in main
    issues_with_metrics, num_issues_open, num_issues_closed = get_per_issue_metrics(
                                                              ^^^^^^^^^^^^^^^^^^^^^^
  File "/action/workspace/issue_metrics.py", line 180, in get_per_issue_metrics
    issue_with_metrics.time_to_first_response = measure_time_to_first_response(
                                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/action/workspace/time_to_first_response.py", line 77, in measure_time_to_first_response
    if ignore_comment(
       ^^^^^^^^^^^^^^^
  File "/action/workspace/time_to_first_response.py", line 133, in ignore_comment
    or (ready_for_review_at and comment_created_at < ready_for_review_at)
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: '<' not supported between instances of 'NoneType' and 'datetime.datetime'

I have a feeling it may be a draft PR that was closed before it was ever ready for review.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions