diff options
author | Zuul <zuul@review.opendev.org> | 2020-05-12 21:15:45 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2020-05-12 21:15:45 +0000 |
commit | 438871db678864f2ee29767be34192120aa65d58 (patch) | |
tree | bfa1771ced2dc53bf36c0a032c2c6f05c9f2385b /zuul | |
parent | 087ab1d587cfae85a8db72463e838e00d970f0b3 (diff) | |
parent | 07cf1e1a6e11181b1abebc35067a9aa20bef4e47 (diff) | |
download | zuul-438871db678864f2ee29767be34192120aa65d58.tar.gz |
Merge "Allow check runs to be configured as required status in pipeline config"
Diffstat (limited to 'zuul')
-rw-r--r-- | zuul/driver/github/githubconnection.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/zuul/driver/github/githubconnection.py b/zuul/driver/github/githubconnection.py index 19497008d..a054d9e49 100644 --- a/zuul/driver/github/githubconnection.py +++ b/zuul/driver/github/githubconnection.py @@ -2085,6 +2085,17 @@ class GithubConnection(BaseConnection): statuses.append("%s:%s:%s" % stuple) seen.append("%s:%s" % (stuple[0], stuple[1])) + # Although Github differentiates commit statuses and commit checks via + # their respective APIs, the branch protection the status section + # (below the comments of a PR) do not differentiate between both. Thus, + # to mimic this behaviour also in Zuul, a required_status in the + # pipeline config could map to either a status or a check. + for check in self.getCommitChecks(project.name, sha, event): + ctuple = _check_as_tuple(check) + if "{}:{}".format(ctuple[0], ctuple[1]) not in seen: + statuses.append("{}:{}:{}".format(*ctuple)) + seen.append("{}:{}".format(ctuple[0], ctuple[1])) + return statuses def getWebController(self, zuul_web): |