Pass through engine prebuilt version

Bug: https://github.com/flutter/flutter/issues/162201
Change-Id: I41b35e0fd8b711ae01432095a0b8755d2ef5b448
Reviewed-on: https://flutter-review.googlesource.com/c/recipes/+/62501
Commit-Queue: Matan Lurey <matanl@google.com>
Commit-Queue: John McDole <codefu@google.com>
Reviewed-by: Matan Lurey <matanl@google.com>
diff --git a/recipe_modules/repo_util/api.py b/recipe_modules/repo_util/api.py
index 051777c..4cfac43 100644
--- a/recipe_modules/repo_util/api.py
+++ b/recipe_modules/repo_util/api.py
@@ -445,9 +445,17 @@
             self.get_commit(checkout_path),
     }
     self.add_property_env_variables(env)
+
+    # Cocoon signal that we want to pin the engine realm. See flutter/bin/internal/update_engine_version.sh
     flutter_realm = self.m.properties.get('flutter_realm', False)
     if flutter_realm:
       env['FLUTTER_REALM'] = flutter_realm
+
+    # Cocoon signal that we want to pin the engine version. See flutter/bin/internal/update_engine_version.sh
+    flutter_prebuilt_engine_version = self.m.properties.get('flutter_prebuilt_engine_version', False)
+    if flutter_prebuilt_engine_version:
+      env['FLUTTER_PREBUILT_ENGINE_VERSION'] = flutter_prebuilt_engine_version
+
     if self.m.properties.get('gn_artifacts', False):
       env['FLUTTER_STORAGE_BASE_URL'
          ] = 'https://storage.googleapis.com/flutter_archives_v2'
diff --git a/recipe_modules/repo_util/examples/full.expected/force_get_candidate_branch.json b/recipe_modules/repo_util/examples/full.expected/force_get_candidate_branch.json
index eb63b51..13b8b25 100644
--- a/recipe_modules/repo_util/examples/full.expected/force_get_candidate_branch.json
+++ b/recipe_modules/repo_util/examples/full.expected/force_get_candidate_branch.json
@@ -53,7 +53,7 @@
       "           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^",
       "  File \"RECIPE_REPO[flutter]/recipe_modules/repo_util/examples/full.py\", line 28, in RunSteps",
       "    api.repo_util.release_candidate_branch(flutter_checkout_path)",
-      "  File \"RECIPE_REPO[flutter]/recipe_modules/repo_util/api.py\", line 610, in release_candidate_branch",
+      "  File \"RECIPE_REPO[flutter]/recipe_modules/repo_util/api.py\", line 618, in release_candidate_branch",
       "    raise ValueError('Not a release candidate branch: %s' % candidate_branch)",
       "ValueError: Not a release candidate branch: refs/pull/1/head"
     ]
diff --git a/recipe_modules/repo_util/examples/full.expected/fusion.json b/recipe_modules/repo_util/examples/full.expected/fusion.json
index af8a25b..96c9c02 100644
--- a/recipe_modules/repo_util/examples/full.expected/fusion.json
+++ b/recipe_modules/repo_util/examples/full.expected/fusion.json
@@ -573,6 +573,7 @@
     "env": {
       "ARTIFACT_HUB_REPOSITORY": "artifactregistry://us-maven.pkg.dev/artifact-foundry-prod/maven-3p",
       "DEPOT_TOOLS": "RECIPE_REPO[depot_tools]",
+      "FLUTTER_PREBUILT_ENGINE_VERSION": "sha1234",
       "FLUTTER_REALM": "foo-realm",
       "GIT_BRANCH": "",
       "LUCI_BRANCH": "",
diff --git a/recipe_modules/repo_util/examples/full.py b/recipe_modules/repo_util/examples/full.py
index 64dbc8e..6aca391 100644
--- a/recipe_modules/repo_util/examples/full.py
+++ b/recipe_modules/repo_util/examples/full.py
@@ -330,6 +330,7 @@
           config_name='build_config.json',
           is_fusion=True,
           flutter_realm='foo-realm',
+          flutter_prebuilt_engine_version='sha1234',
           ),
       api.repo_util.flutter_environment_data(),
   )