diff --git a/dev/is-changed.py b/dev/is-changed.py index 1962e244d5dd7..7231db43ba779 100755 --- a/dev/is-changed.py +++ b/dev/is-changed.py @@ -65,6 +65,21 @@ def main(): changed_files = identify_changed_files_from_git_commits( os.environ["GITHUB_SHA"], target_ref=os.environ["GITHUB_PREV_SHA"] ) + + if any(f.endswith(".jar") for f in changed_files): + with open( + os.path.join(os.path.dirname(os.path.realpath(__file__)), "test-jars.txt") + ) as jarlist: + itrsect = set((line.strip() for line in jarlist.readlines())).intersection( + set(changed_files) + ) + if len(itrsect) > 0: + raise SystemExit( + f"Cannot include jars in source codes ({', '.join(itrsect)}). " + "If they have to be added temporarily, " + "please add the file name into dev/test-jars.txt." + ) + changed_modules = determine_modules_to_test( determine_modules_for_files(changed_files), deduplicated=False )