From 3a30482282e703d6488a37071f4524bc99bbc9da Mon Sep 17 00:00:00 2001 From: Stephanie Kim Date: Wed, 10 Apr 2024 21:04:03 +0000 Subject: [PATCH] Update *_hash and *_is_first_class_gcs to be dotfiles Bug: b/324418194 Change-Id: Iae22d6895c8a15d7be351ce0023bd2ada83292a5 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5441097 Commit-Queue: Stephanie Kim Reviewed-by: Joanna Wang --- download_from_google_storage.py | 2 +- gclient.py | 2 +- tests/gclient_gcs_smoketest.py | 13 ------------- 3 files changed, 2 insertions(+), 15 deletions(-) diff --git a/download_from_google_storage.py b/download_from_google_storage.py index 8217eb1a4..8a0d452e0 100755 --- a/download_from_google_storage.py +++ b/download_from_google_storage.py @@ -48,7 +48,7 @@ def construct_migration_file_name(gcs_object_name): # Remove any extensions gcs_file_name = gcs_file_name.split('.')[0] - return gcs_file_name + MIGRATION_TOGGLE_FILE_SUFFIX + return f'.{gcs_file_name}{MIGRATION_TOGGLE_FILE_SUFFIX}' class InvalidFileError(IOError): diff --git a/gclient.py b/gclient.py index 3e9b84601..d835ddcac 100755 --- a/gclient.py +++ b/gclient.py @@ -2647,7 +2647,7 @@ class GcsDependency(Dependency): # Remove any forward slashes and drop any extensions hash_name = self.object_name.replace('/', '_').split('.')[0] - hash_file = os.path.join(output_dir, hash_name + '_hash') + hash_file = os.path.join(output_dir, f'.{hash_name}_hash') migration_toggle_file = os.path.join( output_dir, download_from_google_storage.construct_migration_file_name( diff --git a/tests/gclient_gcs_smoketest.py b/tests/gclient_gcs_smoketest.py index 22d583a0b..17dedc3fe 100644 --- a/tests/gclient_gcs_smoketest.py +++ b/tests/gclient_gcs_smoketest.py @@ -35,27 +35,14 @@ class GClientSmokeGcs(gclient_smoketest_base.GClientSmokeBase): tree = self.mangle_git_tree(('repo_22@1', 'src')) tree.update({ - 'src/another_gcs_dep/Linux_llvmfile_hash': - 'abcd123\n', 'src/another_gcs_dep/llvmfile.tar.gz': 'tarfile', - 'src/another_gcs_dep/Linux_llvmfile_is_first_class_gcs': - '1\n', 'src/another_gcs_dep/extracted_dir/extracted_file': 'extracted text', 'src/gcs_dep/deadbeef': 'tarfile', - 'src/gcs_dep/deadbeef_hash': - 'abcd123\n', - 'src/gcs_dep/deadbeef_is_first_class_gcs': - '1\n', 'src/gcs_dep/extracted_dir/extracted_file': 'extracted text', - 'src/gcs_dep_with_output_file/clang-format-version123_hash': - 'abcd123\n', - 'src/gcs_dep_with_output_file/clang-format-version123_' - 'is_first_class_gcs': - '1\n', 'src/gcs_dep_with_output_file/clang-format-no-extract': 'non-extractable file', })