Skip to content
This repository was archived by the owner on Nov 18, 2021. It is now read-only.
This repository was archived by the owner on Nov 18, 2021. It is now read-only.

API should allow sorting of issue comments from Issue/PR #1516

Open

Description

@electrofelix

It would be useful to be able to have the issue comment API have an option to return the most recent comments first similar to https://developer.github.com/v3/issues/comments/#list-comments-in-a-repository where a request can ask for specific sorting.

Use case: When performing automatic notification comments on PRs, would like to throttle certain notifications so if an event is occurring that is impacting a particular PR and a notification has already been posted, to skip posting it a second time unless some time limit since the last notification of the same issue has expired. This is useful for the users watching that PR to not keep receiving the same message multiple times unless something has changed since the first notification or sufficient time has passed that it is useful to post the same notification again.

When querying the issue comments API https://developer.github.com/v3/issues/comments/#list-comments-on-an-issue discovered that generally have to make multiple requests in order to get the most recent comments because usually there are a sufficiently large number of comments made on many PRs that result in multiple pages of results being read.

Often we want the most recent comments rather than starting from the first, and while https://developer.github.com/v3/guides/traversing-with-pagination/ provides a way to iterate through all the comments, it generally results in having to perform more queries than should be necessary.

The current minimum at the moment would be 2 assuming jumping to the last page with the second query before iterating any earlier pages in between, while supporting providing sorting similar to the querying of issue comments on the repo would reduce this on average as the most frequent occurrence would be within the last page of results

Activity

  1. added
    API
    on Mar 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    APIcommentsissuessorting

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions