nzw921rx opened a new issue, #11007:
URL: https://github.com/apache/seatunnel/issues/11007

   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   
   
   ### Search before asking
   
   - [x] I had searched in the 
[issues](https://github.com/apache/seatunnel/issues?q=is%3Aissue+label%3A%22bug%22)
 and found no similar issues.
   
   
   ### Describe the proposal
   
   We need community help to migrate connector validation from imperative 
`if/throw` checks to declarative `optionRule()` + `Conditions.*`.
   
   If the `Issue` column shows an existing issue number, please claim in that 
issue.  
   If the `Issue` column shows `This issue`, please comment here to claim it.
   
   ## Prerequisites / Framework Status
   
   Phase 1 (framework) has been completed:
   
   - Design and scope audit: https://github.com/apache/seatunnel/issues/10976
   - Framework implementation: https://github.com/apache/seatunnel/pull/10977
   
   This umbrella issue is for **Phase 2 migration and tracking** only.
   
   ## How to claim
   
   1. Pick one connector row from the table below.
   2. Comment with:
      - connector/module name
      - scope (`Source`, `Sink`, or `Both`)
      - target branch: `dev`
   3. Open a PR within 4 weeks after claiming.
   4. Keep first PR small: one connector (or one side of a connector) per PR.
   
   Claim comment example:
   
   ```text
   I'd like to migrate connector-kafka validation to declarative OptionRule.
   Scope: Source
   Target branch: dev
   ```
   
   ## Migration Guide (with examples)
   
   ### A. Numeric range (common)
   
   Use declarative constraints for rules like `port > 0`, `batchSize >= 0`.
   
   ```java
   import static 
org.apache.seatunnel.api.configuration.util.Conditions.greaterThan;
   
   OptionRule.builder()
       .required(PORT, greaterThan(PORT, 0))
       .build();
   ```
   
   ### B1. Required cross-field comparison
   
   Use when both fields are mandatory and have relation constraints.
   
   ```java
   import static 
org.apache.seatunnel.api.configuration.util.Conditions.lessThanField;
   
   OptionRule.builder()
       .required(START_TIMESTAMP, END_TIMESTAMP, lessThanField(START_TIMESTAMP, 
END_TIMESTAMP))
       .build();
   ```
   
   ### B2. Optional cross-field comparison (important)
   
   Use when fields are not mandatory, but must satisfy relation when present.
   
   ```java
   import static 
org.apache.seatunnel.api.configuration.util.Conditions.lessOrEqualField;
   
   OptionRule.builder()
       .optional(MIN_VALUE, MAX_VALUE, lessOrEqualField(MIN_VALUE, MAX_VALUE))
       .build();
   ```
   
   Do not accidentally convert optional semantics into required semantics.
   
   ### C. Conditional value check
   
   Use when a trigger option enables another constraint.
   
   ```java
   import static 
org.apache.seatunnel.api.configuration.util.Conditions.greaterThan;
   
   OptionRule.builder()
       .conditional(
           IGNORE_NO_LEADER_PARTITION,
           true,
           greaterThan(PARTITION_DISCOVERY_INTERVAL_MILLIS, 0))
       .build();
   ```
   
   ### D. Keep runtime checks for out-of-scope cases
   
   Do not migrate these into declarative rules:
   
   - external system/state validation (DB/metastore/network reachability)
   - complex parser/semantic validation (SQL parsing, advanced regex semantics)
   - runtime context checks (current time, execution topology state)
   
   ### Task list
   
   - [ ] Claim connector work before implementation
   - [ ] Update `Contributor` and `Status` when claim is confirmed
   - [ ] Add PR link once work starts
   - [ ] Ensure each PR clearly states migrated rules and retained runtime-only 
checks
   
   ## Connectors Open for Claim
   
   | Type | Connector | Contributor | Status | Issue | PR |
   | --- | --- | --- | --- | --- | --- |
   | Source | connector-cdc | Todo | Todo | This issue |  |
   | Source | connector-edge-socket | Todo | Todo | This issue |  |
   | Source | connector-fake | Todo | Todo | This issue |  |
   | Source | connector-google-sheets | Todo | Todo | This issue |  |
   | Source | connector-openmldb | Todo | Todo | This issue |  |
   | Source | connector-web3j | Todo | Todo | This issue |  |
   | Sink | connector-activemq | Todo | Todo | This issue |  |
   | Sink | connector-aerospike | Todo | Todo | This issue |  |
   | Sink | connector-assert | Todo | Todo | This issue |  |
   | Sink | connector-bigquery | Todo | Todo | This issue |  |
   | Sink | connector-console | Todo | Todo | This issue |  |
   | Sink | connector-datahub | Todo | Todo | This issue |  |
   | Sink | connector-dingtalk | Todo | Todo | This issue |  |
   | Sink | connector-druid | Todo | Todo | This issue |  |
   | Sink | connector-email | Todo | Todo | This issue |  |
   | Sink | connector-fluss | Todo | Todo | This issue |  |
   | Sink | connector-google-firestore | Todo | Todo | This issue |  |
   | Sink | connector-hugegraph | Todo | Todo | This issue |  |
   | Sink | connector-hudi | Todo | Todo | This issue |  |
   | Sink | connector-lance | Todo | Todo | This issue |  |
   | Sink | connector-mqtt | Todo | Todo | This issue |  |
   | Sink | connector-s3-redshift | Todo | Todo | This issue |  |
   | Sink | connector-selectdb-cloud | Todo | Todo | This issue |  |
   | Sink | connector-sensorsdata | Todo | Todo | This issue |  |
   | Sink | connector-sentry | Todo | Todo | This issue |  |
   | Sink | connector-slack | Todo | Todo | This issue |  |
   | Both | connector-amazondynamodb | Todo | Todo | This issue |  |
   | Both | connector-amazonsqs | Todo | Todo | This issue |  |
   | Both | connector-cassandra | Todo | Todo | This issue |  |
   | Both | connector-clickhouse | Todo | Todo | This issue |  |
   | Both | connector-databend | Todo | Todo | This issue |  |
   | Both | connector-doris | Todo | Todo | This issue |  |
   | Both | connector-easysearch | Todo | Todo | This issue |  |
   | Both | connector-elasticsearch | Todo | Todo | This issue |  |
   | Both | connector-file | Todo | Todo | This issue |  |
   | Both | connector-graphql | Todo | Todo | This issue |  |
   | Both | connector-hbase | Todo | Todo | This issue |  |
   | Both | connector-hive | Todo | Todo | This issue |  |
   | Both | connector-http | Todo | Todo | This issue |  |
   | Both | connector-iceberg | Todo | Todo | This issue |  |
   | Both | connector-influxdb | Todo | Todo | This issue |  |
   | Both | connector-iotdb | Todo | Todo | This issue |  |
   | Both | connector-iotdb-v2 | Todo | Todo | This issue |  |
   | Both | connector-jdbc | Todo | Todo | This issue |  |
   | Both | connector-kafka | Todo | Todo | This issue |  |
   | Both | connector-kudu | Todo | Todo | This issue |  |
   | Both | connector-maxcompute | Todo | Todo | This issue |  |
   | Both | connector-milvus | Todo | Todo | This issue |  |
   | Both | connector-mongodb | Todo | Todo | This issue |  |
   | Both | connector-neo4j | Todo | Todo | This issue |  |
   | Both | connector-paimon | Todo | Todo | This issue |  |
   | Both | connector-prometheus | Todo | Todo | This issue |  |
   | Both | connector-pulsar | Todo | Todo | This issue |  |
   | Both | connector-qdrant | Todo | Todo | This issue |  |
   | Both | connector-rabbitmq | Todo | Todo | This issue |  |
   | Both | connector-redis | Todo | Todo | This issue |  |
   | Both | connector-rocketmq | Todo | Todo | This issue |  |
   | Both | connector-sls | Todo | Todo | This issue |  |
   | Both | connector-socket | Todo | Todo | This issue |  |
   | Both | connector-starrocks | Todo | Todo | This issue |  |
   | Both | connector-tablestore | Todo | Todo | This issue |  |
   | Both | connector-tdengine | Todo | Todo | This issue |  |
   | Both | connector-typesense | Todo | Todo | This issue |  |
   
   ## Note
   
   `connector-common` is a shared base module, not a standalone connector 
plugin, so it is excluded from claim rows.
   
   ### Are you willing to submit PR?
   
   - [x] Yes I am willing to submit a 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