8000 Filter based on issue type · Issue #1187 · actions/stale · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Filter based on issue type #1187

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

Open
Bibo-Joshi opened this issue Nov 3, 2024 · 11 comments · May be fixed by #1255
Open

Filter based on issue type #1187

Bibo-Joshi opened this issue Nov 3, 2024 · 11 comments · May be fixed by #1255
Labels
feature request New feature or request to improve the current logic

Comments

@Bibo-Joshi
Copy link

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 Bibo-Joshi added feature request New feature or request to improve the current logic needs triage labels Nov 3, 2024
@mahabaleshwars
Copy link

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

@JosephTLyons
Copy link
JosephTLyons commented Jan 28, 2025

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

@maxwxyz
Copy link
maxwxyz commented Feb 22, 2025

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

@JosephTLyons
Copy link
JosephTLyons commented Feb 27, 2025

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

JasonStoltz added a commit to elastic/eui that referenced this issue Mar 25, 2025
We're moving away from the `bug` label and `task` label in favor of Github Issue types.

Stale bot does not yet support Issues Types: actions/stale#1187

This would impact the majority of bugs in our backlog. While not immediately, they will get a stale label and ultimately auto-closed within the next couple of months.

Are we OK with that? Should we consider adding some sort of "pinned" label to save these bugs?
@JasonStoltz
Copy link

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

@Mister-Hope
Copy link

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

@andig
Copy link
andig commented Apr 29, 2025

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

@Bibo-Joshi
Copy link
Author

@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 :)

@Tobi-mmt
Copy link

@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
    ExemptIssueLabels = 'exempt-issue-labels',
  3. do something similar to the exeption logik here:
    const exemptLabels: string[] = wordsToList(
    issue.isPullRequest
    ? this.options.exemptPrLabels
    : this.options.exemptIssueLabels
    );
    const hasExemptLabel = exemptLabels.some((exemptLabel: Readonly<string>) =>
    isLabeled(issue, exemptLabel)
    );
    if (hasExemptLabel) {
    issueLogger.info(
    `Skipping this $$type because it contains an exempt label, see ${issueLogger.createOptionLink(
    issue.isPullRequest ? Option.ExemptPrLabels : Option.ExemptIssueLabels
    )} for more details`
    );
    IssuesProcessor._endIssueProcessing(issue);
    return; // Don't process exempt issues
    }
  4. extend the docs like here
    exempt-issue-labels:
  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

    stale/__tests__/main.spec.ts

    Lines 1021 to 1051 in f78de97

    test('exempt issue labels will not be marked stale', async () => {
    expect.assertions(3);
    const opts = {...DefaultProcessorOptions};
    opts.exemptIssueLabels = 'Exempt';
    const TestIssueList: Issue[] = [
    generateIssue(
    opts,
    1,
    'My first issue',
    '2020-01-01T17:00:00Z',
    '2020-01-01T17:00:00Z',
    false,
    false,
    ['Exempt']
    )
    ];
    const processor = new IssuesProcessorMock(
    opts,
    alwaysFalseStateMock,
    async p => (p === 1 ? TestIssueList : []),
    async () => [],
    async () => new Date().toDateString()
    );
    // process our fake issue list
    await processor.processIssues(1);
    expect(processor.staleIssues.length).toStrictEqual(0);
    expect(processor.closedIssues.length).toStrictEqual(0);
    expect(processor.removedLabelIssues.length).toStrictEqual(0);
    });

@suyashgaonkar
Copy link
Contributor

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.

@Bibo-Joshi Bibo-Joshi linked a pull request May 19, 2025 that will close this issue
2 tasks
@Bibo-Joshi
Copy link
Author

I've given it a try in #1255 :)

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

Successfully merging a pull request may close this issue.

9 participants
0