| |
@@ -424,23 +424,20 @@
|
| |
def get_pr_ci_result(package, pr_id):
|
| |
"""
|
| |
Return CI result for package pull-request
|
| |
- Returns {"Zuul": "result", "simple-koji-ci": "result"} , "result" can be "failure", "success", "pending" or None
|
| |
- TODO: Add support for FedoraCI once pagure exposes it's result in the api
|
| |
+ Returns {"ci-name": "result", "different-ci-name": "result",...} ,
|
| |
+ "result" can be whatever a CI returns, there is no damned standard for it
|
| |
+ "ci-name" can be anything, Zuul and simple-koji-ci will be the most common at the time of writing the code
|
| |
"""
|
| |
resp_pr_ci_result = get_json("https://src.fedoraproject.org/api/0/rpms/%s/pull-request/%s/flag" % (package, pr_id))
|
| |
- data = {"Zuul": None, "simple-koji-ci": None}
|
| |
+ data = {}
|
| |
if not resp_pr_ci_result:
|
| |
- return data
|
| |
+ return {}
|
| |
if "flags" not in resp_pr_ci_result:
|
| |
- return data
|
| |
+ return {}
|
| |
for result in resp_pr_ci_result["flags"]:
|
| |
- if result["username"] == "Zuul" and not data["Zuul"]:
|
| |
- data["Zuul"] = result["status"]
|
| |
- if result["username"] == "simple-koji-ci" and not data["simple-koji-ci"]:
|
| |
- data["simple-koji-ci"] = result["status"]
|
| |
# We care only about the newest results
|
| |
- if data["simple-koji-ci"] and data["Zuul"]:
|
| |
- break
|
| |
+ if result["username"] not in data.keys():
|
| |
+ data[result["username"]] = result["status"]
|
| |
return data
|
| |
|
| |
|
| |
Fixes https://pagure.io/fedora-qa/packager_dashboard/issue/47 for realz.