From 06c7bfa5c6e52e01dc2fdcb24b7062f1d06f9bdf Mon Sep 17 00:00:00 2001 From: Jordan R Abrahams-Whitehead Date: Thu, 21 Jul 2022 20:38:10 +0000 Subject: llvm_tools: Remove unused patch_metadata_file arg This argument is not actually used anymore. Technically it was never actually needed and it was passed in other ways to the patch_manager.py even before the refactoring. This just removes it from one function's arguments. It's hard to clean the forwarded patch_metadata_file arg in every situation, so let's just do it for this function that we introduced. BUG=None TEST=./run_tests_for llvm_tools/ Change-Id: I5c3f2a217df082cd51362aa70c8b585ad5135e47 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/3780680 Tested-by: Jordan Abrahams-Whitehead Commit-Queue: Jordan Abrahams-Whitehead Reviewed-by: Manoj Gupta --- llvm_tools/modify_a_tryjob.py | 1 - llvm_tools/update_chromeos_llvm_hash.py | 6 +----- llvm_tools/update_chromeos_llvm_hash_unittest.py | 11 ++++------- llvm_tools/update_packages_and_run_tests.py | 4 +--- 4 files changed, 6 insertions(+), 16 deletions(-) (limited to 'llvm_tools') diff --git a/llvm_tools/modify_a_tryjob.py b/llvm_tools/modify_a_tryjob.py index cea81069..bed99933 100755 --- a/llvm_tools/modify_a_tryjob.py +++ b/llvm_tools/modify_a_tryjob.py @@ -119,7 +119,6 @@ def GetCLAfterUpdatingPackages(packages, git_hash, svn_version, chroot_path, git_hash, svn_version, chroot_path, - patch_metadata_file, failure_modes.FailureModes.DISABLE_PATCHES, svn_option, extra_commit_msg=None) diff --git a/llvm_tools/update_chromeos_llvm_hash.py b/llvm_tools/update_chromeos_llvm_hash.py index fe13f708..88257740 100755 --- a/llvm_tools/update_chromeos_llvm_hash.py +++ b/llvm_tools/update_chromeos_llvm_hash.py @@ -467,8 +467,7 @@ def StagePackagesPatchResultsForCommit(package_info_dict, commit_messages): def UpdatePackages(packages, llvm_variant, git_hash, svn_version, - chroot_path: Path, patch_metadata_file, mode, - git_hash_source, extra_commit_msg): + chroot_path: Path, mode, git_hash_source, extra_commit_msg): """Updates an LLVM hash and uprevs the ebuild of the packages. A temporary repo is created for the changes. The changes are @@ -480,8 +479,6 @@ def UpdatePackages(packages, llvm_variant, git_hash, svn_version, git_hash: The new git hash. svn_version: The SVN-style revision number of git_hash. chroot_path: The absolute path to the chroot. - patch_metadata_file: The name of the .json file in '$FILESDIR/' that has - the patches and its metadata. mode: The mode of the patch manager when handling an applicable patch that failed to apply. Ex. 'FailureModes.FAIL' @@ -674,7 +671,6 @@ def main(): git_hash, svn_version, args_output.chroot_path, - args_output.patch_metadata_file, failure_modes.FailureModes( args_output.failure_mode), git_hash_source, diff --git a/llvm_tools/update_chromeos_llvm_hash_unittest.py b/llvm_tools/update_chromeos_llvm_hash_unittest.py index 35872324..d4fbfb21 100755 --- a/llvm_tools/update_chromeos_llvm_hash_unittest.py +++ b/llvm_tools/update_chromeos_llvm_hash_unittest.py @@ -654,7 +654,6 @@ class UpdateLLVMHashTest(unittest.TestCase): git_hash = 'a123testhash4' svn_version = 1000 chroot_path = Path('/some/path/to/chroot') - patch_metadata_file = 'PATCHES.json' git_hash_source = 'google3' branch = 'update-LLVM_NEXT_HASH-a123testhash4' extra_commit_msg = None @@ -664,8 +663,7 @@ class UpdateLLVMHashTest(unittest.TestCase): with self.assertRaises(ValueError) as err: update_chromeos_llvm_hash.UpdatePackages( packages_to_update, llvm_variant, git_hash, svn_version, chroot_path, - patch_metadata_file, failure_modes.FailureModes.FAIL, - git_hash_source, extra_commit_msg) + failure_modes.FailureModes.FAIL, git_hash_source, extra_commit_msg) self.assertEqual(str(err.exception), 'Failed to uprev the ebuild.') @@ -733,10 +731,10 @@ class UpdateLLVMHashTest(unittest.TestCase): self.assertEqual(chroot_path, Path('/some/path/to/chroot')) self.assertEqual(svn_version, 1000) - self.assertEqual(patch_metadata_file, 'PATCHES.json') self.assertListEqual(packages, ['path/to']) self.assertEqual(mode, failure_modes.FailureModes.DISABLE_PATCHES) + patch_metadata_file = 'PATCHES.json' PatchInfo = collections.namedtuple('PatchInfo', [ 'applied_patches', 'failed_patches', 'non_applicable_patches', 'disabled_patches', 'removed_patches', 'modified_metadata' @@ -786,7 +784,6 @@ class UpdateLLVMHashTest(unittest.TestCase): llvm_variant = update_chromeos_llvm_hash.LLVMVariant.next git_hash = 'a123testhash5' svn_version = 1000 - patch_metadata_file = 'PATCHES.json' chroot_path = Path('/some/path/to/chroot') git_hash_source = 'tot' branch = 'update-LLVM_NEXT_HASH-a123testhash5' @@ -794,8 +791,8 @@ class UpdateLLVMHashTest(unittest.TestCase): change_list = update_chromeos_llvm_hash.UpdatePackages( packages_to_update, llvm_variant, git_hash, svn_version, chroot_path, - patch_metadata_file, failure_modes.FailureModes.DISABLE_PATCHES, - git_hash_source, extra_commit_msg) + failure_modes.FailureModes.DISABLE_PATCHES, git_hash_source, + extra_commit_msg) self.assertEqual(change_list.url, 'https://some_name/path/to/commit/+/12345') diff --git a/llvm_tools/update_packages_and_run_tests.py b/llvm_tools/update_packages_and_run_tests.py index 258a3950..1d122800 100755 --- a/llvm_tools/update_packages_and_run_tests.py +++ b/llvm_tools/update_packages_and_run_tests.py @@ -19,6 +19,7 @@ import failure_modes import get_llvm_hash import update_chromeos_llvm_hash + VALID_CQ_TRYBOTS = ['llvm', 'llvm-next', 'llvm-tot'] @@ -395,8 +396,6 @@ def main(): args_output = GetCommandLineArgs() - patch_metadata_file = 'PATCHES.json' - svn_option = args_output.llvm_version git_hash, svn_version = get_llvm_hash.GetLLVMHashAndVersionFromSVNOption( @@ -442,7 +441,6 @@ def main(): git_hash, svn_version, args_output.chroot_path, - patch_metadata_file, failure_modes.FailureModes.DISABLE_PATCHES, svn_option, extra_commit_msg=extra_commit_msg) -- cgit v1.2.3