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

Stale issues are not getting closed #1135

Open
2 of 5 tasks
ForNeVeR opened this issue Feb 10, 2024 · 9 comments
Open
2 of 5 tasks

Stale issues are not getting closed #1135

ForNeVeR opened this issue Feb 10, 2024 · 9 comments
Assignees
Labels
bug Something isn't working

Comments

@ForNeVeR
Copy link

ForNeVeR commented Feb 10, 2024

Description:
Bot is unable to close several issues that, I believe, it should actually close. This may be a problem similar to #1007, though that one is closed as not reproducing in v8, and I am on v9 already and it still happens.

Action version:
I use stale@v9.

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted

Repro steps:
In my repository, I use the stale bot with the following configuration:

jobs:
  stale:
    runs-on: ubuntu-22.04
    steps:
      - uses: actions/stale@v9
        with:
          days-before-stale: -1
          stale-issue-label: 'status:waiting-for-info'
          remove-stale-when-updated: 'false'
          days-before-close: 14
          close-issue-message: 'blah blah blah'

So, I want it to take the issues with a manually-assigned label status:waiting-for-info, and close them if there were no updates in 14 days.

It was working well for some of the issues, but I now see several issues it is unable to close.

Let's consider this particular issue: ForNeVeR/AvaloniaRider#303

Expected behavior:
It has been last changed at 2023-12-19, and today's 2024-02-10, more than 14 days have definitely passed. So I expect the bot to close the issue.

Actual behavior:
Actually, bot refuses to do anything about this issue. Here's a relevant log from the last execution, happened today:

[#303] Issue #303
  [#303] Found this issue last updated at: 2023-12-19T21:29:57Z
  [#303] The option only-labels (​[https://github.com/actions/stale#only-labels​)](https://github.com/actions/stale#only-labels%E2%80%8B)) was not specified
  [#303] └── Continuing the process for this issue
  [#303] Days before issue stale: -1
  [#303] The issue is not closed nor locked. Trying to remove the close label...
  [#303] ├── The close-issue-label (​[https://github.com/actions/stale#close-issue-label​)](https://github.com/actions/stale#close-issue-label%E2%80%8B)) option was not set
  [#303] └── Skipping the removal of the close label
  [#303] This issue includes a stale label
  [#303] The option any-of-labels (​[https://github.com/actions/stale#any-of-labels​)](https://github.com/actions/stale#any-of-labels%E2%80%8B)) was not specified
  [#303] └── Continuing the process for this issue
  [#303] This issue has no milestone
  [#303] └── Skip the milestones checks
  [#303] The option exempt-all-assignees (​[https://github.com/actions/stale#exempt-all-assignees​)](https://github.com/actions/stale#exempt-all-assignees%E2%80%8B)) is disabled. Only some specific assignees on this issue will skip the stale process
  [#303] ├── The option exempt-issue-assignees (​[https://github.com/actions/stale#exempt-issue-assignees​)](https://github.com/actions/stale#exempt-issue-assignees%E2%80%8B)) is disabled. No specific assignee can skip the stale process for this issue
  [#303] ├── The option exempt-assignees (​[https://github.com/actions/stale#exempt-assignees​)](https://github.com/actions/stale#exempt-assignees%E2%80%8B)) is disabled. No specific assignee can skip the stale process for this issue
  [#303] ├── No assignee option was specified to skip the stale process for this issue
  [#303] └── Skip the assignees checks
  [#303] This issue is already stale
  [#303] Checking for label on this issue
  [#303] Issue marked stale on: 2023-12-19T21:29:35Z
  [#303] Checking for comments on issue since: 2023-12-19T21:29:35Z
  [#303] Comments that are not the stale comment or another bot: 1
  [#303] Issue has been commented on: true
  [#303] Days before issue close: 14
  [#303] The option remove-stale-when-updated (​[https://github.com/actions/stale#remove-stale-when-updated​)](https://github.com/actions/stale#remove-stale-when-updated%E2%80%8B)) is: false
  [#303] The stale label should be removed if all conditions met
  [#303] Issue has been updated since it was marked stale: true
  [#303] Issue has been updated in the last 14 days: false
  [#303] Stale issue is not old enough to close yet (hasComments? true, hasUpdate? false)
  [#303] 2 operations consumed for this issue

From the message Stale issue is not old enough to close yet (hasComments? true, hasUpdate? false), I conclude it doesn't like something that's been happening in the issue comments. But there weren't any new comments after the issue has been marked as stale for the last time. It has been marked as stale and not stale several times during its lifetime, though, so perhaps something about that messes up the bot logic?

@ForNeVeR ForNeVeR added bug Something isn't working needs triage labels Feb 10, 2024
@HarithaVattikuti
Copy link
Contributor

Hello @ForNeVeR
Thank you for creating this issue. We will investigate it and get back to you as soon as we have some feedback.

@rcomer
Copy link

rcomer commented Feb 19, 2024

I don’t know about the log messages but I think when you (un)assign someone that counts as an update.

@ForNeVeR
Copy link
Author

I think when you (un)assign someone that counts as an update.

This behavior would be absolutely ok for me. However, I changed the assignee list last time at 19th of Dec, and the issue is still not closed, despite the bot being configured to close the issue in 14 days after the last update.

@ForNeVeR
Copy link
Author

I have figured it out, though I don't know what to do with that knowledge now.

So, the reason is that the bot won't close an issue if there were any comments after the issue was marked as "stale".

In my case, the actual use case goes like that:

  • I mark the issue as "waiting for info from the user", thus starting a 14-day timer after that, if they provide no info, I want it to be auto-closed.

  • The user provides some info.

  • I analyze it: if the info is enough then I remove the "stale" label and proceed with investigation.

  • If the info is not enough, I ask for clarifications and do not remove the label.

    My idea is that the stale label is in place, thus the timer is now ticking again.

    But in reality it seems I should set up the bot to remove the label on any comments and reapply it manually.

I no longer believe this is a bug, but I'd like to leave this as a feature request: I want an option to not consider such comments as preventing the issue from being closed. I'd like the bot to treat them just as normal updates: delaying the close, but not totally preventing it.

@ForNeVeR
Copy link
Author

(Notably, in this case there are really no comments, but I've changed the issue assignee, and that seems to be considered as a comment as well.)

@hawkeye116477
Copy link

hawkeye116477 commented Sep 23, 2024

So, the reason is that the bot won't close an issue if there were any comments after the issue was marked as "stale".

That's not the reason for everyone. I saw even no comments after bot marked as stale and still inactivity time passed and stale action not closed issues, but interesting is that all not closed are from February, but bot closes issues from other months (start-date isn't configured, so it's not that) 😄.

@suyashgaonkar suyashgaonkar self-assigned this Oct 21, 2024
@suyashgaonkar
Copy link

Hello @ForNeVeR , We tried the provided workflow and investigated the issue, we are not seeing issues as it is able to put lables to issues and close them too. One thing we could recommend is not set a negative number like -1 for days-before-stale parameter, as a result no issues or pull requests will be marked as stale automatically.
You can refer to following link :- days-before-stale

@suyashgaonkar
Copy link

Hi @ForNeVeR , We are awaiting for your response, you can let us know if you have any queriers or the issue still exists.

@ForNeVeR
Copy link
Author

ForNeVeR commented Nov 13, 2024

Ugh, I'm sorry, I am not sure it's easy to check if it works correctly :(

I have applied a patch to my fork and my workflow seems to work with this patch, but obviously this solution is far from perfect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants