Skip to content

Commit

Permalink
ci: fix passing simple values to step parameters
Browse files Browse the repository at this point in the history
In c6add4f while adding support for
more complex parameters we broke passing simple strings.

While it can be worked around by quoting the string with '', that makes
the simple case more complex than it was before, and breaks previous
pipeline definitions.

Fix it so if the first character does not look like a python expression,
take the value verbatim.

Fixes: c6add4f

(cherry picked from commit cea24c5)
Signed-off-by: Pablo Barbáchano <[email protected]>
  • Loading branch information
pb8o authored and kalyazin committed Feb 7, 2025
1 parent e2035b4 commit 1bad635
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .buildkite/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ def __call__(self, parser, namespace, value, option_string=None):
res = getattr(namespace, self.dest, {})
key_str, val = value.split("=", maxsplit=1)
keys = key_str.split("/")
update = {keys[-1]: ast.literal_eval(val)}
# Interpret it as a literal iff it starts like one
update = {keys[-1]: ast.literal_eval(val) if val[0] in "[{'" else val}
for key in list(reversed(keys))[1:]:
update = {key: update}
res = overlay_dict(res, update)
Expand Down

0 comments on commit 1bad635

Please sign in to comment.