From 8a543d8b50ddc987979c4b7e7a7defd44f691e92 Mon Sep 17 00:00:00 2001 From: Joey Perrott Date: Mon, 27 Jul 2020 17:10:23 -0700 Subject: [PATCH] ci: only check active groups for the `no-groups-above-this-*` checks (#38259) Since PullApprove starts all inactive groups as a pending state, to properly assess if any groups we care about are pending we must only check the active groups. We additionally do this with rejected because the intention of the reusable checks is around checking active rules only. PR Close #38259 --- .pullapprove.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.pullapprove.yml b/.pullapprove.yml index 15dfd30242..2e537542e5 100644 --- a/.pullapprove.yml +++ b/.pullapprove.yml @@ -75,12 +75,14 @@ meta: # By checking the number of active/pending/rejected groups when these are excluded, we can determine # if any other groups are matched. # + # Note: Because all inactive groups start as pending, we are only checking pending and rejected active groups. + # # Also note that the ordering of groups matters in this file. The only groups visible to the current # one are those that appear above it. no-groups-above-this-pending: &no-groups-above-this-pending - len(groups.pending.exclude("required-minimum-review").exclude("global-approvers").exclude("global-docs-approvers")) == 0 + len(groups.active.pending.exclude("required-minimum-review").exclude("global-approvers").exclude("global-docs-approvers")) == 0 no-groups-above-this-rejected: &no-groups-above-this-rejected - len(groups.rejected.exclude("required-minimum-review").exclude("global-approvers").exclude("global-docs-approvers")) == 0 + len(groups.active.rejected.exclude("required-minimum-review").exclude("global-approvers").exclude("global-docs-approvers")) == 0 no-groups-above-this-active: &no-groups-above-this-active len(groups.active.exclude("required-minimum-review").exclude("global-approvers").exclude("global-docs-approvers")) == 0