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

Add an option to sort PRs by "least recently updated" #1039

Closed
ljflores opened this issue Jun 27, 2023 · 6 comments
Closed

Add an option to sort PRs by "least recently updated" #1039

ljflores opened this issue Jun 27, 2023 · 6 comments
Assignees
Labels
feature request New feature or request to improve the current logic

Comments

@ljflores
Copy link

ljflores commented Jun 27, 2023

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.

@ljflores ljflores added feature request New feature or request to improve the current logic needs triage labels Jun 27, 2023
@dusan-trickovic
Copy link
Contributor

Hello, @ljflores ! Thank you for creating the issue - we will investigate it and see what can be done :)

@dsame dsame self-assigned this Jul 25, 2023
@dsame
Copy link
Contributor

dsame commented Jul 25, 2023

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?

@ljflores
Copy link
Author

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?

@MaksimZhukov
Copy link
Contributor

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.

@ljflores
Copy link
Author

ljflores commented Aug 7, 2023

Thanks @MaksimZhukov, sure!

I am okay with this issue being closed.

@dsame
Copy link
Contributor

dsame commented Aug 14, 2023

Thank you @ljflores , i am closing the issue according to your answer

@dsame dsame closed this as completed Aug 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request to improve the current logic
Projects
None yet
Development

No branches or pull requests

4 participants