ParkGyeongTae opened a new pull request, #5019:
URL: https://github.com/apache/zeppelin/pull/5019

   ### What is this PR for?
   This PR refactors zeppelin/dev/travis/save-logs.py and 
zeppelin/dev/travis/travis-install.sh to improve stability, readability, and 
maintainability, while ensuring compatibility with Python 3.
   
   For save-logs.py, it migrates the script from Python 2 syntax to Python 3, 
adds UTF-8 encoding, improves progress reporting, and enhances error handling.
   For travis-install.sh, it adds strict mode, better input validation, dynamic 
Python detection, and clearer error messages, making the script more robust in 
CI environments.
   
   ### What type of PR is it?
   Refactoring
   
   ### Todos
   * [x] - Migrate save-logs.py to Python 3 (UTF-8 encoding, line buffering, 
improved progress reporting, KeyboardInterrupt handling, safe text mode)
   * [x] - Add docstring to save-logs.py describing behavior and parameters
   * [x] - Add strict mode (set -Eeuo pipefail), safe IFS, and usage() function 
to travis-install.sh
   * [x] - Implement source directory validation, dynamic Python detection 
(python3 preferred, fallback to python), and save-logs.py existence check
   * [x] - Improve log output and warning messages when build fails
   
   ### What is the Jira issue?
   * Jira: https://issues.apache.org/jira/browse/ZEPPELIN-6271
   
   ### How should this be tested?
   Run the script in a local environment with a valid Zeppelin source directory:
   ```bash
   ./travis-install.sh /Users/pgt0409/Desktop/git/zeppelin bash -lc './mvnw -v 
|| mvn -v'
   ```
   
   Verify that:
   - install.txt contains the Maven version output.
   - Progress is displayed in the console during execution.
   - The script exits with status 0 when successful.
   
   Example install.txt output:
   ```bash
   # install.txt
   Apache Maven 3.9.9 (8e8579a9e76f7d015ee5ec7bfcdc97d260186937)
   Maven home: 
/Users/pgt0409/.m2/wrapper/dists/apache-maven-3.9.9-bin/33b4b2b4/apache-maven-3.9.9
   Java version: 11.0.27, vendor: Homebrew, runtime: 
/opt/homebrew/Cellar/openjdk@11/11.0.27/libexec/openjdk.jdk/Contents/Home
   Default locale: ko_KR, platform encoding: UTF-8
   OS name: "mac os x", version: "15.6", arch: "aarch64", family: "mac"
   ```
   
   ### Screenshots (if appropriate)
   N/A
   
   ### Questions:
   * Does the license files need to update? No.
   * Is there breaking changes for older versions? No.
   * Does this needs documentation? No.
   


-- 
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: reviews-unsubscr...@zeppelin.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to