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

   ### Purpose of this pull request
   
   DB2 CDC currently accepts an empty or whitespace-only `url` during factory 
validation and leaves the failure to runtime. This PR adds 
`Conditions.notBlank(URL)` to the existing required URL rule, following the 
approved DB2 Source-only scope in #11007: 
https://github.com/apache/seatunnel/issues/11007#issuecomment-6168243222.
   
   The existing `base-url` fallback, canonical-key precedence, and supplied 
nonblank values are preserved. English and Chinese DB2 CDC documentation now 
state the nonblank requirement. Table selection, startup/stop rules, 
credentials, parsing, connection/retry behavior, and runtime checks are 
unchanged.
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes. For example, `url = "   "` now produces an `OptionValidationException` 
at the factory validation boundary. An absent URL remains invalid, and nonblank 
URLs, including padded values and the existing fallback key, remain accepted 
without trimming or normalization.
   
   ### How was this patch tested?
   
   Extended the existing `Db2IncrementalSourceFactoryTest` using the actual 
factory rule through `ConfigValidator`, including unknown-key validation:
   
   - Canonical `url` and legacy `base-url`: nonblank and padded nonblank values 
are accepted unchanged.
   - Both keys independently reject empty, spaces-only, tab-only, newline-only, 
and mixed-whitespace values.
   - Missing URL is rejected.
   - A valid canonical URL takes precedence over a blank fallback.
   - A blank canonical URL is rejected even when the fallback is valid.
   
   Before adding the rule, the factory class ran 19 cases with 11 failures: the 
10 blank-value cases and the blank-canonical/valid-fallback case were 
incorrectly accepted. After adding the rule, all 19 factory cases pass. The 
complete DB2 module passes 24 tests with no failures, errors, or skips.
   
   Local validation used JDK 11:
   
   ```text
   mvn -pl seatunnel-connectors-v2/connector-cdc/connector-cdc-db2 -am 
-DskipTests install
   mvn -pl seatunnel-connectors-v2/connector-cdc/connector-cdc-db2 
-Dtest=Db2IncrementalSourceFactoryTest test
   mvn spotless:apply
   mvn -pl seatunnel-connectors-v2/connector-cdc/connector-cdc-db2 verify
   git diff --check
   ```
   
   Repository-wide `mvn -q -DskipTests verify` is still running locally; its 
result has not been reported as a pass. No live DB2 service is required for the 
factory tests.
   
   ### Check list
   
   - [x] EN/ZH connector documentation updated.
   - [x] Regression and compatibility tests added to the existing test class.
   - No new dependency or binary was added.
   - Connector registration, distribution, CI labels, and plugin configuration 
are unchanged because this updates an existing factory rule.
   - Valid option names, defaults, and configuration alternatives are preserved.
   


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