diff --git a/doc/source/examples/pipelines/github-reference-pipelines.yaml b/doc/source/examples/pipelines/github-reference-pipelines.yaml index cf54377ce8..ee97c8c868 100644 --- a/doc/source/examples/pipelines/github-reference-pipelines.yaml +++ b/doc/source/examples/pipelines/github-reference-pipelines.yaml @@ -19,6 +19,8 @@ # When using the checks API to report results, failed runs # will have a "re-run" button which emits this event. - event: check_run + action: rerequested + check: .*/check:.* start: github: check: 'in_progress' diff --git a/releasenotes/notes/requested-c7f561f338348f9e.yaml b/releasenotes/notes/requested-c7f561f338348f9e.yaml new file mode 100644 index 0000000000..eb56eadea7 --- /dev/null +++ b/releasenotes/notes/requested-c7f561f338348f9e.yaml @@ -0,0 +1,8 @@ +--- +deprecations: + - | + Zuul now correctly handles the ``rerequested`` action on check run trigger + definitions (:value:`pipeline.trigger..event.check_run`) + literally. This has been ``requested`` which doesn't match the GitHub api. + The value ``requested`` is now deprecated and will be removed in a later + release. diff --git a/zuul/driver/github/githubconnection.py b/zuul/driver/github/githubconnection.py index 5b5b8670d7..de9880d149 100644 --- a/zuul/driver/github/githubconnection.py +++ b/zuul/driver/github/githubconnection.py @@ -575,9 +575,6 @@ class GithubEventProcessor(object): event = self._pull_request_to_event(pr_body) event.type = "check_run" - # Simplify rerequested action to requested - if action == "rerequested": - action = "requested" event.action = action check_run_tuple = "%s:%s:%s" % _check_as_tuple(check_run) diff --git a/zuul/driver/github/githubtrigger.py b/zuul/driver/github/githubtrigger.py index 9f1a3e8b21..76d8f574e7 100644 --- a/zuul/driver/github/githubtrigger.py +++ b/zuul/driver/github/githubtrigger.py @@ -23,6 +23,17 @@ class GithubTrigger(BaseTrigger): name = 'github' log = logging.getLogger("zuul.trigger.GithubTrigger") + def __init__(self, driver, connection, config=None): + + # This is a compatibility layer to map the action 'requested' back + # to the original action 'rerequested'. + # TODO: Remove after zuul 5.0 + for item in config: + if item.get('action') == 'requested': + item['action'] = 'rerequested' + + super().__init__(driver, connection, config=config) + def getEventFilters(self, connection_name, trigger_config): efilters = [] for trigger in to_list(trigger_config):