Do not use goma for mac prod builds.

This is to collect benchmarks of how big the impact of not using goma
for mac builds in prod.

Bug: https://github.com/flutter/flutter/issues/140342
Change-Id: Ida97dff28bf46906417dffbdbfd2a163363778e5
Reviewed-on: https://flutter-review.googlesource.com/c/recipes/+/53260
Reviewed-by: Yusuf Mohsinally <mohsinally@google.com>
Commit-Queue: Godofredo Contreras <godofredoc@google.com>
Reviewed-by: Keyong Han <keyonghan@google.com>
diff --git a/recipe_modules/flutter_bcid/api.py b/recipe_modules/flutter_bcid/api.py
index 4e54196..ef8413a 100644
--- a/recipe_modules/flutter_bcid/api.py
+++ b/recipe_modules/flutter_bcid/api.py
@@ -30,7 +30,7 @@
 
   def is_prod_build(self):
     bucket = self.m.buildbucket.build.builder.bucket
-    return bucket == 'prod'
+    return bucket in ('prod', 'prod.shadow')
 
   def report_stage(self, stage):
     if self.is_official_build():
diff --git a/recipes/engine_v2/builder.py b/recipes/engine_v2/builder.py
index d94961f..8799ea6 100644
--- a/recipes/engine_v2/builder.py
+++ b/recipes/engine_v2/builder.py
@@ -187,7 +187,9 @@
   if gn:
     with api.context(env=env, env_prefixes=env_prefixes):
       gn = list(gn)
-      if api.flutter_bcid.is_official_build():
+      if api.flutter_bcid.is_official_build() or (
+          api.platform.is_mac and api.flutter_bcid.is_prod_build() and
+          api.properties.get('release_build')):
         # Goma is not supported for official builds.
         gn.append('--no-goma')
       if api.monorepo.is_monorepo_ci_build:
@@ -434,9 +436,9 @@
   test_if_build = {
       "tests": [{
           "name": "mytest", "script": "myscript.sh",
-          "parameters": ["param1", "param2", '${FLUTTER_LOGS_DIR}'],
-          "type": "local", "contexts": ["metric_center_token"],
-          "test_if": "main"
+          "parameters": ["param1", "param2",
+                         '${FLUTTER_LOGS_DIR}'], "type": "local",
+          "contexts": ["metric_center_token"], "test_if": "main"
       }]
   }
   yield api.test(