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

   ### Purpose of this pull request
   
   Closes #12533.
   
   Config validation reports unresolved `${ENV_VAR}` placeholders so that a 
placeholder never reaches a connector as a literal string. It decided whether a 
variable was set with a truthiness test:
   
   ```python
   if not os.environ.get(var_name):
       unresolved_vars.add(var_name)
   ```
   
   so a variable that *is* exported but holds an empty value was reported as 
still needing to be exported:
   
   ```
   $ export DORIS_PASSWORD=
   ERROR: Unresolved environment variables: DORIS_PASSWORD.
          Set them before running: export DORIS_PASSWORD=<value>
   ```
   
   An empty value is a resolved value, and passwordless accounts are normal 
rather than exotic — Doris and StarRocks default to `root` with no password, 
Elasticsearch to no auth — so a correct config for those endpoints could not 
pass validation, and the message could not be satisfied: the variable was 
already exported. Test for presence instead of truthiness.
   
   The benchmark runner had the matching omission. It exports the docker 
environment's credentials before validating so that `${MYSQL_PASSWORD}`-style 
placeholders count as resolved, but skipped the entries whose value is empty, 
which is why the Doris and StarRocks tasks failed on validation rather than on 
anything the model produced.
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes, in the unreleased `dev` branch only. A config referencing an 
environment variable that is exported with an empty value now passes validation 
instead of reporting an unresolved placeholder. A variable that is not exported 
at all is still reported, unchanged.
   
   ### How was this patch tested?
   
   New unit tests in `seatunnel-cli/tests/test_config_validation.py` cover the 
three states — unset (reported), set (accepted), and set-but-empty (accepted). 
The set-but-empty case was confirmed to fail against the truthiness check and 
pass against the presence check, so it pins the behaviour rather than merely 
describing it.
   
   The existing `seatunnel-cli` suite passes (195 tests, 3 subtests).
   
   Measured effect on the benchmark, the two tasks this unblocks, `--level l1`, 
`claude-haiku-4.5` via Bedrock:
   
   | Task | Before | After |
   |------|--------|-------|
   | `t1_pg_doris` | fail — `Unresolved environment variables: DORIS_PASSWORD` 
| pass |
   | `t3_cr_amount_split` | fail — `Unresolved environment variables: 
JDBC_PASSWORD, JDBC_USER` | pass |
   
   Both failures were validation artifacts, not model output.
   
   Note that `benchmark/runner.py` is also touched by the PR for #12534, in a 
different hunk of the same function; they cherry-pick over each other cleanly 
in either order.
   
   ### Check list
   
   * [x] If any new Jar binary package adding in your PR, please add License 
Notice according
     [New License 
Guide](https://github.com/apache/seatunnel/blob/dev/docs/en/developer/new-license.md)
   * [x] If necessary, please update the documentation to describe the new 
feature. https://github.com/apache/seatunnel/tree/dev/docs
   * [x] If necessary, please update `incompatible-changes.md` to describe the 
incompatibility caused by this PR.
   


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