From d5f9756591d0762306372ad599b80e530b7eedc0 Mon Sep 17 00:00:00 2001 From: gurusai-voleti Date: Tue, 24 Feb 2026 07:39:36 +0000 Subject: [PATCH 1/5] chore: Migrate gsutil usage to gcloud storage --- scripts/gha/gcs_uploader.py | 6 +++--- scripts/gha/integration_testing/ftl_gha_validator.py | 6 +++--- scripts/gha/integration_testing/gcs.py | 12 ++++++------ 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/scripts/gha/gcs_uploader.py b/scripts/gha/gcs_uploader.py index d12f167991..5124569a69 100644 --- a/scripts/gha/gcs_uploader.py +++ b/scripts/gha/gcs_uploader.py @@ -85,11 +85,11 @@ def main(argv): for artifact in artifacts: dest = _local_path_to_gcs_uri(gcs_prefix, artifact, testapp_dir) logging.info("Creating %s", dest) - subprocess.run([gcs.GSUTIL, "cp", artifact, dest], check=True) + subprocess.run(["gcloud", "storage", "cp", artifact, dest], check=True) logging.info("Finished uploading to %s", gcs_prefix) logging.info( - "Use 'gsutil cp ' to copy an artifact locally.\n" - "Use 'gsutil -m cp -r %s ' to copy everything.", gcs_prefix) + "Use 'gcloud storage cp ' to copy an artifact locally.\n" + "Use 'gcloud storage cp --recursive %s ' to copy everything.", gcs_prefix) def _local_path_to_gcs_uri(gcs_prefix, path, testapp_dir): diff --git a/scripts/gha/integration_testing/ftl_gha_validator.py b/scripts/gha/integration_testing/ftl_gha_validator.py index dfa6118ebb..3c4a9550e6 100644 --- a/scripts/gha/integration_testing/ftl_gha_validator.py +++ b/scripts/gha/integration_testing/ftl_gha_validator.py @@ -21,7 +21,7 @@ import re from retry import retry -GSUTIL = shutil.which("gsutil") +GSUTIL = shutil.which("gcloud") def validate(test_summary): if not test_summary: @@ -77,7 +77,7 @@ def _get_testapp_log_text_from_gcs(gcs_path): @retry(subprocess.CalledProcessError, tries=10, delay=5, backoff=1.5) def _gcs_list_dir(gcs_path): """Recursively returns a list of contents for a directory on GCS.""" - args = [GSUTIL, "ls", "-r", gcs_path] + args = [GSUTIL, "storage", "ls", "--recursive", gcs_path] logging.info("Listing GCS contents: %s", " ".join(args)) try: result = subprocess.run(args=args, capture_output=True, text=True, check=True) @@ -97,7 +97,7 @@ def _gcs_list_dir(gcs_path): @retry(subprocess.CalledProcessError, tries=10, delay=5, backoff=1.5) def _gcs_read_file(gcs_path): """Extracts the contents of a file on GCS.""" - args = [GSUTIL, "cat", gcs_path] + args = [GSUTIL, "storage", "cat", gcs_path] logging.info("Reading GCS file: %s", " ".join(args)) try: result = subprocess.run(args=args, capture_output=True, text=True, check=True) diff --git a/scripts/gha/integration_testing/gcs.py b/scripts/gha/integration_testing/gcs.py index b17adea8d5..b645cf5089 100644 --- a/scripts/gha/integration_testing/gcs.py +++ b/scripts/gha/integration_testing/gcs.py @@ -56,7 +56,7 @@ def get_unique_gcs_id(): def relative_path_to_gs_uri(path): - """Converts a relative GCS path to a GS URI understood by gsutil. + """Converts a relative GCS path to a GS URI understood by gcloud storage. This will prepend the gs prefix and project id to the path, i.e. path -> gs:///results_dir @@ -93,10 +93,10 @@ def authorize_gcs(key_file): def get_gsutil_tips(): """Returns a human readable string with tips on accessing a GCS bucket.""" return "\n".join(( - "GCS Advice: Install the Google Cloud SDK to access the gsutil tool.", - "Use 'gsutil ls ' to list contents of a directory on GCS.", - "Use 'gsutil cp ' to copy an artifact.", - "Use 'gsutil -m cp -r ' to copy a directory." + "GCS Advice: Install the Google Cloud SDK to access the gcloud storage tool.", + "Use 'gcloud storage ls ' to list contents of a directory on GCS.", + "Use 'gcloud storage cp ' to copy an artifact.", + "Use 'gcloud storage cp --recursive ' to copy a directory." )) @@ -110,4 +110,4 @@ def _verify_gcloud_sdk_command_line_tools(): if not GCLOUD or not GSUTIL: raise RuntimeError("Could not find required gCloud SDK tool(s)") subprocess.run([GCLOUD, "version"], check=True) - subprocess.run([GSUTIL, "version"], check=True) + subprocess.run([GCLOUD, "-v"], check=True) From ba61f1c95301f3707a78478ed38c97b4d2912d6d Mon Sep 17 00:00:00 2001 From: gurusai-voleti Date: Tue, 24 Feb 2026 13:25:15 +0530 Subject: [PATCH 2/5] Update ftl_gha_validator.py --- scripts/gha/integration_testing/ftl_gha_validator.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/gha/integration_testing/ftl_gha_validator.py b/scripts/gha/integration_testing/ftl_gha_validator.py index 3c4a9550e6..63d400304f 100644 --- a/scripts/gha/integration_testing/ftl_gha_validator.py +++ b/scripts/gha/integration_testing/ftl_gha_validator.py @@ -21,7 +21,7 @@ import re from retry import retry -GSUTIL = shutil.which("gcloud") +GCLOUD = shutil.which("gcloud") def validate(test_summary): if not test_summary: @@ -77,7 +77,7 @@ def _get_testapp_log_text_from_gcs(gcs_path): @retry(subprocess.CalledProcessError, tries=10, delay=5, backoff=1.5) def _gcs_list_dir(gcs_path): """Recursively returns a list of contents for a directory on GCS.""" - args = [GSUTIL, "storage", "ls", "--recursive", gcs_path] + args = [GCLOUD, "storage", "ls", "--recursive", gcs_path] logging.info("Listing GCS contents: %s", " ".join(args)) try: result = subprocess.run(args=args, capture_output=True, text=True, check=True) @@ -97,7 +97,7 @@ def _gcs_list_dir(gcs_path): @retry(subprocess.CalledProcessError, tries=10, delay=5, backoff=1.5) def _gcs_read_file(gcs_path): """Extracts the contents of a file on GCS.""" - args = [GSUTIL, "storage", "cat", gcs_path] + args = [GCLOUD, "storage", "cat", gcs_path] logging.info("Reading GCS file: %s", " ".join(args)) try: result = subprocess.run(args=args, capture_output=True, text=True, check=True) From bb98c4e324a4f93884f2b54169f083defb73344b Mon Sep 17 00:00:00 2001 From: gurusai-voleti Date: Tue, 24 Feb 2026 13:26:48 +0530 Subject: [PATCH 3/5] Update gcs.py --- scripts/gha/integration_testing/gcs.py | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/gha/integration_testing/gcs.py b/scripts/gha/integration_testing/gcs.py index b645cf5089..859eaf8fc6 100644 --- a/scripts/gha/integration_testing/gcs.py +++ b/scripts/gha/integration_testing/gcs.py @@ -110,4 +110,3 @@ def _verify_gcloud_sdk_command_line_tools(): if not GCLOUD or not GSUTIL: raise RuntimeError("Could not find required gCloud SDK tool(s)") subprocess.run([GCLOUD, "version"], check=True) - subprocess.run([GCLOUD, "-v"], check=True) From a20d8b8bf220ae71d3e3a8e03294a49f8152531e Mon Sep 17 00:00:00 2001 From: gurusai-voleti Date: Tue, 24 Feb 2026 18:40:02 +0530 Subject: [PATCH 4/5] Update gcs_uploader.py --- scripts/gha/gcs_uploader.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/gha/gcs_uploader.py b/scripts/gha/gcs_uploader.py index 5124569a69..f8a98de0c0 100644 --- a/scripts/gha/gcs_uploader.py +++ b/scripts/gha/gcs_uploader.py @@ -85,7 +85,7 @@ def main(argv): for artifact in artifacts: dest = _local_path_to_gcs_uri(gcs_prefix, artifact, testapp_dir) logging.info("Creating %s", dest) - subprocess.run(["gcloud", "storage", "cp", artifact, dest], check=True) + subprocess.run([gcs.GCLOUD, "storage", "cp", artifact, dest], check=True) logging.info("Finished uploading to %s", gcs_prefix) logging.info( "Use 'gcloud storage cp ' to copy an artifact locally.\n" From c0bdd6ab41e63de2682978e2927bdca8c7f5c405 Mon Sep 17 00:00:00 2001 From: a-maurice Date: Tue, 24 Feb 2026 13:19:55 -0800 Subject: [PATCH 5/5] Simplify gcloud SDK command line tools verification Removed gsutil checks from gcloud SDK verification. --- scripts/gha/integration_testing/gcs.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/scripts/gha/integration_testing/gcs.py b/scripts/gha/integration_testing/gcs.py index 859eaf8fc6..bfd8cca60c 100644 --- a/scripts/gha/integration_testing/gcs.py +++ b/scripts/gha/integration_testing/gcs.py @@ -28,7 +28,6 @@ # Note: this kind of thing (among others) could likely be simplified by using # the gCloud Python API instead of the command line tools. GCLOUD = shutil.which("gcloud") -GSUTIL = shutil.which("gsutil") PROJECT_ID = "games-auto-release-testing" @@ -102,11 +101,9 @@ def get_gsutil_tips(): def _verify_gcloud_sdk_command_line_tools(): """Verifies the presence of the gCloud SDK's command line tools.""" - logging.info("Looking for gcloud and gsutil tools...") + logging.info("Looking for gcloud tools...") if not GCLOUD: logging.error("gcloud not on path") - if not GSUTIL: - logging.error("gsutil not on path") - if not GCLOUD or not GSUTIL: + if not GCLOUD: raise RuntimeError("Could not find required gCloud SDK tool(s)") subprocess.run([GCLOUD, "version"], check=True)