From 025be13f485c217e29020bbf94c51f3aa8db60d7 Mon Sep 17 00:00:00 2001 From: Hyukjin Kwon Date: Thu, 27 Mar 2025 09:26:51 +0900 Subject: [PATCH 1/5] Add a check for jars in CI --- dev/is-changed.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/dev/is-changed.py b/dev/is-changed.py index 1962e244d5dd7..d092ed7aeba60 100755 --- a/dev/is-changed.py +++ b/dev/is-changed.py @@ -65,6 +65,15 @@ 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 os.path.join(os.path.dirname(os.path.realpath(__file__)), 'test-jars.txt') as f: + inter = set(f.readlines()).intersection(set(changed_files)) + if inter: + raise RuntimeError( + "Cannot include jars in source codes. If this has 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 ) From 82f75fec4bdd58d45f6d69c2c18bbe097590caf4 Mon Sep 17 00:00:00 2001 From: Hyukjin Kwon Date: Thu, 27 Mar 2025 09:27:33 +0900 Subject: [PATCH 2/5] Testing a jar removal --- data/artifact-tests/smallJar.jar | Bin 787 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100755 data/artifact-tests/smallJar.jar diff --git a/data/artifact-tests/smallJar.jar b/data/artifact-tests/smallJar.jar deleted file mode 100755 index 3c4930e8e9549d17b89cd3ecb028f048f331797c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 787 zcmWIWW@Zs#;Nak3;B`q1V?Y9&3@i-3t|5-Po_=on|4uP5Ff#;rvvYt{FhP|C;M6Pv zQ~}rQ>*(j{<{BKL=j-;__snS@Z(Y5MyxzK6=gyqp9At3C_`%a6JuhD!Pv48Bt5~=- zGJdG3sV|$Zre*P5T=a>!>NJL_S)Yo2s--=9Y4u!1Ogvh%V#%{7Puic0KV9;ov88fn z#ZIuxZY!%bM*!`O1!9EDemkRjOB5*Uk(!f}AD&;7lcMjNn3<=SoRe5woEzZleb_;u z_VyCb$!^in!S>u$0*ly-zXW_#>SzyZ?U1v{y|pywrizg8(fLc+S^57l)K9UHZdEGb zH@42df2MkK{C)ZP41E{M6Bj;R&^wjQN^e)h)`z!W7)Bg7ntGJ8S@6w$gBiv)%d@k6837p&!nCF`FoeDuXJ<;J{{#cR$Sf8>+3$yn*r!e^Bm zE^gTPEKydP=WOx9kZqr*Jk3fIWw?I+rt^Nx1*oYhs(c&MlVRD=w$M3}(LkPSYyntETa(ug&Ef z#CKgdC$g5yq~lV{clW!iqZpryZteTXR_s^)lJjbaZTZTe$bXEW_}{hZ_5o!^28IpF From 2eb5d979576dc8346e421676898e280aee0b0845 Mon Sep 17 00:00:00 2001 From: Hyukjin Kwon Date: Thu, 27 Mar 2025 09:36:22 +0900 Subject: [PATCH 3/5] fix --- dev/is-changed.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/dev/is-changed.py b/dev/is-changed.py index d092ed7aeba60..2c5f71210b1ad 100755 --- a/dev/is-changed.py +++ b/dev/is-changed.py @@ -67,12 +67,17 @@ def main(): ) if any(f.endswith(".jar") for f in changed_files): - with os.path.join(os.path.dirname(os.path.realpath(__file__)), 'test-jars.txt') as f: - inter = set(f.readlines()).intersection(set(changed_files)) - if inter: - raise RuntimeError( - "Cannot include jars in source codes. If this has to be added temporarily, " - "please add the file name into dev/test-jars.txt.") + with open( + os.path.join(os.path.dirname(os.path.realpath(__file__)), "test-jars.txt") + ) as jarlist: + inter = set((line.strip() for line in jarlist.readlines())).intersection( + set(changed_files) + ) + if len(inter) > 0: + raise SystemExit( + "Cannot include jars in source codes. If this has 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 From 3f751ee0363873c8603faaed8bdbca84bfeed637 Mon Sep 17 00:00:00 2001 From: Hyukjin Kwon Date: Thu, 27 Mar 2025 09:36:37 +0900 Subject: [PATCH 4/5] Revert "Testing a jar removal" This reverts commit 82f75fec4bdd58d45f6d69c2c18bbe097590caf4. --- data/artifact-tests/smallJar.jar | Bin 0 -> 787 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100755 data/artifact-tests/smallJar.jar diff --git a/data/artifact-tests/smallJar.jar b/data/artifact-tests/smallJar.jar new file mode 100755 index 0000000000000000000000000000000000000000..3c4930e8e9549d17b89cd3ecb028f048f331797c GIT binary patch literal 787 zcmWIWW@Zs#;Nak3;B`q1V?Y9&3@i-3t|5-Po_=on|4uP5Ff#;rvvYt{FhP|C;M6Pv zQ~}rQ>*(j{<{BKL=j-;__snS@Z(Y5MyxzK6=gyqp9At3C_`%a6JuhD!Pv48Bt5~=- zGJdG3sV|$Zre*P5T=a>!>NJL_S)Yo2s--=9Y4u!1Ogvh%V#%{7Puic0KV9;ov88fn z#ZIuxZY!%bM*!`O1!9EDemkRjOB5*Uk(!f}AD&;7lcMjNn3<=SoRe5woEzZleb_;u z_VyCb$!^in!S>u$0*ly-zXW_#>SzyZ?U1v{y|pywrizg8(fLc+S^57l)K9UHZdEGb zH@42df2MkK{C)ZP41E{M6Bj;R&^wjQN^e)h)`z!W7)Bg7ntGJ8S@6w$gBiv)%d@k6837p&!nCF`FoeDuXJ<;J{{#cR$Sf8>+3$yn*r!e^Bm zE^gTPEKydP=WOx9kZqr*Jk3fIWw?I+rt^Nx1*oYhs(c&MlVRD=w$M3}(LkPSYyntETa(ug&Ef z#CKgdC$g5yq~lV{clW!iqZpryZteTXR_s^)lJjbaZTZTe$bXEW_}{hZ_5o!^28IpF literal 0 HcmV?d00001 From 37839d2eb71458b36fadfcde9b53fee890289c4e Mon Sep 17 00:00:00 2001 From: Hyukjin Kwon Date: Thu, 27 Mar 2025 12:05:23 +0900 Subject: [PATCH 5/5] Address a comment --- dev/is-changed.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dev/is-changed.py b/dev/is-changed.py index 2c5f71210b1ad..7231db43ba779 100755 --- a/dev/is-changed.py +++ b/dev/is-changed.py @@ -70,12 +70,13 @@ def main(): with open( os.path.join(os.path.dirname(os.path.realpath(__file__)), "test-jars.txt") ) as jarlist: - inter = set((line.strip() for line in jarlist.readlines())).intersection( + itrsect = set((line.strip() for line in jarlist.readlines())).intersection( set(changed_files) ) - if len(inter) > 0: + if len(itrsect) > 0: raise SystemExit( - "Cannot include jars in source codes. If this has to be added temporarily, " + 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." )