Fix processing of int dimensions.
Dimensions must be always strings and they were being casted to ints.
Change-Id: I9c49db0f4140e83759b2fe44628a1601cdc92c97
Reviewed-on: https://flutter-review.googlesource.com/c/infra/+/38130
Commit-Queue: Godofredo Contreras <godofredoc@google.com>
Reviewed-by: Ricardo Amador <ricardoamador@google.com>
diff --git a/config/lib/ci_yaml/ci_yaml.star b/config/lib/ci_yaml/ci_yaml.star
index 477e632..9cd4d75 100644
--- a/config/lib/ci_yaml/ci_yaml.star
+++ b/config/lib/ci_yaml/ci_yaml.star
@@ -159,7 +159,7 @@
platform_properties[platform][k] = _parse_attribute(k, v)
return platform_properties
-def _parse_attribute(key, value):
+def _parse_attribute(key, value, preserve_strings = False):
"""Helper function to parse non string type properties."""
json_list = ["android_sdk_license", "android_sdk_preview_license"]
if value == "true":
@@ -171,7 +171,7 @@
return value.replace("\\n", "\n")
elif value.startswith("[") or value.startswith("{"):
return json.decode(value)
- elif value.isdigit():
+ elif value.isdigit() and not preserve_strings:
return int(value)
else:
return value
@@ -188,7 +188,7 @@
# Update with target specific dimensions
for k, v in dict(target.dimensions).items():
- dimensions[k] = _parse_attribute(k, v)
+ dimensions[k] = _parse_attribute(k, v, True)
return dimensions
def _properties(ci_yaml, target, default_properties = {}, repo = None, branch = None):