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

   ### Purpose of this pull request
   
   Fixes #11657 — two related defects in the CLI's local routing validation 
(`validate_hocon`):
   
   **1. Transform blocks were invisible to plugin_output/plugin_input pairing 
validation.**
   
   `_extract_connector_blocks_raw` only scanned the `source` and `sink` 
sections, so labels emitted by transform blocks never reached 
`_validate_routing_pairs`. Every valid transform-mediated topology was falsely 
rejected:
   
   - chains: `source → Sql → sink` — the sink consuming the Sql transform's 
output label got `plugin_input "filtered" has no matching plugin_output in any 
source`;
   - predicate splits: one source feeding parallel Sql transforms (mutually 
exclusive WHERE clauses) routed to different sinks — both sink inputs falsely 
flagged.
   
   The impact goes beyond a wrong error message: `validate_hocon` drives the 
CLI's generate-validate-fix loop, so the false rejection sent auto-fix rounds 
"repairing" a correct config — typically degrading it (dropping the transform, 
rewiring the sink to the raw source label) until attempts were exhausted. 
Measured on the accuracy benchmark (#11553), the conditional-routing task 
category was heavily suppressed by this: correct model outputs could not pass 
local validation at all.
   
   Fix: include `transform` in the section scan. Labels emitted by transforms 
now participate in pairing validation; genuinely dangling `plugin_input` 
references are still rejected (covered by a regression test).
   
   **2. Routing validation was silently skipped when pyhocon is unavailable.**
   
   The `_validate_routing_pairs` call sites lived inside the two config-parsing 
branches (duplicate-connector raw path and pyhocon path). In an environment 
without pyhocon and without duplicate connector blocks, neither branch executed 
— configs with dangling labels validated as clean. Routing validation only 
needs the raw block text extracted by `_extract_connector_blocks_raw`, so it 
now runs unconditionally whenever blocks were extracted, independent of parser 
availability.
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes, two behavior corrections for `/check` and the generation-time 
validation loop:
   - Valid configs where sinks consume transform outputs (chains, splits) now 
pass local validation instead of being falsely rejected.
   - Configs with genuinely unmatched `plugin_input` labels are now 
consistently rejected even in installations without pyhocon (previously skipped 
silently).
   
   ### How was this patch tested?
   
   - Three new regression tests in `tests/test_validate_hocon_placeholders.py`: 
sink consuming a transform output (chain), predicate split via parallel 
transforms consuming the same source label, and a dangling `plugin_input` that 
must still be rejected. Full suite: 74 passed.
   - Manually verified against the exact config shape that a benchmarked model 
generated for a split task (Kafka source → two Sql transforms → two Kafka 
sinks): previously `INVALID` with two false routing errors, now `VALID`; the 
same config with an intentionally broken label is still rejected.
   - Verified in both parser environments (with and without pyhocon installed): 
validation outcome is now identical.
   


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