From 7e999006bbbd82628d823967222a3b22dff521f6 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Aug 17 2018 12:25:51 +0000 Subject: Better cope with the different state returned by the CI pipeline Signed-off-by: Pierre-Yves Chibon --- diff --git a/playbooks/roles/flag_ci_pr/files/flag_ci_pr.py b/playbooks/roles/flag_ci_pr/files/flag_ci_pr.py index 9dcd790..1cf38a5 100644 --- a/playbooks/roles/flag_ci_pr/files/flag_ci_pr.py +++ b/playbooks/roles/flag_ci_pr/files/flag_ci_pr.py @@ -38,9 +38,9 @@ def main(msg): 'https://', requests.adapters.HTTPAdapter(max_retries=retry_conf)) done_states = { - 'SUCCESS': 'success', - 'UNSTABLE': 'failed', - 'FAILURE': 'error', + 'SUCCESS': {'api': 'success', 'human': 'passed'}, + 'UNSTABLE': {'api': 'failure', 'human': 'failed'}, + 'FAILURE': {'api': 'error', 'human': 'errored'}, } state = msg['status'] if state not in done_states: @@ -57,8 +57,8 @@ def main(msg): data = { 'username': 'All packages PR', - 'status': done_states[state], - 'comment': 'Package tests: %s' % (done_states[state]), + 'status': done_states[state]['api'], + 'comment': 'Package tests: %s' % (done_states[state]['human']), 'url': msg['build_url'], }