Add an option to sort PRs by "least recently updated"
Closed this issue · 6 comments
Description:
It would be good to add another sorting option like ascending
that could sort the PRs by "least recently updated". Even if a PR is very old, it may have been recently updated by the author. I would much rather process a newer PR that was last updated years ago than an older PR that had a very recent update.
GitHub already offers this sorting option in the PR interface ("Sort" --> "Least recently updated", also known as "sort:updated-asc").
Here is an example of how the stale bot's ascending
option currently sorts PRs, using GitHub's "Sort" --> "Oldest" filter:
https://github.com/ceph/ceph/pulls?q=is%3Apr+is%3Aopen+sort%3Acreated-asc
And here is an example of how a hypothetical least-recently-updated
sorting option would work in the stale bot, using GitHub's "Sort" --> "Least recently updated" filter:
https://github.com/ceph/ceph/pulls?q=is%3Apr+is%3Aopen+sort%3Aupdated-asc
Justification:
Adding this sorting option would make the stale bot a lot more efficient in certain use cases. For instance, the Ceph repository (https://github.com/ceph/ceph/pulls) has nearly 800 PRs open right now. Even though the stale bot is set to 100 operations-per-run
, the bot only processes up to 200 PRs at a time. There are some PRs that haven't been updated for many years in the Ceph repository, but since they are not the oldest PRs, the bot doesn't process them right away. We care about closing "least recently updated PRs" first, regardless of the PR's age.
Are you willing to submit a PR?
I would open a PR, but I'm not sure where to start or if this is possible. If someone has guidance on whether this option is possible and/or where to edit the code base, I can take a stab at it.
Hello, @ljflores ! Thank you for creating the issue - we will investigate it and see what can be done :)
Hello, @ljflores
The action already has ascending input that seems to implement the requested functionality.
The main branch also includes the PR #1033 that introduces the "continuation" of the job from the point where it was left by the previous job.
You can take advantage of it right now:
steps:
- uses: actions/stale@main
Does it solve the problem?
Hello, @ljflores
The action already has ascending input that seems to implement the requested functionality.
The main branch also includes the PR #1033 that introduces the "continuation" of the job from the point where it was left by the previous job.
You can take advantage of it right now:
steps: - uses: actions/stale@main
Does it solve the problem?
Hey @dsame, the ascending
option is already in use in our repository, but due to the size of the repository, there are still many PRs missed. However, the continuation
option seems like it will solve the issue. I will try it out.
Do you know when it will reach a stable version?
Hello @ljflores!
We are conducting additional testing on the main branch. We will release a new version of the action as soon as we finish testing. Thank you for your patience!
We would appreciate if you could provide us with your feedback on the continuation
option.
Thanks @MaksimZhukov, sure!
I am okay with this issue being closed.