From e2e2918a73fd55fd7980992da734c26bc93609bb Mon Sep 17 00:00:00 2001 From: Andreea Florescu Date: Mon, 24 Oct 2022 14:20:48 +0200 Subject: [PATCH] generate pipeline: support for FW unknown keys Any keys in the input JSON that we do not recognize we are adding as they are to the output pipeline. This is needed so that we don't have to always update the autogeneration script for each new Buildkite configuration that we want to support. Signed-off-by: Andreea Florescu --- .buildkite/autogenerate_pipeline.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.buildkite/autogenerate_pipeline.py b/.buildkite/autogenerate_pipeline.py index 4b097ac..1cb9fd3 100755 --- a/.buildkite/autogenerate_pipeline.py +++ b/.buildkite/autogenerate_pipeline.py @@ -233,6 +233,17 @@ class BuildkiteStep: self._env_add_docker_config(test_name) self._env_override_timeout(test_name) + # We're now adding the keys for which we don't have explicit support + # (i.e. there is no checking/updating taking place). We are just + # forwarding the key, values without any change. + # We need to filter for keys that have special meaning and which we + # don't want to re-add. + special_keys = ['conditional', 'docker_plugin', 'platform', 'test_name'] + additional_keys = {k: v for k, v in input.items() if not (k in self.step_config) and + not(k in special_keys)} + if additional_keys: + self.step_config.update(additional_keys) + # Return the object's attributes and their values as a dictionary. return self.step_config