Fix pre-processing.

The preprocess method was only returning json properties and ignoring
all the others.

Bug: https://github.com/flutter/flutter/issues/115489
Change-Id: I064a55ceda7c35e827b4eb9332962f01903b3e86
Reviewed-on: https://flutter-review.googlesource.com/c/recipes/+/36860
Reviewed-by: Yusuf Mohsinally <mohsinally@google.com>
Commit-Queue: Godofredo Contreras <godofredoc@google.com>
diff --git a/infra/config/recipes.cfg b/infra/config/recipes.cfg
index f5b9fa9..159593a 100644
--- a/infra/config/recipes.cfg
+++ b/infra/config/recipes.cfg
@@ -28,7 +28,7 @@
     },
     "fuchsia": {
       "branch": "refs/heads/main",
-      "revision": "436c2d70d2eaa2e980ce7b62c863a69575e884ea",
+      "revision": "3538cd9e3c9f289608047ca175983e49261d80da",
       "url": "https://fuchsia.googlesource.com/infra/recipes.git"
     },
     "recipe_engine": {
diff --git a/recipe_modules/shard_util_v2/api.py b/recipe_modules/shard_util_v2/api.py
index 04f3394..4e09316 100644
--- a/recipe_modules/shard_util_v2/api.py
+++ b/recipe_modules/shard_util_v2/api.py
@@ -81,6 +81,9 @@
 
    Args:
      target: A target dictionary as read from the yaml file.
+
+   Returns:
+     A copy of the original dictionary with the json properties decoded.
    """
    if target.get('properties'):
      properties = target.get('properties')
@@ -88,6 +91,8 @@
      for k, v in properties.items():
        if isinstance(v,str) and (v.startswith('[') or v.startswith('{')):
          new_props[k] = json.loads(v)
+       else:
+         new_props[k] = v
      target['properties'] = new_props
    return target
 
diff --git a/recipe_modules/shard_util_v2/examples/full.py b/recipe_modules/shard_util_v2/examples/full.py
index bbe4a92..a51c4f0 100644
--- a/recipe_modules/shard_util_v2/examples/full.py
+++ b/recipe_modules/shard_util_v2/examples/full.py
@@ -22,11 +22,13 @@
   test_configs = api.properties.get('tests', [])
   props = api.shard_util_v2.pre_process_properties(
           {'properties': {
-              '$flutter/osx_sdk': '{"cleanup_cache": true, "sdk_version": "14a5294e"}'
+              '$flutter/osx_sdk': '{"cleanup_cache": true, "sdk_version": "14a5294e"}',
+              'validation': 'docs'
               }
            }
   )
   assert isinstance(props['properties']['$flutter/osx_sdk'], dict)
+  assert props['properties']['validation'] == 'docs'
   with api.step.nest("launch builds") as presentation:
     reqs = api.shard_util_v2.schedule_builds(build_configs, presentation)
   with api.step.nest("collect builds") as presentation:
diff --git a/recipes/release/release_builder.expected/basic_linux_main.json b/recipes/release/release_builder.expected/basic_linux_main.json
index a0e9c92..e3eeaf3 100644
--- a/recipes/release/release_builder.expected/basic_linux_main.json
+++ b/recipes/release/release_builder.expected/basic_linux_main.json
@@ -305,7 +305,7 @@
       }
     },
     "name": "launch builds.schedule",
-    "stdin": "{\"requests\": [{\"scheduleBuild\": {\"builder\": {\"bucket\": \"try\", \"builder\": \"Linux Engine Drone\", \"project\": \"proj\"}, \"exe\": {\"cipdVersion\": \"refs/heads/main\"}, \"experimental\": \"NO\", \"experiments\": {\"luci.buildbucket.parent_tracking\": false}, \"fields\": \"builder,createTime,createdBy,critical,endTime,id,infra,input,number,output,startTime,status,updateTime\", \"gerritChanges\": [{\"change\": \"123456\", \"host\": \"flutter-review.googlesource.com\", \"patchset\": \"7\", \"project\": \"mirrors/engine\"}], \"gitilesCommit\": {\"host\": \"flutter.googlesource.com\", \"id\": \"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\", \"project\": \"mirrors/engine\", \"ref\": \"refs/heads/main\"}, \"priority\": 25, \"properties\": {\"$flutter/osx_sdk\": {\"sdk_version\": \"14a5294e\"}, \"build\": {\"name\": \"linux one\", \"properties\": {\"$flutter/osx_sdk\": {\"sdk_version\": \"14a5294e\"}}, \"recipe\": \"engine/something\"}, \"environment\": \"Staging\", \"recipe\": \"engine/something\", \"repository\": \"engine\"}, \"requestId\": \"8945511751514863184-00000000-0000-0000-0000-000000001337\", \"swarming\": {\"parentRunId\": \"fake-task-id\"}, \"tags\": [{\"key\": \"cq_experimental\", \"value\": \"false\"}, {\"key\": \"parent_buildbucket_id\", \"value\": \"8945511751514863184\"}, {\"key\": \"user_agent\", \"value\": \"recipe\"}]}}]}",
+    "stdin": "{\"requests\": [{\"scheduleBuild\": {\"builder\": {\"bucket\": \"try\", \"builder\": \"Linux Engine Drone\", \"project\": \"proj\"}, \"exe\": {\"cipdVersion\": \"refs/heads/main\"}, \"experimental\": \"NO\", \"experiments\": {\"luci.buildbucket.parent_tracking\": false}, \"fields\": \"builder,createTime,createdBy,critical,endTime,id,infra,input,number,output,startTime,status,updateTime\", \"gerritChanges\": [{\"change\": \"123456\", \"host\": \"flutter-review.googlesource.com\", \"patchset\": \"7\", \"project\": \"mirrors/engine\"}], \"gitilesCommit\": {\"host\": \"flutter.googlesource.com\", \"id\": \"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\", \"project\": \"mirrors/engine\", \"ref\": \"refs/heads/main\"}, \"priority\": 25, \"properties\": {\"$flutter/osx_sdk\": {\"sdk_version\": \"14a5294e\"}, \"build\": {\"name\": \"linux one\", \"properties\": {\"$flutter/osx_sdk\": {\"sdk_version\": \"14a5294e\"}, \"release_build\": true}, \"recipe\": \"engine/something\"}, \"environment\": \"Staging\", \"recipe\": \"engine/something\", \"release_build\": true, \"repository\": \"engine\"}, \"requestId\": \"8945511751514863184-00000000-0000-0000-0000-000000001337\", \"swarming\": {\"parentRunId\": \"fake-task-id\"}, \"tags\": [{\"key\": \"cq_experimental\", \"value\": \"false\"}, {\"key\": \"parent_buildbucket_id\", \"value\": \"8945511751514863184\"}, {\"key\": \"user_agent\", \"value\": \"recipe\"}]}}]}",
     "~followup_annotations": [
       "@@@STEP_NEST_LEVEL@1@@@",
       "@@@STEP_LOG_LINE@json.output@{@@@",
@@ -364,12 +364,14 @@
       "@@@STEP_LOG_LINE@request@            \"properties\": {@@@",
       "@@@STEP_LOG_LINE@request@              \"$flutter/osx_sdk\": {@@@",
       "@@@STEP_LOG_LINE@request@                \"sdk_version\": \"14a5294e\"@@@",
-      "@@@STEP_LOG_LINE@request@              }@@@",
+      "@@@STEP_LOG_LINE@request@              }, @@@",
+      "@@@STEP_LOG_LINE@request@              \"release_build\": true@@@",
       "@@@STEP_LOG_LINE@request@            }, @@@",
       "@@@STEP_LOG_LINE@request@            \"recipe\": \"engine/something\"@@@",
       "@@@STEP_LOG_LINE@request@          }, @@@",
       "@@@STEP_LOG_LINE@request@          \"environment\": \"Staging\", @@@",
       "@@@STEP_LOG_LINE@request@          \"recipe\": \"engine/something\", @@@",
+      "@@@STEP_LOG_LINE@request@          \"release_build\": true, @@@",
       "@@@STEP_LOG_LINE@request@          \"repository\": \"engine\"@@@",
       "@@@STEP_LOG_LINE@request@        }, @@@",
       "@@@STEP_LOG_LINE@request@        \"requestId\": \"8945511751514863184-00000000-0000-0000-0000-000000001337\", @@@",