From 1bfbaa3bd189e124b31c107a53f5f044b6020739 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Sep 14 2020 08:36:16 +0000 Subject: Do not assume the scratch field is always present We have ran in production into a message that did not have the scratch field in the "artifact" section, thus breaking our consumer and doing so, the entire gating pipeline in Fedora. The message: https://apps.fedoraproject.org/datagrepper/id?is_raw=true&size=extra-large&id=2020-5626e1e7-4d8f-4acb-9a5e-d9dfe860a26e Signed-off-by: Pierre-Yves Chibon --- diff --git a/resultsdb_listener/consumer.py b/resultsdb_listener/consumer.py index 9fc8367..34d2ab7 100644 --- a/resultsdb_listener/consumer.py +++ b/resultsdb_listener/consumer.py @@ -34,7 +34,7 @@ def message_to_payload(message): # All CI messages of versions 0.2.X should have the same fields... elif message.body["version"].startswith("0.2."): # ignore scratch builds - if message.body["artifact"]["scratch"]: + if message.body["artifact"].get("scratch"): return None data = { "build_url": message.body["run"]["url"],