From b1138c28fb940b49f52bb627c37b891adaab2fd8 Mon Sep 17 00:00:00 2001 From: Jimmy Chen Date: Thu, 15 May 2025 15:54:24 +1000 Subject: [PATCH 1/8] Add additional mergify rules to automate triaging (#7451) * Add additional mergify rules to automate triaging. * Update mergify config. --- .github/mergify.yml | 52 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/.github/mergify.yml b/.github/mergify.yml index 73267904b88..a314ec3e983 100644 --- a/.github/mergify.yml +++ b/.github/mergify.yml @@ -12,6 +12,58 @@ pull_request_rules: comment: message: This pull request has merge conflicts. Could you please resolve them @{{author}}? 🙏 + label: + add: + - waiting-on-author + remove: + - ready-for-review + + - name: Ask to resolve CI failures + conditions: + - or: + - check-failure=test-suite-success + - check-skipped=test-suite-success + - check-failure=local-testnet-success + - check-skipped=local-testnet-success + actions: + comment: + message: Some required checks have failed. Could you please take a look @{{author}}? 🙏 + label: + add: + - waiting-on-author + remove: + - ready-for-review + + - name: Update labels when PR is unblocked + conditions: + - label=waiting-on-author + - -conflict + - check-failure!=test-suite-success + - check-failure!=local-testnet-success + - "#review-requested > 0" + actions: + label: + remove: + - waiting-on-author + add: + - ready-for-review + comment: + message: > + All required checks have passed and there are no merge conflicts. + This pull request may now be ready for another review. + + - name: Close stale pull request after 30 days of inactivity + conditions: + - label=waiting-on-author + - updated-at<=30 days ago + actions: + close: + message: > + Hi @{{author}}, this pull request has been closed automatically due to 30 days of inactivity. + If you’d like to continue working on it, feel free to reopen at any time. + label: + add: + - stale - name: Approve trivial maintainer PRs conditions: From cc6ae9d3f09c412a97e887a87a00a9877282f294 Mon Sep 17 00:00:00 2001 From: Jimmy Chen Date: Thu, 15 May 2025 16:54:56 +1000 Subject: [PATCH 2/8] Fix mergify infinite loop. (#7463) * Fix mergify infinite loop. * Update rule for `ready-for-review` label. * More fix to prevent infinite loop --- .github/mergify.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/mergify.yml b/.github/mergify.yml index a314ec3e983..718c8ba3fe4 100644 --- a/.github/mergify.yml +++ b/.github/mergify.yml @@ -1,6 +1,7 @@ pull_request_rules: - name: Ask to resolve conflict conditions: + - -closed - conflict - -author=dependabot[bot] - or: @@ -20,6 +21,7 @@ pull_request_rules: - name: Ask to resolve CI failures conditions: + - -closed - or: - check-failure=test-suite-success - check-skipped=test-suite-success @@ -36,10 +38,15 @@ pull_request_rules: - name: Update labels when PR is unblocked conditions: + - -closed + - -draft - label=waiting-on-author - -conflict + # Need to be the logical opposite of the above rule `Ask to resolve CI failures`, otherwise mergify will run into an infinite loop. - check-failure!=test-suite-success + - check-skipped!=test-suite-success - check-failure!=local-testnet-success + - check-skipped!=local-testnet-success - "#review-requested > 0" actions: label: @@ -54,6 +61,7 @@ pull_request_rules: - name: Close stale pull request after 30 days of inactivity conditions: + - -closed - label=waiting-on-author - updated-at<=30 days ago actions: From e0ee148d6acac639d2b847f86018ae1d482837ab Mon Sep 17 00:00:00 2001 From: Jimmy Chen Date: Fri, 16 May 2025 11:46:21 +1000 Subject: [PATCH 3/8] Prevent mergify from updating labels while CI is still running. (#7470) --- .github/mergify.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/mergify.yml b/.github/mergify.yml index 718c8ba3fe4..7b8a138f57f 100644 --- a/.github/mergify.yml +++ b/.github/mergify.yml @@ -23,10 +23,10 @@ pull_request_rules: conditions: - -closed - or: - - check-failure=test-suite-success - check-skipped=test-suite-success - - check-failure=local-testnet-success - check-skipped=local-testnet-success + - check-failure=test-suite-success + - check-failure=local-testnet-success actions: comment: message: Some required checks have failed. Could you please take a look @{{author}}? 🙏 @@ -42,11 +42,10 @@ pull_request_rules: - -draft - label=waiting-on-author - -conflict - # Need to be the logical opposite of the above rule `Ask to resolve CI failures`, otherwise mergify will run into an infinite loop. - - check-failure!=test-suite-success - - check-skipped!=test-suite-success - - check-failure!=local-testnet-success - - check-skipped!=local-testnet-success + # Unfortunately, it doesn't look like there's an easy way to check for PRs pending + # CI workflows approvals. + - check-success=local-testnet-success + - check-success=local-testnet-success - "#review-requested > 0" actions: label: From e21198c08baaa796ad0fa57b589be7632116c1af Mon Sep 17 00:00:00 2001 From: Jimmy Chen Date: Fri, 16 May 2025 13:55:06 +1000 Subject: [PATCH 4/8] One more attempt to fix mergify condition. (#7472) --- .github/mergify.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/mergify.yml b/.github/mergify.yml index 7b8a138f57f..48d76219e3d 100644 --- a/.github/mergify.yml +++ b/.github/mergify.yml @@ -44,7 +44,7 @@ pull_request_rules: - -conflict # Unfortunately, it doesn't look like there's an easy way to check for PRs pending # CI workflows approvals. - - check-success=local-testnet-success + - check-success=test-suite-success - check-success=local-testnet-success - "#review-requested > 0" actions: From 7759cb8f91c01a7d335469d317b5787368656064 Mon Sep 17 00:00:00 2001 From: Jimmy Chen Date: Wed, 21 May 2025 18:18:48 +1000 Subject: [PATCH 5/8] Update mergify rule to not evaluate PRs that are not ready for review - to reduce noise and avoid updating stale PRs. (#7494) --- .github/mergify.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/mergify.yml b/.github/mergify.yml index 48d76219e3d..f4d15208261 100644 --- a/.github/mergify.yml +++ b/.github/mergify.yml @@ -4,6 +4,7 @@ pull_request_rules: - -closed - conflict - -author=dependabot[bot] + - label=ready-for-review - or: - -draft # Don't report conflicts on regular draft. - and: # Do report conflicts on draft that are scheduled for the next major release. @@ -22,6 +23,7 @@ pull_request_rules: - name: Ask to resolve CI failures conditions: - -closed + - label=ready-for-review - or: - check-skipped=test-suite-success - check-skipped=local-testnet-success From 8dde5bdb4413f5f1faf3203bf405a563f5449600 Mon Sep 17 00:00:00 2001 From: Jimmy Chen Date: Tue, 27 May 2025 23:03:22 +1000 Subject: [PATCH 6/8] Update mergify rules so that I can add `waiting-on-author` on a PR that's passing CI. Remove noisy comments. --- .github/mergify.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/mergify.yml b/.github/mergify.yml index f4d15208261..a84b51b32eb 100644 --- a/.github/mergify.yml +++ b/.github/mergify.yml @@ -48,17 +48,17 @@ pull_request_rules: # CI workflows approvals. - check-success=test-suite-success - check-success=local-testnet-success - - "#review-requested > 0" + # Update the label only if there are no more change requests from any reviewers and no unresolved threads. + # This rule ensures that a PR with passing CI can be marked as `waiting-on-author`. + - or: + - "#changes-requested-reviews-by = 0" + - "#review-threads-unresolved = 0" actions: label: remove: - waiting-on-author add: - ready-for-review - comment: - message: > - All required checks have passed and there are no merge conflicts. - This pull request may now be ready for another review. - name: Close stale pull request after 30 days of inactivity conditions: From b7fc03437bbab2fe6455c0065d2fbc0467b437d1 Mon Sep 17 00:00:00 2001 From: Jimmy Chen Date: Wed, 28 May 2025 10:55:14 +1000 Subject: [PATCH 7/8] Fix condition --- .github/mergify.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/mergify.yml b/.github/mergify.yml index a84b51b32eb..6caf2c4bf0d 100644 --- a/.github/mergify.yml +++ b/.github/mergify.yml @@ -50,7 +50,7 @@ pull_request_rules: - check-success=local-testnet-success # Update the label only if there are no more change requests from any reviewers and no unresolved threads. # This rule ensures that a PR with passing CI can be marked as `waiting-on-author`. - - or: + - and: - "#changes-requested-reviews-by = 0" - "#review-threads-unresolved = 0" actions: From 9e9c51be6fef85c4995f032294025b3c55133d6c Mon Sep 17 00:00:00 2001 From: Jimmy Chen Date: Wed, 28 May 2025 10:59:17 +1000 Subject: [PATCH 8/8] Remove redundant `and` --- .github/mergify.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/mergify.yml b/.github/mergify.yml index 6caf2c4bf0d..4ab73bcf079 100644 --- a/.github/mergify.yml +++ b/.github/mergify.yml @@ -50,9 +50,8 @@ pull_request_rules: - check-success=local-testnet-success # Update the label only if there are no more change requests from any reviewers and no unresolved threads. # This rule ensures that a PR with passing CI can be marked as `waiting-on-author`. - - and: - - "#changes-requested-reviews-by = 0" - - "#review-threads-unresolved = 0" + - "#changes-requested-reviews-by = 0" + - "#review-threads-unresolved = 0" actions: label: remove: