nzw921rx opened a new pull request, #12824: URL: https://github.com/apache/seatunnel/pull/12824
Closes #11052 ### Purpose of this pull request Phase 2 of #11052: `Condition` becomes the single model used to build, store, evaluate and render conditional option rules, and the deprecated `Expression` type is removed. * `OptionRule.Builder` keys conditional rules by `Condition<?>` and builds chains with `Condition.of(...)` / `and` / `or`. * `ConditionRule` and `RequiredOption.ConditionalRequiredOptions` store a `Condition<?>` and expose `getCondition()`; `ConfigValidator` evaluates the `Condition` chain only. * The Zeta REST option-rule service and the `seatunnel.sh` metadata export read conditions via `getCondition()`; the response fields and expression tree structure are unchanged. * `Expression` and its entry points are removed: `ConfigValidator.validate(OptionRule, Expression)`, `ConditionalRequiredOptions.of(Expression, List)`, `ConditionalRequiredOptions.getExpression()`, `new ConditionRule(Expression, OptionRule)`, `ConditionRule.getExpression()` and the `Expression` class itself. * In-repo tests build option rules with `Condition` instead of `Expression`. ### Does this PR introduce *any* user-facing change? Yes. Conditional rules that mix AND and OR now follow `Condition`'s AND-before-OR precedence: `A.and(B).or(C)` evaluates and renders as `(A && B) || C`, while the legacy `Expression` path evaluated the same chain right-associatively as `A && (B || C)` and grouped parentheses differently. Validation messages and the REST/CLI metadata therefore use `Condition` rendering. The removed `Expression` type and APIs make code that imports or calls them fail to compile. Both changes are documented in `docs/en/introduction/concepts/incompatible-changes.md` and `docs/zh/introduction/concepts/incompatible-changes.md`, including the migration guide. ### How was this patch tested? * `./mvnw spotless:apply` * `./mvnw -pl seatunnel-api test` (409 tests) * `./mvnw -pl seatunnel-engine/seatunnel-engine-server test -Dtest=OptionRulesServiceTest` (12 tests) and `-Dtest=OptionRulesApiTest` (4 tests) * `./mvnw -pl seatunnel-core/seatunnel-starter test -Dtest=MetadataExportCommandTest` (1 test) * `./mvnw -pl seatunnel-connectors-v2/connector-file/connector-file-s3 test -Dtest=S3FileFactoryTest` (5 tests) * `./mvnw -pl seatunnel-engine/seatunnel-engine-server,seatunnel-core/seatunnel-starter,seatunnel-connectors-v2/connector-file/connector-file-s3 -am -DskipTests -Dskip.ui=true -Dskip.spotless=true package` `./mvnw verify` was not executed; the compile and test checks above were used instead. ### Check list * [x] No new Jar binary package is added. * [x] Documentation updated (en and zh incompatible changes). * [x] The incompatible change is documented with a migration guide. * [x] This change does not involve connector runtime behavior. -- 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]
