nzw921rx opened a new pull request, #11384:
URL: https://github.com/apache/seatunnel/pull/11384
## Purpose of this pull request
Related #11007
1. Migrate EdgeSocket connector validation from imperative checks to
declarative `OptionRule + Conditions`
2. Use `SingleChoiceOption` for enum-like EdgeSocket options
3. Remove redundant runtime validation in `EdgeSocketConfig` where checks
are now covered by `optionRule()`
4. Add factory-level unit tests for positive and negative validation paths
5. Add an EdgeSocket E2E scenario that verifies commit watermark advancement
**Scope migrated:**
- `EdgeSocketSourceFactory`
- `EdgeSocketSourceOptions`
- `EdgeSocketConfig` (remove constructor-side config checks now handled by
`optionRule`)
- `EdgeSocketFactoryTest`
- `EdgeSocketConfigTest`
- EdgeSocket E2E watermark coverage
## Does this PR introduce _any_ user-facing change?
Yes, minor validation behavior improvements:
1. **Earlier and clearer submission-time validation**
- Rejects invalid configs at submission time instead of failing later at
runtime.
- Examples:
- `port` must be greater than `0`
- `token` must be non-blank
- `endpoint` must be blank or in `host:port` format
- `local_queue_capacity` must be greater than `0`
- `queue_backpressure_watermark_ratio` must be in `(0, 1]`
- `queue_full_retry_after_ms` must be greater than `0`
- `packet_mode` and `auth_type` are constrained by `SingleChoiceOption`
- `secret_key` must be valid Base64 and decode to 32 bytes when
`packet_mode=PACKET`
2. **Less duplicated runtime validation**
- `EdgeSocketConfig` now focuses on materializing config values.
- Validation that can be expressed declaratively is handled by
`optionRule()`.
3. **E2E coverage for watermark advancement**
- Adds an E2E path that sends sequential batches and asserts commit ACK
watermarks advance as expected.
## How was this patch tested?
```bash
./mvnw spotless:apply -pl
seatunnel-connectors-v2/connector-edge-socket,seatunnel-e2e/seatunnel-connector-v2-e2e/connector-edge-socket-e2e
./mvnw -pl seatunnel-connectors-v2/connector-edge-socket \
-DskipIT -Dskip.spotless=true test
./mvnw -pl
seatunnel-e2e/seatunnel-connector-v2-e2e/connector-edge-socket-e2e \
-DskipTests -DskipIT -Dskip.spotless=true test-compile
git diff --check
```
I also started `./mvnw -q -DskipTests verify`, but stopped it before
completion to submit the PR directly.
--
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]