stale icon indicating copy to clipboard operation
stale copied to clipboard

Filter based on issue type

Open Bibo-Joshi opened this issue 1 year ago • 4 comments

Description: Introduce a parameter only-issue-types that ensures that only issues of a specific type are set to stale and closed.

Justification: With the introduction of types, GitHub as given organizations a new issue attribute that can be used for categorization/classification of issues. For different issue types it would be desirable to have different stale settings just like we currently can have for labels. E.g. in my organization, we'll be using the new issue type for separating questions from feature requests. Questions should go stale faster.

Are you willing to submit a PR? I'm open to try so, but will need some pointers, especially on testing. I'm not familia with TypeScript (or very familiar with JS at all …)

Bibo-Joshi avatar Nov 03 '24 20:11 Bibo-Joshi

Hello @Bibo-Joshi, Thank you for creating this issue. We will investigate it and provide feedback as soon as we have some updates.

mahabaleshwars avatar Nov 04 '24 06:11 mahabaleshwars

We are switching over to issue types as well over in zed.dev's issue tracker - would love to have this configuration option.

JosephTLyons avatar Jan 28 '25 06:01 JosephTLyons

This is very much needed, otherwise we have duplicates for labels and types now.

maxwxyz avatar Feb 22 '25 07:02 maxwxyz

One thing to note is that GitHub's REST API doesn't even support filtering by type, as far as I can tell. So until that lands, getting that feature in the stale action is totally blocked.

https://github.com/orgs/community/discussions/140874#discussioncomment-11582660

JosephTLyons avatar Feb 27 '25 14:02 JosephTLyons

Looks like they've added Issue Type to the Reset API.

JasonStoltz avatar Mar 28 '25 17:03 JasonStoltz

Any progress with this one? I think there are no blocking things with it.

Mister-Hope avatar Apr 09 '25 05:04 Mister-Hope

Stale bot is currently unusable without support for issue types...

andig avatar Apr 29 '25 10:04 andig

@mahabaleshwars I'd still be open to giving this a shot if you could provide me with a few pointers on how to get started :)

Bibo-Joshi avatar Apr 30 '25 14:04 Bibo-Joshi

@Bibo-Joshi Since it is pretty much the same as the exempt-issue-labels option right now, I guess its something like:

  1. check out the repo and read the https://github.com/actions/stale/blob/main/CONTRIBUTING.md
  2. extend the options enum like here https://github.com/actions/stale/blob/f78de9780efb7a789cf4745957fa3374cbb94fd5/src/enums/option.ts#L15
  3. do something similar to the exeption logik here: https://github.com/actions/stale/blob/f78de9780efb7a789cf4745957fa3374cbb94fd5/src/classes/issues-processor.ts#L351-L369
  4. extend the docs like here https://github.com/actions/stale/blob/f78de9780efb7a789cf4745957fa3374cbb94fd5/action.yml#L48
  5. search the whole repo for exempt-issue-labels and ExemptIssueLabels to find all occurence where you have to
  6. add a test like here https://github.com/actions/stale/blob/f78de9780efb7a789cf4745957fa3374cbb94fd5/tests/main.spec.ts#L1021-L1051

Tobi-mmt avatar May 13 '25 10:05 Tobi-mmt

Hi @Bibo-Joshi , Thank you for bringing this up. The recent update to the REST API has introduced Issue Type as parameter for filtering the issue, you can check the following thread and link for more information. We will look into its implementation in future updates.

suyashgaonkar avatar May 14 '25 09:05 suyashgaonkar

I've given it a try in https://github.com/actions/stale/pull/1255 :)

Bibo-Joshi avatar May 19 '25 19:05 Bibo-Joshi