From 8fc08c5ab120728d3522dc0239692ae77d721c74 Mon Sep 17 00:00:00 2001 From: Joey Perrott Date: Thu, 22 Jul 2021 09:28:08 -0700 Subject: [PATCH] ci: update pullapprove config to properly handle global approvals (#42929) Update the config to properly identify a global approval as approved rather than as no file matching based groups being matched. PR Close #42929 --- .pullapprove.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.pullapprove.yml b/.pullapprove.yml index 870eb067a8..e49c09546b 100644 --- a/.pullapprove.yml +++ b/.pullapprove.yml @@ -80,10 +80,6 @@ meta: no-groups-above-this-pending: &no-groups-above-this-pending 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.active.rejected.exclude("required-minimum-review").exclude("global-approvers").exclude("global-docs-approvers")) == 0 - # Yaml anchor that represents a PullApprove expression that evaluates to `true` whenever - # there are no actual review groups active. Groups which are always active are excluded. - no-review-groups-active: &no-review-groups-active len(groups.active.exclude("required-minimum-review").exclude("global-approvers").exclude("global-docs-approvers")) == 0 - can-be-global-approved: &can-be-global-approved '"global-approvers" not in groups.approved' can-be-global-docs-approved: &can-be-global-docs-approved '"global-docs-approvers" not in groups.approved' defaults: &defaults @@ -112,9 +108,9 @@ overrides: - if: "'PullApprove: disable' in labels" status: success explanation: "PullApprove skipped because of 'PullApprove: disable' label" - # If no groups are active, report this pull request as failing. Most likely, the - # PR author would need to update the PullApprove config, or create new group. - - if: *no-review-groups-active + # If no file matching based groups are active, report this pull request as failing. Most likely, + # the PR author would need to update the PullApprove config, or create new group. + - if: len(groups.active.exclude("required-minimum-review").exclude("global-*")) == 0 and len(groups.approved.include("global-*")) == 0 status: failure explanation: 'At least one group must match this PR. Please update an existing review group, or create a new group.'