diff --git a/doc/source/drivers/github.rst b/doc/source/drivers/github.rst index 8ebd9459be..b7a331882e 100644 --- a/doc/source/drivers/github.rst +++ b/doc/source/drivers/github.rst @@ -412,8 +412,8 @@ the following options. This is only used for ``pull_request_review`` events. It accepts a list of strings each of which is matched to the review - state, which can be one of ``approved``, ``comment``, or - ``request_changes``. + state, which can be one of ``approved``, ``comment``, + ``changes_requested``, ``dismissed``, or ``pending``. .. attr:: status diff --git a/zuul/driver/github/githubtrigger.py b/zuul/driver/github/githubtrigger.py index e115691d3c..12fa5c7f27 100644 --- a/zuul/driver/github/githubtrigger.py +++ b/zuul/driver/github/githubtrigger.py @@ -181,6 +181,17 @@ def getNewSchema(): 'branch': scalar_or_list(vs.Any(ZUUL_REGEX, str)), }) + # The docs for this are at: + # https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=dismissed#pull_request_review + # They specify "dismissed, approved, changes_requested" + # But we have also experimentally seen "commented" + # The graphql docs are at: + # https://docs.github.com/en/enterprise-server@3.12/graphql/reference/enums#pullrequestreviewstate + # And they additionally specify "commented" and "pending". + # It's unclear whether "pending" can show up in the webhook (it + # may only appear in a graphql query of a user's own unsaved + # reviews) but since we've seen the extra "commented" value, let's + # be generous and accept "pending" as well. pull_request_review_schema = pull_request_review_base_schema.extend({ 'action': scalar_or_list(vs.Any('submitted', 'dismissed')), 'state': scalar_or_list(vs.Any(