Repository navigation
[Test][Connector-V2] Respect source-only JDBC option scope - #12875
hutiefang76 wants to merge 3 commits into
Conversation
Exclude the documented source-only numeric option from inherited sink completeness coverage and assert its actual factory key scope. Fixes apache#12874
DanielLeens
left a comment
There was a problem hiding this comment.
Thanks for the quick follow-up on the fallout from #12792, @hutiefang76. This is a small and well-scoped test fix, and I reviewed the full diff against the current dev.
What Problem Does This PR Solve?
JdbcOptionRuleCompletenessTest collects options reflectively from JdbcSinkOptions, which inherits JdbcCommonOptions. After #12792 added numeric_special_value_as_null to the common options (declared only in the source rule), the sink completeness test started to demand it in the sink rule, so dev is red. The PR scopes that key out of the sink check and adds a guard that the key stays accepted by the source and rejected by the sink.
1. Code Change Review
1.1 Core logic
- Before:
collectOptionKeys(JdbcSinkOptions.class, Collections.emptySet())(every inherited key must be in the sink rule). - After:
collectOptionKeys(JdbcSinkOptions.class, NOT_SINK_OPTIONS)withNOT_SINK_OPTIONS = {numeric_special_value_as_null}, mirroring the existingNOT_SOURCE_OPTIONS(JdbcOptionRuleCompletenessTest.java, around lines 59-70). - New test
testSourceOnlyOptionRejectedBySinkRuleuses the realJdbcSourceFactory/JdbcSinkFactoryoption rules withConfigValidator.validateUnknownKeys: the source accepts the key, the sink throwsOptionValidationExceptionnaming the key. Runtime path: test-only, no production class is touched.
1.2 Compatibility
Fully compatible. Only a test class changes; no option, default or parsing behavior moves.
1.3 Performance / side effects
None (test only).
1.4 Error handling / logging
No issues. The assertion message includes the key and actual exception text, which is helpful for diagnosis.
Issues: none blocking. (Informational) The guard is deliberately one-directional for this single key; if more source-only keys appear later, adding them to NOT_SINK_OPTIONS plus a similar guard is the natural extension.
2. Code Quality Assessment
- 2.1 Standards: Javadoc on the class and the new constant explains why the exclusion exists; imports are explicit. Good.
- 2.2 Tests: the guard fails if the sink starts declaring the key or the source stops declaring it, and the exclusion cannot silently widen because only that one key is listed. Stability: Stable (strictness of the existing test is preserved for every other inherited sink option; the only relaxation is the single documented key, with a compensating guard).
- 2.3 Docs: not applicable (no user-visible change).
3. Architectural Soundness
Consistent with the existing scoped-exclusion pattern on the source side; minimal and focused.
4. Issue Summary
| # | Severity | Location | Summary |
|---|---|---|---|
| - | - | - | No code issues found |
5. Merge Recommendation
Conclusion: Ready to merge after fixes
Blockers:
- CI has not run. CI state (head
6b4777e7): the apache-sideBuildcheck isaction_requiredwith "Workflow run detection failed": noBuildrun was found in your fork for this head commit, so none of the compile/unit/IT jobs have actually executed.Notify test workflowandlabelerare green. Could you please enable GitHub Actions on your fork (Actions tab) and push/re-run so theBuildworkflow runs for this head? The branch is 0 commits behinddev, so no sync is needed.
Non-blocking: none.
|
Thanks for catching this. I added The fix here looks right to me. |
|
Thanks @fatmanverse for the precise root cause, and @nzw921rx for catching the CI state — both confirmed my own read of the diff. To close the loop on the two open threads:
If you hit trouble enabling workflows in the fork, feel free to say so here — several people have hit this and there's usually a quick fix. |
|
I checked the fork again on this PR’s current head, The full local JDBC suite passed (1,154 tests, 0 failures/errors, 6 existing conditional skips), including the source/sink option checks. I’m still treating remote CI as pending. Is there an upstream-side way to run the checks for this head while the fork dispatch is blocked? |
|
Thanks for digging into this, @hutiefang76, and for the precise check on the fork side. A few facts that may help narrow it down:
Things worth checking on your side (I cannot see these from here, so this is a suggestion, not a diagnosis):
Your local run of the full JDBC suite (1,154 tests, 0 failures) plus the diff review is good evidence for the change itself, and my source-side conclusion remains: no blockers. A committer will still want the |
…on-scope-20261019
|
The fork-wide Actions gate was still disabled on the Actions page despite the permissions API reporting enabled and Build active. Re-enabling it there restored actual execution. I pushed Build on this head is now executing. The Linux JDK 11/17 unit jobs and edge-agent builds fail in the same unrelated |
DanielLeens
left a comment
There was a problem hiding this comment.
Thanks for the follow-up push, @hutiefang76, and for working through the fork Actions gate so the Build workflow now actually executes. I re-reviewed the full diff at the new head c5a11f77 (the branch is now merged with dev at 1ce2d781; the PR is 2 commits ahead and 0 behind).
What Problem Does This PR Solve?
JdbcOptionRuleCompletenessTest reflects options from JdbcSinkOptions, which inherits JdbcCommonOptions. Since #12792 added numeric_special_value_as_null (declared only in the source rule), the sink completeness test demands it in the sink rule and dev goes red. The PR scopes that key out of the sink check and adds a guard that the key stays accepted by the source and rejected by the sink.
1. Code Change Review
1.1 Core logic
testSinkRuleDeclaresAllSinkOptionsnow callscollectOptionKeys(JdbcSinkOptions.class, NOT_SINK_OPTIONS)withNOT_SINK_OPTIONS = {numeric_special_value_as_null}, mirroring the existingNOT_SOURCE_OPTIONS.- New
testSourceOnlyOptionRejectedBySinkRuleuses the realJdbcSourceFactory/JdbcSinkFactoryoption rules withConfigValidator.validateUnknownKeys: the source accepts the key, the sink throwsOptionValidationExceptionwhose message names the key. - Runtime path: test-only; no production class is touched (
gh pr diffshows exactly one file). The Javadoc was extended since my last read to explain the scoped-exclusion contract; it is accurate.
1.2 Compatibility
Fully compatible. Only a test class changes; no option, default or parsing behavior moves.
1.3 Performance / side effects
None.
1.4 Error handling and logging
The assertion message includes the key and the actual exception text. No issues.
Status of my earlier points
- Earlier source-side conclusion: no code blockers. Still holds on the new head.
- Earlier blocker "CI has not run": resolved.
Buildnow runs on the fork (run 39427092019). It is not green, see below.
2. Code Quality
2.1 Standards
Explicit imports, Javadoc on the class and the new constant, spotless is expected to be clean (the Build run got past formatting into the unit-test stage).
2.2 Tests and stability
- The new guard fails if the sink ever starts declaring the key, or if the source stops declaring it. The exclusion cannot widen silently because exactly one key is listed. The strictness of the existing sink completeness test is preserved for every other inherited option.
- Stability rating for the touched tests (
JdbcOptionRuleCompletenessTest.java, theNOT_SINK_OPTIONSconstant andtestSourceOnlyOptionRejectedBySinkRule): Stable.
2.3 Docs
Not applicable (test-only, no user-visible change).
3. Architectural Soundness
Consistent with the existing source-side scoped exclusion; minimal and focused.
CI state for head c5a11f77
The Apache-side Build check is fail; it is a pointer to the fork run, so I read the real jobs in the fork:
unit-test(JDK 11 and 17, Ubuntu and Windows) and bothedge-agent-itjobs fail in the same single case,LLMBooleanOutputTest.readsLegacyFactoryWrapperWithValidationDisabled(InvalidClassException ... AbstractMultiCatalogTransform; local class incompatible: stream classdesc serialVersionUID = 7090258061839605137, local class serialVersionUID = -3241928148724104003). That test and the transform sources it touches are not in this diff (seatunnel-transforms-v2, merged earlier in #12194), and your note that it also reproduces on unmodifieddev(tracked as #12929) matches the log. The JDBC unit tests are not the failing ones.updated-modules-integration-test-part-8 (17, ubuntu-latest)fails inMetalakeIT.startUp:158with aConditionTimeoutafter ~969 s while starting its container, which is an environment/startup timeout in an IT that this test-only change cannot influence.mysql-cdc-connector-it (11)was cancelled.
So I read the red state as unrelated to the diff, but it is still red, and I cannot call the PR mergeable until it is green. One more point from the thread: @nzw921rx's latest comment points at a required process screenshot that I cannot render here, so please follow what it asks.
4. Issue Summary
| # | Severity | Location | Summary |
|---|---|---|---|
| - | - | - | No code issues found. |
5. Merge Recommendation
Conclusion: Ready to merge after fixes
Blockers (CI only, not source):
Buildmust be green on the final head. Currently red onLLMBooleanOutputTest(pre-existing ondev, #12929) and aMetalakeITstartup timeout. Once #12929 is fixed ondevand this branch is synced (or the flaky IT is re-run), the PR should be good to go.
Non-blocking: none. Nice work keeping this PR to a single focused test file.
DanielLeens
left a comment
There was a problem hiding this comment.
Thanks for keeping this branch current, @hutiefang76. The new head e0785877 is a merge of the latest dev (bab2d089, the Parquet NPE fix #11516) into your branch, and I re-read the whole current diff rather than only the delta.
What Problem Does This PR Solve?
- User pain point: since #12792 added
numeric_special_value_as_nullto the sharedJdbcCommonOptions(declared only in the source rule),JdbcOptionRuleCompletenessTest.testSinkRuleDeclaresAllSinkOptionsdemands it in the sink rule and fails ondev. - Fix approach: scope the key out of the sink completeness check with
NOT_SINK_OPTIONS, and add a guard that the key stays accepted by the source rule and rejected by the sink rule. - Summary: a one-file, test-only repair that restores a green JDBC option completeness check without weakening it for any other option.
1. Code Change Review
1.1 Core logic
testSinkRuleDeclaresAllSinkOptionsnow collects sink keys withNOT_SINK_OPTIONS = {numeric_special_value_as_null}, mirroring the existingNOT_SOURCE_OPTIONS.testSourceOnlyOptionRejectedBySinkRuleruns the realJdbcSourceFactory/JdbcSinkFactoryoption rules throughConfigValidator.validateUnknownKeys: the source accepts the key, the sink throwsOptionValidationExceptionwhose message names the key.- Runtime path: test-only.
gh pr diffshows exactly one file (JdbcOptionRuleCompletenessTest.java); no production class, option default or parsing behavior moves. - Since my last read the only new content is the merge from
dev(ahead_by 3, behind_by 0); the test file diff is identical to the one I reviewed atc5a11f77.
1.2 Compatibility
Fully compatible. No option, default, SPI or serialization change.
1.3 Performance and side effects
None (test only).
1.4 Error handling and logging
The guard's assertion message includes the key and the actual exception text, which makes a future regression easy to diagnose. No issues.
Status of earlier points
- Source-side conclusion: no code issues; still holds on this head.
- Process request from @nzw921rx (follow the required CI process shown in the screenshot): the fork
Buildis now executing for this head, so the CI-enablement part is resolved.
2. Code Quality
2.1 Standards
Explicit imports, Javadoc on the class and on the new constant explaining the scoped-exclusion contract. Nothing to add.
2.2 Tests and stability
- The new guard fails if the sink starts declaring the key or the source stops declaring it, and the exclusion cannot silently widen because exactly one key is listed. Strictness of the existing sink completeness check is preserved for every other inherited option.
- Stability rating for
JdbcOptionRuleCompletenessTest.java(theNOT_SINK_OPTIONSconstant andtestSourceOnlyOptionRejectedBySinkRule): Stable. No sleeps, ports, containers or ordering dependence.
2.3 Docs
Not applicable (test-only, no user-visible change).
3. Architectural soundness
Consistent with the existing source-side scoped exclusion; minimal and focused, one problem per PR.
CI state for head e0785877
At the time of this review the apache-side Build check is pending and the fork run for this exact head (queued as run 39545233263 in your fork) had not started executing jobs yet, so there is no result to judge. I am not drawing any conclusion from the previous head's result for this one. For awareness, the previous head failed only in LLMBooleanOutputTest.readsLegacyFactoryWrapperWithValidationDisabled (InvalidClassException on AbstractMultiCatalogTransform), which this diff does not touch; #12929 tracking it is still open, so dev itself is expected to keep that one unit-test case red until it is fixed. Please rerun only the failed jobs once the run finishes if something unrelated shows up.
4. Issue Summary
| # | Severity | Location | Summary |
|---|---|---|---|
| - | - | - | No code issues found. |
5. Merge Recommendation
Conclusion: Ready to merge after fixes
Blockers (CI only, not source):
Buildmust be green on the final head. It is still pending, and a known unrelated failure (#12929) may keep the unit-test matrix red until that is fixed ondev.
Non-blocking: none. Nice work keeping this to a single focused test file, and thank you for the quick, careful follow-ups.
|
A CI-status follow-up on the unchanged head I checked the owning code on latest My earlier source-level conclusion remains unchanged: no outstanding source blocker from my side. This is a CI follow-up, not a new full code review or formal approval. The branch is currently ahead 3, behind 9, compare |
|
Thanks for your patience. The upstream status has changed since my preceding note: #12938 merged into The archived-wrapper Other failed job families in the same head's run are |
|
I checked the merged dev ( I compared the remaining diff and found no separate behavior fix left to land; the differences are comments, naming and assertion diagnostics. I have not pushed a redundant sync commit. This is focused local verification of dev, not a green Build for the unchanged PR head. It looks fully covered by #12938; I have left the PR open for your review of that conclusion. |
|
Thanks for the careful follow-up, @hutiefang76. I re-checked your conclusion against the code and I agree with it. Evidence on head
Since the original goal is already satisfied on Thanks again for the quick root-cause on #12874 and for being upfront that the fix was covered. |

Purpose of this pull request
The sink completeness test reflects inherited options and currently expects the source-only
numeric_special_value_as_nullkey added in #12792 to be accepted by the sink. This makes clean dev fail even though the production source/sink rules match the documented scope.Exclude this key from sink completeness coverage, mirroring the existing source-side scoped exclusion. Add a guard using the actual factories to keep the key accepted by the source and rejected by the sink. Every other inherited sink option remains covered.
Fixes #12874. Yes, I am contributing this test fix to Apache SeaTunnel.
Does this PR introduce any user-facing change?
No. Only the existing test class changes. Production option rules, defaults and parsing behavior are unchanged.
How was this patch tested?
Clean baseline:
JdbcOptionRuleCompletenessTestreports two tests with one failure. After the fix:./mvnw -q -DskipTests verifypasses (root verification skips test execution).Check list
Implemented, tested, independently reviewed and posted with AI assistance for @hutiefang76.