Skip to content

Add "recentmerged" sort option for pulls API #34171

Open
@MarkusAmshove

Description

@MarkusAmshove

Feature Description

Currently the /repos/{orga}/{repo}/pulls endpoint supports the following sort options:

  • oldest
  • recentupdate
  • leastupdate
  • mostcomment
  • leastcomment
  • priority

I'm trying to get a list of PRs in the order they've been merged, from most recent to oldest.
Since the repository has a lot of PRs and I only want to collect PRs since a certain date (to generate a changelog), the API is called with pagination and the cancellaction condition for pagination is "any merged_at <= certain date".

The problem with my behavior currently is, that this stops at pulls that have been merged a long time ago but have been updated somehow (e.g. someone wrote a comment).
If I remove the recentupdate sort criteria, then I could miss old PRs that got merged later.

For performance reasons I can't read all PRs from the repository, even with state closed.

To support my use case, it would be great to have a sort type recentmerged, or something similar, which returns all PRs in the opposite order they've been merged (newest to oldest).

If I oversee a combination of options which would mimic this, I'd appreciate a hint to accomplish my use case :-)

Screenshots

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic/apiConcerns mainly the APItype/proposalThe new feature has not been accepted yet but needs to be discussed first.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions