Revert "Reland: "Start uploading docs to GCS.""

This reverts commit 0499182eee1e59bae9a67fd6cc1d13aca6c8a38e.

Reason for revert: Reverting because now the recipe is trying to zip the docs content even when the docs have not been created.

Original change's description:
> Reland: "Start uploading docs to GCS."
>
> The previous cl was reverted because both "docs test" and "docs deploy"
> were uploading the zip artifact and the builders were not allowing to
> override the destination artifacts.
>
> With this updated version only "docs deploy" will be uploading the
> artifacts and a second change is enabling override on retry for
> framework builders.
>
> Bug: flutter/flutter#111921
> Change-Id: Ifcbadfe912922544d7ce4dce50bf9392cd5c1088
> Reviewed-on: https://flutter-review.googlesource.com/c/recipes/+/34101
> Commit-Queue: Godofredo Contreras <godofredoc@google.com>
> Reviewed-by: Casey Hillers <chillers@google.com>

TBR=godofredoc@google.com,keyonghan@google.com,chillers@google.com,flutter-scoped@luci-project-accounts.iam.gserviceaccount.com

Change-Id: Ibe9b6951dba5b56d909d37a5c645d437ec936f5b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: flutter/flutter#111921
Reviewed-on: https://flutter-review.googlesource.com/c/recipes/+/34120
Commit-Queue: Godofredo Contreras <godofredoc@google.com>
Reviewed-by: Godofredo Contreras <godofredoc@google.com>
diff --git a/recipe_modules/adhoc_validation/__init__.py b/recipe_modules/adhoc_validation/__init__.py
index 5ab5be1..80ac1c5 100644
--- a/recipe_modules/adhoc_validation/__init__.py
+++ b/recipe_modules/adhoc_validation/__init__.py
@@ -1,5 +1,4 @@
 DEPS = [
-    'flutter/bucket_util',
     'flutter/firebase',
     'flutter/flutter_deps',
     'flutter/kms',
diff --git a/recipe_modules/adhoc_validation/api.py b/recipe_modules/adhoc_validation/api.py
index 2a87b67..1881191 100644
--- a/recipe_modules/adhoc_validation/api.py
+++ b/recipe_modules/adhoc_validation/api.py
@@ -59,9 +59,9 @@
             self.m.test_utils.run_test(validation, [resource_name])
       else:
         with self.m.context(env=env, env_prefixes=env_prefixes):
-          docs_path = checkout_path.join('dev', 'docs')
+          self.m.test_utils.run_test(validation, [resource_name])
           if validation == 'docs' and self.m.properties.get('firebase_project'):
-            self.m.bucket_util.upload_folder('Upload API Docs', docs_path, 'doc', "api_docs.zip")
+            docs_path = checkout_path.join('dev', 'docs')
             project = self.m.properties.get('firebase_project')
             self.m.firebase.deploy_docs(
                 env=env,
diff --git a/recipe_modules/adhoc_validation/examples/full.expected/linux.json b/recipe_modules/adhoc_validation/examples/full.expected/linux.json
index 94cc53e..da960ab 100644
--- a/recipe_modules/adhoc_validation/examples/full.expected/linux.json
+++ b/recipe_modules/adhoc_validation/examples/full.expected/linux.json
@@ -44,8 +44,7 @@
   },
   {
     "cmd": [
-      "python",
-      "RECIPE_MODULE[flutter::zip]/resources/zip.py"
+      "RECIPE_MODULE[flutter::adhoc_validation]/resources/docs.sh"
     ],
     "env": {
       "DEPOT_TOOLS": "RECIPE_REPO[depot_tools]",
@@ -64,43 +63,14 @@
         "[START_DIR]/flutter sdk/bin/cache/dart-sdk/bin"
       ]
     },
-    "name": "Docs.Zip doc",
-    "stdin": "{\"entries\": [{\"path\": \"[START_DIR]/flutter sdk/dev/docs/doc\", \"type\": \"dir\"}], \"output\": \"[CLEANUP]/tmp_tmp_1/api_docs.zip\", \"root\": \"[START_DIR]/flutter sdk/dev/docs\"}",
+    "name": "Docs.docs",
+    "timeout": 3600,
     "~followup_annotations": [
-      "@@@STEP_NEST_LEVEL@1@@@"
-    ]
-  },
-  {
-    "cmd": [
-      "vpython3",
-      "-u",
-      "RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py",
-      "--json-output",
-      "/path/to/tmp/json",
-      "rmtree",
-      "[CLEANUP]/tmp_tmp_1"
-    ],
-    "env": {
-      "DEPOT_TOOLS": "RECIPE_REPO[depot_tools]",
-      "GIT_BRANCH": "",
-      "LUCI_BRANCH": "",
-      "LUCI_CI": "True",
-      "LUCI_PR": "",
-      "OS": "linux",
-      "PUB_CACHE": "[START_DIR]/.pub-cache",
-      "REVISION": "",
-      "SDK_CHECKOUT_PATH": "[START_DIR]/flutter sdk"
-    },
-    "env_prefixes": {
-      "PATH": [
-        "[START_DIR]/flutter sdk/bin",
-        "[START_DIR]/flutter sdk/bin/cache/dart-sdk/bin"
-      ]
-    },
-    "infra_step": true,
-    "name": "Docs.temp dir for Upload API Docs",
-    "~followup_annotations": [
-      "@@@STEP_NEST_LEVEL@1@@@"
+      "@@@STEP_NEST_LEVEL@1@@@",
+      "@@@STEP_LOG_LINE@test_stdout@@@@",
+      "@@@STEP_LOG_END@test_stdout@@@",
+      "@@@STEP_LOG_LINE@test_stderr@@@@",
+      "@@@STEP_LOG_END@test_stderr@@@"
     ]
   },
   {
@@ -144,7 +114,7 @@
       "/path/to/tmp/json",
       "copy",
       "extra.secret.token.should.not.be.logged",
-      "[CLEANUP]/tmp_tmp_2"
+      "[CLEANUP]/tmp_tmp_1"
     ],
     "env": {
       "DEPOT_TOOLS": "RECIPE_REPO[depot_tools]",
@@ -194,7 +164,7 @@
       "PUB_CACHE": "[START_DIR]/.pub-cache",
       "REVISION": "",
       "SDK_CHECKOUT_PATH": "[START_DIR]/flutter sdk",
-      "TOKEN_PATH": "[CLEANUP]/tmp_tmp_2"
+      "TOKEN_PATH": "[CLEANUP]/tmp_tmp_1"
     },
     "env_prefixes": {
       "PATH": [
@@ -223,7 +193,7 @@
       "PUB_CACHE": "[START_DIR]/.pub-cache",
       "REVISION": "",
       "SDK_CHECKOUT_PATH": "[START_DIR]/flutter sdk",
-      "TOKEN_PATH": "[CLEANUP]/tmp_tmp_2"
+      "TOKEN_PATH": "[CLEANUP]/tmp_tmp_1"
     },
     "env_prefixes": {
       "PATH": [
diff --git a/recipe_modules/adhoc_validation/examples/full.expected/mac_nodeps.json b/recipe_modules/adhoc_validation/examples/full.expected/mac_nodeps.json
index b72c540..b70638a 100644
--- a/recipe_modules/adhoc_validation/examples/full.expected/mac_nodeps.json
+++ b/recipe_modules/adhoc_validation/examples/full.expected/mac_nodeps.json
@@ -43,6 +43,37 @@
     ]
   },
   {
+    "cmd": [
+      "RECIPE_MODULE[flutter::adhoc_validation]/resources/docs.sh"
+    ],
+    "env": {
+      "DEPOT_TOOLS": "RECIPE_REPO[depot_tools]",
+      "GIT_BRANCH": "",
+      "LUCI_BRANCH": "",
+      "LUCI_CI": "True",
+      "LUCI_PR": "",
+      "OS": "darwin",
+      "PUB_CACHE": "[START_DIR]/.pub-cache",
+      "REVISION": "",
+      "SDK_CHECKOUT_PATH": "[START_DIR]/flutter sdk"
+    },
+    "env_prefixes": {
+      "PATH": [
+        "[START_DIR]/flutter sdk/bin",
+        "[START_DIR]/flutter sdk/bin/cache/dart-sdk/bin"
+      ]
+    },
+    "name": "Docs.docs",
+    "timeout": 3600,
+    "~followup_annotations": [
+      "@@@STEP_NEST_LEVEL@1@@@",
+      "@@@STEP_LOG_LINE@test_stdout@@@@",
+      "@@@STEP_LOG_END@test_stdout@@@",
+      "@@@STEP_LOG_LINE@test_stderr@@@@",
+      "@@@STEP_LOG_END@test_stderr@@@"
+    ]
+  },
+  {
     "name": "$result"
   }
 ]
\ No newline at end of file
diff --git a/recipe_modules/adhoc_validation/examples/full.expected/win.json b/recipe_modules/adhoc_validation/examples/full.expected/win.json
index 2ebfb5f..ce40448 100644
--- a/recipe_modules/adhoc_validation/examples/full.expected/win.json
+++ b/recipe_modules/adhoc_validation/examples/full.expected/win.json
@@ -14,6 +14,37 @@
     "name": "Docs"
   },
   {
+    "cmd": [
+      "RECIPE_MODULE[flutter::adhoc_validation]\\resources\\docs.bat"
+    ],
+    "env": {
+      "DEPOT_TOOLS": "RECIPE_REPO[depot_tools]",
+      "GIT_BRANCH": "",
+      "LUCI_BRANCH": "",
+      "LUCI_CI": "True",
+      "LUCI_PR": "",
+      "OS": "win",
+      "PUB_CACHE": "[START_DIR]\\.pub-cache",
+      "REVISION": "",
+      "SDK_CHECKOUT_PATH": "[START_DIR]\\flutter sdk"
+    },
+    "env_prefixes": {
+      "PATH": [
+        "[START_DIR]\\flutter sdk\\bin",
+        "[START_DIR]\\flutter sdk\\bin\\cache\\dart-sdk\\bin"
+      ]
+    },
+    "name": "Docs.docs",
+    "timeout": 3600,
+    "~followup_annotations": [
+      "@@@STEP_NEST_LEVEL@1@@@",
+      "@@@STEP_LOG_LINE@test_stdout@@@@",
+      "@@@STEP_LOG_END@test_stdout@@@",
+      "@@@STEP_LOG_LINE@test_stderr@@@@",
+      "@@@STEP_LOG_END@test_stderr@@@"
+    ]
+  },
+  {
     "name": "$result"
   }
 ]
\ No newline at end of file
diff --git a/recipe_modules/bucket_util/api.py b/recipe_modules/bucket_util/api.py
index 264f98e..e7b1d40 100644
--- a/recipe_modules/bucket_util/api.py
+++ b/recipe_modules/bucket_util/api.py
@@ -72,8 +72,7 @@
       remote_name = '%s/%s' % (platform, zip_name) if platform else zip_name
       local_zip = temp_dir.join(zip_name)
       remote_zip = self.get_cloud_path(remote_name)
-      if isinstance(parent_directory, str):
-        parent_directory = self.m.path['cache'].join('builder', parent_directory)
+      parent_directory = self.m.path['cache'].join('builder', parent_directory)
       pkg = self.m.zip.make_package(parent_directory, local_zip)
       pkg.add_directory(parent_directory.join(folder_name))
 
diff --git a/recipes/flutter/flutter.expected/validators.json b/recipes/flutter/flutter.expected/validators.json
index 0e28cb2..9f3f0de 100644
--- a/recipes/flutter/flutter.expected/validators.json
+++ b/recipes/flutter/flutter.expected/validators.json
@@ -235,6 +235,40 @@
     ]
   },
   {
+    "cmd": [
+      "RECIPE_MODULE[flutter::adhoc_validation]/resources/analyze.sh"
+    ],
+    "cwd": "[START_DIR]/flutter sdk",
+    "env": {
+      "DEPOT_TOOLS": "RECIPE_REPO[depot_tools]",
+      "GIT_BRANCH": "",
+      "LUCI_BRANCH": "",
+      "LUCI_CI": "True",
+      "LUCI_PR": "",
+      "OS": "linux",
+      "PUB_CACHE": "[START_DIR]/.pub-cache",
+      "REVISION": "",
+      "SDK_CHECKOUT_PATH": "[START_DIR]/flutter sdk"
+    },
+    "env_prefixes": {
+      "PATH": [
+        "[START_DIR]/flutter sdk/bin",
+        "[START_DIR]/flutter sdk/bin/cache/dart-sdk/bin",
+        "[START_DIR]/flutter sdk/bin",
+        "[START_DIR]/flutter sdk/bin/cache/dart-sdk/bin"
+      ]
+    },
+    "name": "dart analyze.analyze",
+    "timeout": 3600,
+    "~followup_annotations": [
+      "@@@STEP_NEST_LEVEL@1@@@",
+      "@@@STEP_LOG_LINE@test_stdout@@@@",
+      "@@@STEP_LOG_END@test_stdout@@@",
+      "@@@STEP_LOG_LINE@test_stderr@@@@",
+      "@@@STEP_LOG_END@test_stderr@@@"
+    ]
+  },
+  {
     "cmd": [],
     "name": "Killing Processes"
   },