actions / stale

Marks issues and pull requests that have not had recent interaction
MIT License
1.34k stars 353 forks source link

Stale issues are not getting closed #1135

Open ForNeVeR opened 7 months ago

ForNeVeR commented 7 months ago

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:

Runner type:

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: https://github.com/ForNeVeR/AvaloniaRider/issues/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?

HarithaVattikuti commented 6 months ago

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 commented 6 months ago

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

ForNeVeR commented 6 months ago

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 commented 6 months ago

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 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 commented 6 months ago

(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.)