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

Auto close issues which bump another issue #9

Open
vetleledaal opened this issue Feb 3, 2024 · 0 comments
Open

Auto close issues which bump another issue #9

vetleledaal opened this issue Feb 3, 2024 · 0 comments

Comments

@vetleledaal
Copy link

vetleledaal commented Feb 3, 2024

Similar to the duplicate-url-check, it should be possible to look for the pattern:

  • Issue opened
  • A recent issue was closed
    • Issue is by the same author
    • The author closed the issue
    • Issue is a duplicate, based on same URL

If these conditions are met:

  • Close issue
  • Reopen old issue

Most relevant change would probably be this line. It should have some additional conditions (pseudo code):

const recentDate = new Date(currentDate.getTime() - (4 * 60 * 60 * 1000)); // 4 hours
const recentDateISO = recentDate.toISOString();

const qualifiers = `type:issue repo:${repo.owner}/${repo.repo} state:closed author:${issue.user.login} closed:>${recentDateISO} label:"${labelsToCheck.join('","')}"`;

Did not find a way to search for 'closed by', but it seems like issue.closed_by.login should be comparable once you actually fetch the details of the issue. Not sure if this condition is ultimately required.

Test case:
keiyoushi/extensions-source#485
keiyoushi/extensions-source#707

keiyoushi/extensions-source#3315
keiyoushi/extensions-source#3461

@vetleledaal vetleledaal changed the title Auto close issues which bump a source request Auto close issues which bump another issue Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant