From 80a051113673db7b3af90f41e61a60ab71a8de6d Mon Sep 17 00:00:00 2001 From: Bryan Gin-ge Chen Date: Sun, 22 Sep 2024 20:47:48 -0400 Subject: [PATCH 1/5] feat: action for labeling and closing stale PRs --- .github/workflows/stale.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/workflows/stale.yml diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml new file mode 100644 index 0000000000000..78a30ccd2dedc --- /dev/null +++ b/.github/workflows/stale.yml @@ -0,0 +1,21 @@ +name: 'Close stale issues and PRs' +on: + schedule: + - cron: '30 1 * * *' # every day at 01:30 UTC + workflow_dispatch: + +jobs: + stale: + runs-on: ubuntu-latest + steps: + # until https://github.com/actions/stale/pull/1145 is merged + - uses: asterisk/github-actions-stale@main-only-matching-filter + with: + debug-only: 'true' # TODO: remove in follow-up PR after testing is done! + stale-pr-label: 'stale' + stale-pr-message: 'Message to comment on stale PRs.' + close-pr-label: 'closed-due-to-inactivity' + close-pr-message: 'Comment on the staled PRs while closed' + days-before-stale: 60 + days-before-close: 120 + only-matching-filter: '[ "is:open is:pr -is:draft sort:updated-asc -label:blocked-by-other-PR -label:merge-conflict status:success -label:awaiting-CI -label:WIP -label:awaiting-author base:master -label:delegated -label:auto-merge-after-CI -label:ready-to-merge" ]' From 84bcc620ff53be217adce33ac3d550c70b3e8495 Mon Sep 17 00:00:00 2001 From: Bryan Gin-ge Chen Date: Sun, 22 Sep 2024 21:06:47 -0400 Subject: [PATCH 2/5] comment about #queue --- .github/workflows/stale.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 78a30ccd2dedc..9283f1fc4671b 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -18,4 +18,5 @@ jobs: close-pr-message: 'Comment on the staled PRs while closed' days-before-stale: 60 days-before-close: 120 + # search string from the Zulip #queue link at https://bit.ly/3Ymuh0U only-matching-filter: '[ "is:open is:pr -is:draft sort:updated-asc -label:blocked-by-other-PR -label:merge-conflict status:success -label:awaiting-CI -label:WIP -label:awaiting-author base:master -label:delegated -label:auto-merge-after-CI -label:ready-to-merge" ]' From caff0c1fa92f2d54454f9ddc3c814bc378e39406 Mon Sep 17 00:00:00 2001 From: Bryan Gin-ge Chen Date: Mon, 23 Sep 2024 01:19:29 -0400 Subject: [PATCH 3/5] negate #queue query --- .github/workflows/stale.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 9283f1fc4671b..9dc47dca250cf 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -19,4 +19,7 @@ jobs: days-before-stale: 60 days-before-close: 120 # search string from the Zulip #queue link at https://bit.ly/3Ymuh0U - only-matching-filter: '[ "is:open is:pr -is:draft sort:updated-asc -label:blocked-by-other-PR -label:merge-conflict status:success -label:awaiting-CI -label:WIP -label:awaiting-author base:master -label:delegated -label:auto-merge-after-CI -label:ready-to-merge" ]' + # "is:open is:pr -is:draft sort:updated-asc -label:blocked-by-other-PR -label:merge-conflict status:success -label:awaiting-CI -label:WIP -label:awaiting-author base:master -label:delegated -label:auto-merge-after-CI -label:ready-to-merge" + # We want PRs _not_ on the queue, so we keep "is:pr -is:draft base:master" (is:open is added by the action by default) as a prefix for all queries and then negate the rest of the params in separate queries to simulate boolean OR (see https://github.com/actions/stale/pull/1145) + # except for label:auto-merge-after-CI and label:ready-to-merge which presumably will be noticed before they go stale + only-matching-filter: '[ "is:pr -is:draft base:master label:blocked-by-other-PR", "is:pr -is:draft base:master label:merge-conflict", "is:pr -is:draft base:master -status:success", "is:pr -is:draft base:master label:awaiting-CI", "is:pr -is:draft base:master label:WIP", "is:pr -is:draft base:master label:awaiting-author", "is:pr -is:draft base:master label:delegated" ]' From bc2d66ec604b3e21863b748301b8fe2b88def875 Mon Sep 17 00:00:00 2001 From: Bryan Gin-ge Chen Date: Sun, 29 Sep 2024 17:01:11 -0400 Subject: [PATCH 4/5] update queue URL / filters --- .github/workflows/stale.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 9dc47dca250cf..7baf53a669b0d 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -18,8 +18,8 @@ jobs: close-pr-message: 'Comment on the staled PRs while closed' days-before-stale: 60 days-before-close: 120 - # search string from the Zulip #queue link at https://bit.ly/3Ymuh0U - # "is:open is:pr -is:draft sort:updated-asc -label:blocked-by-other-PR -label:merge-conflict status:success -label:awaiting-CI -label:WIP -label:awaiting-author base:master -label:delegated -label:auto-merge-after-CI -label:ready-to-merge" + # search string from the Zulip #queue link at https://bit.ly/3TJI3Yo + # "is:open is:pr -is:draft base:master sort:updated-asc status:success -label:blocked-by-other-PR -label:merge-conflict -label:awaiting-CI -label:WIP -label:awaiting-author -label:delegated -label:auto-merge-after-CI -label:ready-to-merge -label:please-adopt -label:help-wanted" # We want PRs _not_ on the queue, so we keep "is:pr -is:draft base:master" (is:open is added by the action by default) as a prefix for all queries and then negate the rest of the params in separate queries to simulate boolean OR (see https://github.com/actions/stale/pull/1145) # except for label:auto-merge-after-CI and label:ready-to-merge which presumably will be noticed before they go stale - only-matching-filter: '[ "is:pr -is:draft base:master label:blocked-by-other-PR", "is:pr -is:draft base:master label:merge-conflict", "is:pr -is:draft base:master -status:success", "is:pr -is:draft base:master label:awaiting-CI", "is:pr -is:draft base:master label:WIP", "is:pr -is:draft base:master label:awaiting-author", "is:pr -is:draft base:master label:delegated" ]' + only-matching-filter: '[ "is:pr -is:draft base:master -status:success", "is:pr -is:draft base:master label:blocked-by-other-PR", "is:pr -is:draft base:master label:merge-conflict", "is:pr -is:draft base:master label:awaiting-CI", "is:pr -is:draft base:master label:WIP", "is:pr -is:draft base:master label:awaiting-author", "is:pr -is:draft base:master label:delegated", "is:pr -is:draft base:master label:please-adopt", "is:pr -is:draft base:master label:help-wanted" ]' From ad1c63d5017340f529be9783e5c0600e0a84f098 Mon Sep 17 00:00:00 2001 From: Bryan Gin-ge Chen Date: Mon, 30 Sep 2024 04:07:27 -0400 Subject: [PATCH 5/5] update #queue --- .github/workflows/stale.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 7baf53a669b0d..ea5585c38e83e 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -18,8 +18,8 @@ jobs: close-pr-message: 'Comment on the staled PRs while closed' days-before-stale: 60 days-before-close: 120 - # search string from the Zulip #queue link at https://bit.ly/3TJI3Yo - # "is:open is:pr -is:draft base:master sort:updated-asc status:success -label:blocked-by-other-PR -label:merge-conflict -label:awaiting-CI -label:WIP -label:awaiting-author -label:delegated -label:auto-merge-after-CI -label:ready-to-merge -label:please-adopt -label:help-wanted" + # search string from the Zulip #queue link at https://bit.ly/4eo6brN + # "is:open is:pr -is:draft base:master sort:updated-asc status:success -label:blocked-by-other-PR -label:merge-conflict -label:awaiting-CI -label:WIP -label:awaiting-author -label:delegated -label:auto-merge-after-CI -label:ready-to-merge -label:please-adopt -label:help-wanted -label:awaiting-zulip" # We want PRs _not_ on the queue, so we keep "is:pr -is:draft base:master" (is:open is added by the action by default) as a prefix for all queries and then negate the rest of the params in separate queries to simulate boolean OR (see https://github.com/actions/stale/pull/1145) # except for label:auto-merge-after-CI and label:ready-to-merge which presumably will be noticed before they go stale - only-matching-filter: '[ "is:pr -is:draft base:master -status:success", "is:pr -is:draft base:master label:blocked-by-other-PR", "is:pr -is:draft base:master label:merge-conflict", "is:pr -is:draft base:master label:awaiting-CI", "is:pr -is:draft base:master label:WIP", "is:pr -is:draft base:master label:awaiting-author", "is:pr -is:draft base:master label:delegated", "is:pr -is:draft base:master label:please-adopt", "is:pr -is:draft base:master label:help-wanted" ]' + only-matching-filter: '[ "is:pr -is:draft base:master -status:success", "is:pr -is:draft base:master label:blocked-by-other-PR", "is:pr -is:draft base:master label:merge-conflict", "is:pr -is:draft base:master label:awaiting-CI", "is:pr -is:draft base:master label:WIP", "is:pr -is:draft base:master label:awaiting-author", "is:pr -is:draft base:master label:delegated", "is:pr -is:draft base:master label:please-adopt", "is:pr -is:draft base:master label:help-wanted", "is:pr -is:draft base:master label:awaiting-zulip" ]'