andygrove commented on code in PR #2473:
URL: 
https://github.com/apache/datafusion-ballista/pull/2473#discussion_r4076260618


##########
dev/release/run-rat.sh:
##########
@@ -31,7 +31,15 @@ RELEASE_DIR=$(cd "$(dirname "$BASH_SOURCE")"; pwd)
 
 # generate the rat report
 $RAT $1 > rat.txt
-python $RELEASE_DIR/check-rat-report.py $RELEASE_DIR/rat_exclude_files.txt 
rat.txt > filtered_rat.txt
+python3 $RELEASE_DIR/check-rat-report.py $RELEASE_DIR/rat_exclude_files.txt 
rat.txt > filtered_rat.txt
+CHECK_STATUS=$?
+
+# 0 = approved, 1 = unapproved files (reported below), anything else = did not 
run.
+if [ "${CHECK_STATUS}" -ne 0 ] && [ "${CHECK_STATUS}" -ne 1 ]; then

Review Comment:
   Thanks for tracking these down, the rat one especially is a nasty silent 
pass! One gap I noticed: Python exits with 1 on an uncaught exception too, so 
if `rat.txt` ends up empty or malformed (say the jar download or the `java` 
call fails), `check-rat-report.py` crashes with a parse error, exits 1, and we 
land in the "unapproved files" branch with zero `NOT APPROVED` lines. That 
still prints "No unapproved licenses". Could we also fail when the status is 1 
but no `NOT APPROVED` lines came out? Something like `if [ "${CHECK_STATUS}" 
-eq 1 ] && [ "${UNAPPROVED}" -eq 0 ]; then echo "check-rat-report.py failed; 
see rat.txt"; exit 1; fi` should cover it.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to