stale icon indicating copy to clipboard operation
stale copied to clipboard

Only-label shoud act as a filter

Open ov7a opened this issue 1 year ago • 7 comments

Description/Justification: I'm running a stale action with "only-labels" setting. I expect it to act as a filter, so only issues/prs labeled with particular labels are considered during the run.

However, the current behavior is to do a full-scan. It drains the operation limit very fast.

ov7a avatar Jul 05 '23 07:07 ov7a

Hello, @ov7a ! Thanks for creating the issue! We'll do some investigation and see what seems to be the problem :)

dusan-trickovic avatar Jul 05 '23 09:07 dusan-trickovic

Hello @ov7a , unfortunately it is not possible to filter out issues by label, but the problem of running out API rate limit is expected to be solved with https://github.com/actions/stale/pull/1033 which is accessible now from main branch:

      - uses: actions/stale@main

Did it help?

dsame avatar Aug 09 '23 17:08 dsame

@dsame Thank you for the reply. Could you please provide more details on why it's not possible?

The statefulness is a great feature! However, I think it’s only a partial solution to the problem. Consider a case when a repository has 2000+ open issues, but only 100 of them have some label. Full scan is 20x times slower. It also wastes a lot resources.

ov7a avatar Aug 09 '23 17:08 ov7a

Hello @ov7a, to know the labels of the issue, it has to be fetched first. This is the limitation of GitHub REST API used by stale action. The migration to GraphQL is not planned at the moment.

The fetching bunch of issue is just one GitHub API call, so it does not affect reaching limit of API rate greatly.

dsame avatar Aug 10 '23 08:08 dsame

@dsame can you also take a look at https://github.com/actions/stale/issues/837 ? it has some similarities

kurtqq avatar Aug 29 '23 03:08 kurtqq

Hello @ov7a, to know the labels of the issue, it has to be fetched first. This is the limitation of GitHub REST API used by stale action.

I don't think this is true. API has labels parameter to filter out issues based on the list of labels.

mraleph avatar Aug 30 '23 08:08 mraleph

I made a PR: https://github.com/actions/stale/pull/1084

mraleph avatar Aug 30 '23 10:08 mraleph