imzzacc opened a new pull request, #13125:
URL: https://github.com/apache/seatunnel/pull/13125

   ## Summary
   
   Fixes #13016. PR #12898 made `seatunnel.sh` and `seatunnel-application.sh` 
exit `0` on help by adding a help exit code to `CommandLineUtils.parse`. The 
remaining native entrypoints still exited with `USAGE_EXIT_CODE` (234) after 
successfully printing usage. This applies the same explicit help exit code to 
`seatunnel-cluster.sh`, `seatunnel-connector.sh`, 
`seatunnel-metadata-export.sh`, and the Edge Agent main / `db` commands.
   
   ## What changed
   
   - `CommandLineUtils`: new overload taking `(args, obj, programName, 
acceptUnknownOptions, helpExitCode)` for entrypoints without a command 
validator.
   - `SeaTunnelServer`, `SeaTunnelConnector`, `SeaTunnelMetadataExporter`: pass 
`HELP_EXIT_CODE = 0`.
   - `EdgeAgentCommandLineUtils`: `parse` accepts a help exit code; argument 
errors still exit with the usage code, only help uses the override.
   - `EdgeAgentTopLevelCommand`: passes `0` so main help, DB help flags and `db 
help` all exit `0`.
   - `NativeEntrypointHelpExitCodeTest`: covers the three starters plus two 
guard cases.
   
   Shell scripts are unchanged — they `exec java`, so the exit code passes 
through. The Flink/Spark Java starters keep `234` as required by the issue's 
non-goals.
   
   ## How I verified
   
   ```
   mvn -pl seatunnel-core/seatunnel-starter -am -DskipTests install
   mvn -pl seatunnel-core/seatunnel-starter test
   ```
   
   - `seatunnel-starter`: 99 tests, 0 failures, including 5 new ones:
     - `--help` on the server, connector and metadata-export entrypoints exits 
`0`
     - the default `parse` overload still exits `234` for help, so the 
Flink/Spark launcher protocol is untouched
     - a missing option value (`-cn`) still exits `234`, so an argument error 
is never reported as a successful help
   - `seatunnel-edge-agent-starter` compiles (`-am -DskipTests install`, BUILD 
SUCCESS).
   
   ## Notes for reviewers
   
   - The Edge Agent change is compile-verified only. That module has no 
`system-lambda` test dependency, so asserting `System.exit` would mean adding a 
dependency — I did not do that here; say the word and I will add it with the 
test.
   - I did not run the shell scripts end to end against a packaged 
distribution; they `exec java` and pass the code through, and 
`SeaTunnelClusterScriptTest` already exercises that path.
   


-- 
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]

Reply via email to