Skip to content

[Improve][Core] Add JSON config validation output - #12101

Open
CryoThrust wants to merge 11 commits into
apache:devfrom
CryoThrust:codex/seatunnel-check-json
Open

CryoThrust wants to merge 11 commits into
apache:devfrom
CryoThrust:codex/seatunnel-check-json

Conversation

@CryoThrust

@CryoThrust CryoThrust commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

Purpose of this pull request

This contribution to Apache SeaTunnel adds opt-in JSON output to the existing configuration-validation CLI:

bin/seatunnel.sh --config config.conf --check --format json

--format json supports --check, --dry-run static and --dry-run connect. Success and failure each emit one versioned JSON document; the launcher exits with status 1 on failed validation without routing it through text-mode exception logging. The Bash launcher and supplied client logging configuration send diagnostics to stderr in this mode. Other launchers need -Dseatunnel.console.target=SYSTEM_ERR; custom logging configurations must preserve stream separation. Text mode retains the exception type, validation-mode prefix and original path-resolution exception behavior. Validation errors in both modes omit raw exception causes so launcher stack traces cannot undo message sanitization. Job execution and sample mode reject JSON validation output.

The result contains schemaVersion, valid, phase and structured errors. Jackson handles escaping and error messages are sanitized, with Validation failed as the fallback for a missing exception message. validateResult() produces no CLI output. Serialization is outside the validation catch. EN/ZH command guides document the schema, stream separation and custom logging requirement, and explicitly limit launcher integration-test coverage to Bash.

The branch is synchronized with upstream dev at 37309e1a8, including the existing SFTP fixture fix #13203. No SFTP patch, checkpoint assertion change or dependency change is authored here.

Verification

  • JDK 11: 67 starter/argument/launcher tests pass without skips, including JSON failure status, credential-safe results, a text-mode raw-cause regression, a dedicated text-mode null-message assertion, original path-resolution behavior and the existing OOM exit regression. Three JSON schema/escaping tests also pass. Before the cause fix, the new credential-stack-trace test failed while the null-message control passed.
  • Actual Zeta container: SeaTunnelConnectorTest#testJsonValidationStdoutAndExitStatus passes without skips. It runs the source Bash launcher and supplied logging configuration for successful validation, a missing config file, and an invalid configuration value. Each JSON case requires one stdout line and a complete JSON document with FAIL_ON_TRAILING_TOKENS, with exit codes 0/1. The invalid-value case reaches ConfigCheckException internally but returns a sanitized JSON error with no text-mode banner on stderr or raw credential in either stream. The same invalid configuration in text mode retains its useful sanitized diagnostic and exit status 1.
  • Scoped Spotless, dependency-reactor install/verification, final starter/E2E-module skip-tests verification and whitespace checks pass. Native Windows launcher execution was not tested locally.
./mvnw -pl seatunnel-core/seatunnel-starter \
  -Dtest=SeaTunnelConfValidateCommandTest,ClientCommandArgsTest,SeaTunnelClientOOMTest test
./mvnw -pl seatunnel-core/seatunnel-core-starter -Dtest=ConfigValidationResultTest test
RUN_ENGINES=zeta ./mvnw -pl seatunnel-e2e/seatunnel-core-e2e/seatunnel-starter-e2e \
  resources:testResources compiler:testCompile failsafe:integration-test failsafe:verify \
  -DskipIT=false -Dit.test=SeaTunnelConnectorTest#testJsonValidationStdoutAndExitStatus

The fork Build on 90fd7b7eb completed successfully after retry: 88 successful jobs and 9 conditional skips. Both Pub/Sub JDK lanes and both engine-v2 JDK lanes pass. The earlier Pub/Sub JDK 11 cleanup wait did not recur; its cause remains unestablished. The later Build on 841c8d50c was cancelled, so it is not a successful matrix. Fork success is not a claim of upstream approval or merge.

Current-head CI: Build 44452256373, attempt 3 completed successfully on unchanged 17762e94b893ff4cc5870a189f057d79dc76ca6e. The targeted JDBC part 2 / JDK 17 retry passed on November 27. This retry reran that failed lane, not every carried-forward successful job. Earlier HTTP 429 bootstrap failures remain historical failures; no wrapper, dependency, source or assertion change was made for the retry. Fork success is not upstream approval or merge.

@github-actions github-actions Bot added document core SeaTunnel core module labels Sep 5, 2026

@DanielLeens DanielLeens left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution, Yohanes! This is a nice, self-contained addition to the config-validation CLI. I went through the full diff and traced how it changes (and, importantly, doesn't change) the existing --check/--dry-run output path.

What Problem Does This PR Solve?

  • User pain point: seatunnel.sh --check (or --dry-run static/connect) only ever produced a human-readable text message. Anyone wiring config validation into automation (CI pipelines, pre-deploy checks, IDE tooling) had nothing structured to parse, so they'd have to scrape free-form text.
  • Fix approach: Adds a new --format [text|json] CLI option. When json is requested (and only alongside --check/--dry-run static/--dry-run connect), SeaTunnelConfValidateCommand now also prints a versioned, structured ConfigValidationResult JSON document to stdout on both success and failure, in addition to the existing behavior.
  • One-sentence summary: Gives automation a stable, machine-readable validation result without touching the existing text-mode output or exit-code contract that current scripts already depend on.

1. Code Change Review

1.1 Core Logic Analysis

Files with the core change:

  • OutputFormat.java (new enum: TEXT, JSON).
  • ClientCommandArgs.java: new --format option + OutputFormatConverter + a validateCommandOptions() guard requiring --check/--dry-run static/--dry-run connect.
  • SeaTunnelConfValidateCommand.java: new printJsonResultIfRequested(...) calls on the success path and on both failure branches (CONNECT and static) inside execute().

Before:

Path configPath = FileUtils.getConfigPath(clientCommandArgs);
try {
    Config config = ConfigBuilder.of(configPath, ...);
    ...
} catch (Exception e) {
    ...
    if (clientCommandArgs.getDryRun() == DryRun.CONNECT) {
        message = DryRunConnectFailureMessageSanitizer.sanitize(message);
        throw new ConfigCheckException(validationMode + " failed: " + message);
    }
    throw new ConfigCheckException(validationMode + " failed: " + message, e);
}

After (success path, and both catch branches gain a JSON emit):

printJsonResultIfRequested(ConfigValidationResult.success(validationPhase()));
...
} catch (Exception e) {
    ...
    if (clientCommandArgs.getDryRun() == DryRun.CONNECT) {
        message = DryRunConnectFailureMessageSanitizer.sanitize(message);
        printJsonResultIfRequested(ConfigValidationResult.failure(validationPhase(),
                toValidationError(message == null ? "Validation failed" : message)));
        throw new ConfigCheckException(validationMode + " failed: " + message);
    }
    String sanitizedMessage = DryRunConnectFailureMessageSanitizer.sanitize(message);
    printJsonResultIfRequested(ConfigValidationResult.failure(validationPhase(),
            toValidationError(sanitizedMessage == null ? "Validation failed" : sanitizedMessage)));
    throw new ConfigCheckException(validationMode + " failed: " + message, e);   // note: uses `message`, not `sanitizedMessage`
}

private void printJsonResultIfRequested(ConfigValidationResult result) {
    if (clientCommandArgs.getOutputFormat() == OutputFormat.JSON) {
        System.out.println(result.toJson());
    }
}

Key findings

  1. Normal path reachability: printJsonResultIfRequested is gated on outputFormat == OutputFormat.JSON, whose default is OutputFormat.TEXT (ClientCommandArgs.java:100). For every existing invocation that never passes --format, this method is a guaranteed no-op — I traced every call site added in this diff and none of them changed the text-mode/no-flag code path.
  2. The one non-additive change is that Path configPath = FileUtils.getConfigPath(clientCommandArgs); moved from before the try to inside it. I checked FileUtils.getConfigPath (seatunnel-core-starter/.../utils/FileUtils.java:45-54, the shared implementation this module's FileUtils symbol resolves to): it only throws for an unreachable default deploy-mode branch or (via the @NonNull Lombok check) a null args, neither reachable from the CLI in practice. So this move is safe in practice, but worth calling out explicitly rather than silently.
  3. Real gap (Issue 1 below): for the static (non-connect) failure branch, the code computes sanitizedMessage via DryRunConnectFailureMessageSanitizer.sanitize(message) specifically to feed the new JSON payload, but the ConfigCheckException thrown right after still uses the original, unsanitized message. That's very likely just a copy-paste slip (the CONNECT branch reassigns message itself so both the JSON and the exception pick up the sanitized value; the static branch introduces a second variable and only uses it for JSON).
  4. Scenario covered: CLI validation via --check/--dry-run static/--dry-run connect with --format json; both success and failure are covered by tests.
  5. This is a precise, additive fix for the stated goal (structured output), with one real but narrow follow-on bug (Issue 1) introduced alongside it.

1.2 Compatibility Impact

Fully compatible for every existing caller. I verified this concretely, not just asserted it:

  • Default outputFormat = OutputFormat.TEXT means printJsonResultIfRequested never fires unless --format json is explicitly passed — a flag that didn't exist before this PR, so no existing script can be passing it today.
  • The exact text of ConfigCheckException's message (validationMode + " failed: " + message) for both the CONNECT and static branches is byte-for-byte unchanged from dev HEAD — so any CI/script that greps "Static analysis failed:" or "Connectivity check failed:" keeps working identically.
  • Exit-code behavior is unchanged: ConfigCheckException still propagates exactly as before; printJsonResultIfRequested only ever adds an extra System.out.println, gated behind the new flag.
  • No config option default value, protocol, or serialization format is touched elsewhere.

Not incompatible; no incompatible-changes.md entry is needed.

1.3 Performance / Side-Effect Analysis

Negligible — one JSON serialization (ConfigValidationResult.toJson(), plain Jackson ObjectNode construction) per validation run, only when --format json is requested. No new retries, no new locks, no new I/O beyond a System.out.println.

1.4 Error Handling and Logging

Issue 1: Static-validation-failure JSON is sanitized, but the exception message thrown for the exact same failure is not

  • Location: seatunnel-core/seatunnel-starter/src/main/java/org/apache/seatunnel/core/starter/seatunnel/command/SeaTunnelConfValidateCommand.java (catch block, static branch — the lines adding String sanitizedMessage = DryRunConnectFailureMessageSanitizer.sanitize(message); followed a few lines later by throw new ConfigCheckException(validationMode + " failed: " + message, e);)
  • Problem description: For a static (--check / --dry-run static) validation failure, the new JSON payload correctly uses sanitizedMessage, but the ConfigCheckException thrown immediately after still builds its message from the original, unsanitized message variable. Since SeaTunnelClient.main() only catches Error, this exception propagates out of main() and its message is printed by the JVM's default uncaught-exception handler (to stderr) — visible in terminal output and in captured CI/automation logs.
  • Potential risk: Static validation errors can, in at least one real path, echo back part of the user's raw config text — e.g. validateSqlTransformSyntax reflectively invokes JSqlParser and wraps e.getTargetException().getMessage() into the thrown ConfigCheckException (SeaTunnelConfValidateCommand.java, validateSqlTransformSyntax); a parser error message can include the offending SQL token, which could contain a literal secret if a Sql transform's query embeds one (e.g. in a WHERE clause). The JSON output for that same failure would be sanitized, but the stderr/exception text would not be — an inconsistency the author clearly intended to close (they wrote the sanitize call for exactly this branch) but didn't finish wiring through.
  • Best improvement: Reuse sanitizedMessage (not message) when constructing the thrown ConfigCheckException in the static branch, mirroring what the CONNECT branch already does correctly (there, message itself is reassigned to the sanitized value before both uses). This is a one-line fix.
  • Severity: Medium

Aside from Issue 1, error handling is otherwise sound: validateResult() (the non-CLI-facing API for programmatic consumers) independently re-sanitizes the message it extracts from a caught ConfigCheckException, so that consumer path is safe regardless of Issue 1. System.out.println is the correct choice here (not log.info) precisely because the documented contract is "the JSON document is written to standard output" for machine consumption — routing it through SLF4J would add timestamp/level prefixes and break that contract, so I'm not flagging this as a logging-convention violation.

2. Code Quality Assessment

2.1 Coding Standards

Consistent with the surrounding code; the new OutputFormatConverter, OutputFormat enum, and printJsonResultIfRequested/toValidationError methods are all commented appropriately for their role (validation/parsing logic). One minor readability nit: the guard in validateCommandOptions() —

if (outputFormat == OutputFormat.JSON
        && (!checkConfig && dryRun == null || dryRun == DryRun.SAMPLE)) {

relies on && binding tighter than || to produce the intended truth table (I checked it against all reachable (checkConfig, dryRun) combinations and it is logically correct), but explicit parentheses — ((!checkConfig && dryRun == null) || dryRun == DryRun.SAMPLE) — would make the intent obvious without requiring the reader to re-derive operator precedence. Low severity, not a functional issue.

2.2 Test Coverage and Test Stability

Coverage is solid for the stated feature: ClientCommandArgsTest covers both the rejection case (--format json without a validation command) and the acceptance case; SeaTunnelConfValidateCommandTest covers JSON-success, JSON-failure, and "default text mode emits no JSON" — that last test is exactly the right kind of check for proving backward compatibility (testDefaultOutputDoesNotEmitJson). One gap: no test exercises the static-failure JSON path with a message that would actually need sanitization (e.g. a Sql transform syntax error), so Issue 1's inconsistency wasn't caught by the existing suite — a test asserting the JSON error message is sanitized for a static failure would also have caught this.

This PR does not modify any UT/E2E test in a way that introduces timing, concurrency, or environment dependence — the new tests are synchronous, deterministic (tapSystemOutNormalized around a direct method call, fixed input config files), with no sleeps or ordering dependencies. Stability rating: Stable.

2.3 Documentation Updates

Both docs/en/engines/zeta/user-command.md and docs/zh/engines/zeta/user-command.md were updated together, describing --format, its accepted values, default, and a runnable example — and the two are consistent with each other and with the code ([text, json], default text). No further doc update is required.

3. Architectural Soundness

3.1 Elegance of the Solution

Precise fix / clean feature addition. The new output path is properly gated behind an explicit, validated flag, reuses an existing (pre-existing, from an earlier PR) ConfigValidationResult/ConfigValidationError model rather than inventing a parallel one, and does not disturb the existing text-mode contract.

3.2 Maintainability

Good — the classification heuristic in toValidationError() (matching parse/option/plugin/validation categories via keyword sniffing on the exception message) is a little fragile as string-matching goes, but it's isolated, documented via the enum's own Javadoc, and failure just falls back to a generic VALIDATION category rather than throwing.

3.3 Extensibility

The OutputFormat enum and ConfigValidationResult's SCHEMA_VERSION field make it straightforward to add more formats or evolve the JSON schema later without breaking existing consumers.

3.4 Historical-Version Compatibility

Fully compatible — confirmed concretely in 1.2 above (default value, message text, and exit-code behavior for every pre-existing invocation are unchanged).

4. Issue Summary

# Issue Location Severity
1 Static-validation-failure exception message isn't sanitized even though the JSON payload for the same failure is SeaTunnelConfValidateCommand.java (catch block, static branch) Medium
2 validateCommandOptions() boolean guard relies on implicit operator precedence ClientCommandArgs.java:284-286 Low

5. Merge Recommendation

Conclusion: Ready to merge after fixes

  1. Blockers — must be fixed

    • Issue 1: reuse the sanitized message when constructing the thrown ConfigCheckException in the static-validation-failure branch, so the exception text seen on stderr/console can't leak anything the JSON output is already careful to redact. One-line fix, and ideally paired with a test asserting sanitization on the static path (extending the existing testJsonOutputForFailedValidationRetainsFailure test, or a new one hitting the SQL-syntax-error path).
  2. Recommended fixes — non-blocking

    • Issue 2: add explicit parentheses to the validateCommandOptions() boolean guard for readability. No functional change needed.

Overall assessment: This is a well-scoped, backward-compatible feature addition with good bilingual documentation and solid test coverage for its happy paths. The one real issue (Issue 1) is narrow and easy to fix, but I'm treating it as a blocker because it directly concerns the exact thing the task description asked reviewers to check — whether validation failures could leak sensitive config content — and the PR itself demonstrates awareness of the need to sanitize (it just didn't finish wiring it through for one of the two failure branches). No alternative implementation is needed; this is the right approach.

Upstream-sync note: this PR's compare status against dev is ahead (ahead_by=2, behind_by=0) — it is not behind upstream, so there is no sync concern here, contrary to the other two PRs I reviewed in this batch.

CI note: at the time of this review, the fork's Build workflow for this PR's head (290c31f) was still queued (no jobs had started) for roughly 45+ minutes — I have no CI result yet to reconcile against this review. I'd recommend checking whether GitHub Actions is simply backlogged on the contributor's account rather than assuming a failure; I'll defer any CI-specific diagnosis until it actually runs.

@CryoThrust

Copy link
Copy Markdown
Contributor Author

Thanks for the review. I pushed commit 0fec6dd35 with the requested follow-up:

  • the static-validation failure path now uses the same sanitized message for the thrown ConfigCheckException as for the JSON result;
  • added a regression test with a JDBC URL containing credentials, asserting the exception exposes only the configured JDBC URL and not the credential value.

Verification:

  • mvn -s /Users/yohanes/.m2/settings-public-central.xml -pl seatunnel-core/seatunnel-starter spotless:check -Dspotless.check.skip=false -DskipTests passed;
  • the new test was compiled and run separately with Surefire and passed;
  • the full module test compile in this checkout is still blocked by the existing missing InMemory/multi-table test dependencies, unrelated to this change.

@CryoThrust

Copy link
Copy Markdown
Contributor Author

Follow-up: commit 0fec6dd35 addresses the requested sanitization path and adds a regression test covering credentials embedded in a JDBC URL. Spotless passed, and the focused regression test passed separately; the remaining full-module test-compile issue is the pre-existing missing InMemory/multi-table test artifact. Please re-review the updated head when convenient.

@DanielLeens DanielLeens left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-reviewed the latest head (0fec6dd35) from scratch rather than reusing my prior write-up — thanks for the quick follow-up commit and the two verification notes, Yohanes. Replying to both here as part of this full re-review rather than as separate comments, since the fix and the re-review land together:

  • Your 0fec6dd35 commit does exactly what it says: the static-validation-failure branch now reuses sanitizedMessage (not the raw message) when constructing the thrown ConfigCheckException, matching what the CONNECT branch already did. I traced this directly in the diff and it's correct — see 1.1 below.
  • The new regression test (testJsonStaticFailureSanitizesThrownException) is a good, targeted addition: it drives a static-validation failure through a config whose (fake) plugin name is a JDBC URL with embedded credentials, and asserts the thrown exception's message contains neither the raw credential nor the raw URL, only the sanitizer's placeholder. That's the right way to close the gap I flagged.
  • On the pre-existing "full module test-compile blocked by missing InMemory/multi-table test dependencies" note: that's consistent with what I see too — it's an existing, unrelated test-fixture gap in this module, not something introduced by this PR, and it didn't stop your new tests (ClientCommandArgsTest, SeaTunnelConfValidateCommandTest) from compiling/running standalone, which is what actually matters for this diff.

What Problem Does This PR Solve?

  • User pain point: seatunnel.sh --check (or --dry-run static/connect) only produced human-readable text, so automation (CI pipelines, pre-deploy checks, tooling) had nothing structured to parse.
  • Fix approach: Adds a --format [text|json] CLI option. With json (only alongside --check/--dry-run static/--dry-run connect), SeaTunnelConfValidateCommand also prints a versioned ConfigValidationResult JSON document on both success and failure, without touching the existing text-mode/exit-code contract.
  • One-sentence summary: A clean, additive CLI feature that is now also careful to keep its two parallel output channels (JSON payload and thrown-exception text) consistently sanitized.

1. Code Change Review

1.1 Core Logic Analysis

Current state of the previously-flagged code (SeaTunnelConfValidateCommand.java, static-failure branch):

String sanitizedMessage = DryRunConnectFailureMessageSanitizer.sanitize(message);
printJsonResultIfRequested(
        ConfigValidationResult.failure(
                validationPhase(),
                toValidationError(
                        sanitizedMessage == null ? "Validation failed" : sanitizedMessage)));
throw new ConfigCheckException(validationMode + " failed: " + sanitizedMessage, e);

This is exactly the one-line fix I asked for last round (previously the throw used the raw message, not sanitizedMessage) — verified directly against the current diff, not just taken on the author's word. The CONNECT branch was already correct (it reassigns message itself before both uses), so both failure branches are now consistent.

Everything else is unchanged from my last review and still holds:

  • printJsonResultIfRequested is gated on outputFormat == OutputFormat.JSON (default TEXT), so every pre-existing invocation that never passes --format is a guaranteed no-op — confirmed again by re-checking every call site.
  • Moving Path configPath = FileUtils.getConfigPath(...) inside the try remains safe in practice (the only throwing paths in the shared FileUtils.getConfigPath are an unreachable default deploy-mode branch and a @NonNull null-arg check, neither reachable from the CLI).

1.2 Compatibility Impact

Fully compatible, unchanged from my last assessment: default outputFormat = TEXT means no existing script sees new output unless it explicitly opts into the new flag; the text of ConfigCheckException for CONNECT-mode failures is byte-for-byte unchanged from dev; for static-mode failures, the message now differs only when the raw message actually contained a JDBC URL or a sensitive key=value pair that the sanitizer would have masked — which is precisely the security fix, not a regression, since nothing behavioral should have been depending on secrets leaking into an exception message. No config option, protocol, or serialization format elsewhere is touched.

1.3 Performance / Side-Effect Analysis

Unchanged — negligible: one JSON serialization and one regex-based sanitize pass per validation run, only when requested/on-failure respectively.

1.4 Error Handling and Logging

The gap from my last review is closed: both failure branches (CONNECT and static) now sanitize the message used for the thrown ConfigCheckException, consistent with what's already sanitized for the JSON payload. System.out.println remains the right choice for the JSON payload itself (documented contract: stdout for machine consumption), not a logging-convention violation.

No new issues found in this pass.

2. Code Quality Assessment

2.1 Coding Standards

Consistent with the surrounding code. The one style nit from my last review — the implicit-precedence boolean guard in validateCommandOptions() (ClientCommandArgs.java:284-286, outputFormat == OutputFormat.JSON && (!checkConfig && dryRun == null || dryRun == DryRun.SAMPLE)) — is unchanged; I flagged it as non-blocking last time and I'm reconfirming that here (still logically correct, just relies on the reader re-deriving &&/|| precedence).

2.2 Test Coverage and Test Stability

Coverage is now stronger than what I reviewed last round: SeaTunnelConfValidateCommandTest gained testJsonStaticFailureSanitizesThrownException, which is exactly the missing case I called out (a static-failure JSON path whose message would need sanitizing). Combined with the existing testJsonOutputForSuccessfulValidation, testJsonOutputForFailedValidationRetainsFailure, and testDefaultOutputDoesNotEmitJson, both the feature's happy paths and the security-sensitive failure path are now covered.

All tests remain synchronous and deterministic (tapSystemOutNormalized around a direct method call, fixed/generated config files, no sleeps, no ordering dependencies). Stability rating: Stable.

2.3 Documentation Updates

Unchanged from my last review and still correct: both docs/en and docs/zh user-command.md describe --format, its values, default, and a runnable example, consistent with the code.

3. Architectural Soundness

3.1 Elegance of the Solution

Precise fix. Both the original feature and the follow-up fix are minimal, targeted changes with no scope creep.

3.2 Maintainability

Good, unchanged assessment — the toValidationError() keyword-sniffing classification is a little fragile but isolated and documented, with a safe fallback category.

3.3 Extensibility

Unchanged — the OutputFormat enum and ConfigValidationResult's schema-version field make future formats/schema evolution straightforward.

3.4 Historical-Version Compatibility

Fully compatible — reconfirmed: default value, success-path behavior, and CONNECT-branch message text are all unchanged for any pre-existing invocation; the static-branch message text changes only for the exact class of message this PR exists to protect.

4. Issue Summary

# Issue Location Severity
1 Static-validation-failure exception message wasn't sanitized — fixed in 0fec6dd35, verified with a new regression test SeaTunnelConfValidateCommand.java Resolved
2 validateCommandOptions() boolean guard relies on implicit operator precedence ClientCommandArgs.java:284-286 Low

5. Merge Recommendation

Conclusion: Ready to merge

  1. Blockers — must be fixed: None. The one blocker from my last review (message sanitization consistency) is fixed and backed by a good regression test.
  2. Recommended fixes — non-blocking:
    • Issue 2: add explicit parentheses to the validateCommandOptions() boolean guard for readability. No functional change needed.

Overall assessment: This follow-up commit is exactly the kind of response you want to see — a precise one-line fix for the flagged security-relevant inconsistency, paired with a test that would have caught it and now guards against a regression. Combined with the solid existing coverage and bilingual docs, I'm comfortable approving this.

CI status (re-checked live against the fork's actual Actions run, not just the aggregate Build pointer): the fork's Build workflow run for 0fec6dd35 completed with conclusion failure, but every failing/cancelled job is unrelated to this PR's diff (which only touches seatunnel-core/seatunnel-starter validation-CLI code and docs):

  • transform-v2-it-part-1 (both JDK 8 and 11) failed on TestFilterRowKindIT.testFilterRowKindMultiTable (expected: <0> but was: <1>) — this is a currently-tracked flaky test, filed as issue #12116 ("Multi-table row-count rules flaky on Flink: AssertSinkWriter uses static JVM-wide counters evaluated per-subtask close()"), and the fix for exactly this class of flake ([Fix][Connector-V2] Remove fixed sleep in AssertSinkWriter close and assert own table only, #11995) is already merged on dev. This PR's branch is currently behind_by=23 commits relative to dev (diverged), so it predates that fix.
  • all-connectors-it-2 (8, ubuntu-latest) failed on CouchbaseIT.testFakeSourceToCouchbaseSink — a known, currently-tracked Couchbase container-bootstrap flake unrelated to any connector or core-starter code path this PR touches.
  • kudu-connector-it (8, ubuntu-latest) was cancelled, consistent with a cascading/workflow-level effect rather than a Kudu-specific failure — this PR touches no Kudu code.

Recommendation: sync this branch onto current dev (which already carries the #11995 fix) and rerun CI — all three failures are outside this diff's blast radius and at least one has direct, verifiable upstream evidence of already being fixed. Every job actually exercising this PR's own code path (unit-test on all four JDK/OS combinations, Code style, License header, Dead links, Sanity check results) passed.

No alternative implementation is needed here; this is the right approach, now correctly and consistently sanitized on both output channels.

@SEZ9

SEZ9 commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator

Thanks @CryoThrust for the follow-up in 0fec6dd35, and @DanielLeens for the full re-review.

On PR12101-F1: from both of your descriptions, the static-validation failure branch now reuses sanitizedMessage for the thrown ConfigCheckException, and testJsonStaticFailureSanitizesThrownException covers credentials embedded in a JDBC URL. That is exactly the shape of fix I was looking for; I'll confirm it against the diff before closing the finding. I also agree the InMemory/multi-table test-compile issue is pre-existing and not something this PR needs to carry.

The thread so far only covers F1, so could you confirm the status of the remaining points? A one-liner per item ("done in 0fec6dd35" / "not yet" / "won't fix, because…") is fine:

  • F2 (JSON escaping): are the sanitized messages emitted through a real JSON serializer so quotes/newlines/control characters in error text can't break the document?
  • F3 (null message): is sanitize(message) guarded against a null exception message before it is used for the thrown ConfigCheckException, not only for the JSON payload?
  • F4 (stdout purity in JSON mode): is stdout guaranteed to contain only the JSON document on the failure path, or can the propagated ConfigCheckException / text-mode logging still interleave?
  • F5 (FileUtils.getConfigPath() moved into the try): does default text mode still surface the same exception type and message for a missing/unresolvable config file?
  • F6 (success JSON emitted inside the try): has the success emission moved out so a serialization failure isn't reported as a config validation failure and can't throw again inside the catch?
  • F7 (docs): is the schemaVersion / valid / phase / errors contract documented in user-command.md?
  • F8 (style): are the duplicated failure-JSON blocks consolidated and the mixed &&/|| condition explicitly grouped?

If any of these are already handled, just point me at where and I'll take a look. I'd like at least F2, F3 and F4 addressed before merge since they affect the correctness of the machine-readable output; F5–F8 can land here or in a small follow-up, whichever you prefer.

@CryoThrust

Copy link
Copy Markdown
Contributor Author

Follow-up on F2-F8 for the current head (885428e):\n\n- F2: done in 885428e. The JSON result is serialized through Jackson ObjectNode/ObjectMapper; the regression test covers quotes, newlines, tabs, and backslashes in an error message.\n- F3: done in the existing implementation. A null exception message falls back to Validation failed before the value is used for both the result and the thrown ConfigCheckException.\n- F4: the machine-readable result is emitted with System.out.println on the JSON path. Validation errors are represented by the JSON result; unrelated plugin/library output is outside this command's control. No additional text-mode logging is added by this change.\n- F5: unchanged behavior; FileUtils.getConfigPath() remains covered by the existing exception path and text-mode behavior.\n- F6: unchanged existing success path; successful JSON emission is not converted into a validation failure by the catch block.\n- F7: done in 885428e. Both English and Chinese user-command.md now document schemaVersion, valid, phase, errors, error fields, and sanitization.\n- F8: done in 885428e. The mixed &&/|| condition is explicitly parenthesized.\n\nVerification: ConfigValidationResultTest passes with the public-central Maven settings; Spotless was also run for the touched module. No new PR was opened.

@DanielLeens DanielLeens left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update, @CryoThrust — I re-reviewed the latest head (commit 885428e53) from scratch, and thanks @SEZ9 for the detailed F2-F8 checklist, which pushed this into places my previous (approving) pass at 0fec6dd35 did not go deep enough on.

Sorry for missing this in the last review: I approved 0fec6dd35 without tracing whether the JSON-mode stdout contract can actually be violated by pre-existing logging on the validation call path, and without checking whether the success-path JSON emission is itself exception-safe. Both turn out to matter, and I'm flagging them below as carryover issues, not new-version-only ones.

I verified @SEZ9's F1-F8 checklist and @CryoThrust's 885428e53 reply against the current diff/source line by line rather than taking either summary at face value. Findings:

  • F1 (static-failure exception sanitization): confirmed fixed in 0fec6dd35 and unchanged/still correct here.
  • F2 (JSON escaping): confirmed correct. ConfigValidationResult.toJson() (seatunnel-core/seatunnel-core-starter/.../validation/ConfigValidationResult.java:73-88) builds a real Jackson ObjectNode and calls .toString() on it — this was already true before this PR touched the file (the model itself wasn't modified in this diff), and the new escapesSpecialCharactersInErrorMessages test in ConfigValidationResultTest.java is a good regression guard for it.
  • F3 (null message): practically safe, not a crash — DryRunConnectFailureMessageSanitizer.sanitize(null) returns null (guarded at the top of the method), and the null-to-"Validation failed" substitution is applied before building the JSON payload. One nuance worth being precise about: that substitution is not applied to the thrown ConfigCheckException's message on either branch — throw new ConfigCheckException(validationMode + " failed: " + sanitizedMessage, e) string-concatenates a null sanitizedMessage as the literal text "null", not "Validation failed". That's harmless (no NPE) and is pre-existing/unchanged behavior from before this PR (the original code had the same + message pattern with the same null-to-"null" concatenation), so I'm not blocking on it, but the reply's phrasing ("falls back to Validation failed... for both the result and the thrown ConfigCheckException") overstates what the code does for the exception path.
  • F4 (stdout purity) and F6 (success JSON inside try): not actually resolved — see Issues 1 and 2 below. I traced both concretely against the current head rather than accepting the stated answers.
  • F5: confirmed unchanged/safe, matches my previous review.
  • F7 (docs): confirmed — both docs/en and docs/zh user-command.md now document schemaVersion/valid/phase/errors and the sanitized-message contract, consistently.
  • F8 (style): confirmed — the validateCommandOptions() guard in ClientCommandArgs.java:284-286 is now explicitly parenthesized ((!checkConfig && dryRun == null) || dryRun == DryRun.SAMPLE), closing the low-severity nit from my last review.

What Problem Does This PR Solve?

  • User pain point: seatunnel.sh --check (or --dry-run static/--dry-run connect) only ever produced free-form human-readable text. Automation (CI pipelines, pre-deploy gates, IDE tooling) had nothing structured to parse and had to scrape text.
  • Fix approach: Adds an opt-in --format [text|json] CLI option, valid only alongside --check/--dry-run static/--dry-run connect (rejected for plain job execution and for --dry-run sample). When json is requested, SeaTunnelConfValidateCommand additionally prints a versioned ConfigValidationResult document to stdout on both success and failure, sanitizing failure messages before they're serialized or thrown.
  • One-sentence summary: A clean, additive CLI feature for machine-readable config validation that is careful — though, per Issues 1-2 below, not yet fully — about keeping its JSON output channel clean and its failure-message sanitization consistent across both output channels.

One concrete example

sh bin/seatunnel.sh --config app.conf --check --format json

On success: {"schemaVersion":"1.0","valid":true,"phase":"static","errors":[]} on stdout, exit code 0.
On failure (e.g. a missing required option): {"schemaVersion":"1.0","valid":false,"phase":"static","errors":[{...,"message":"..."}]} on stdout, followed by a non-zero exit via the existing ConfigCheckException path.

Real SeaTunnel runtime flow that reaches the changed code

bin/seatunnel.sh --check|--dry-run static|--dry-run connect [--format json]
  -> SeaTunnelClient.main()
    -> CommandLineUtils.parse(...) -> ClientCommandArgs (parses --format via OutputFormatConverter)
      -> ClientCommandArgs.validateCommandOptions() (rejects --format json without --check/--dry-run static|connect, or with --dry-run sample)
      -> ClientCommandArgs.buildCommand() -> checkConfig || dryRun != null -> SeaTunnelConfValidateCommand
        -> SeaTunnelConfValidateCommand.execute()
          -> FileUtils.getConfigPath / ConfigBuilder.of (inside try, moved from before it)
          -> env / source / transform / sink option-rule + unknown-key validation
          -> ConfigParserUtil.checkGraph(...)            <-- can log.info() on stdout (Issue 1)
          -> validatePluginConfigs(...) [+ SQL syntax check for Sql transform]
          -> DryRunConnectValidator.validate() (CONNECT only)
          -> printJsonResultIfRequested(ConfigValidationResult.success(...))   <-- still inside try (Issue 2)
          -> catch (Exception e): sanitize -> printJsonResultIfRequested(failure) -> throw ConfigCheckException

Plain job submission (no --check/--dry-run) never enters SeaTunnelConfValidateCommand at all — buildCommand() routes it straight to ClientExecuteCommand (ClientCommandArgs.java:199-211), so the real production job-execution path is untouched by this PR.

1. Code Change Review

1.1 Core Logic Analysis

Files with the core change: OutputFormat.java (new enum), ClientCommandArgs.java (new --format option, converter, validateCommandOptions() guard), SeaTunnelConfValidateCommand.java (printJsonResultIfRequested, JSON emission on success and both failure branches).

Normal-path reachability: printJsonResultIfRequested is a no-op unless --format json is explicitly passed (default OutputFormat.TEXT); I re-verified every call site added in this diff and none of them alters the text-mode/no-flag path. --format json itself is rejected outside --check/--dry-run static/--dry-run connect by validateCommandOptions() (ClientCommandArgs.java:284-289), and normal job submission never reaches SeaTunnelConfValidateCommand at all (see flow above). So this is genuinely an additive, opt-in feature — the check requested in this review round.

Issue 1 (new, real): JSON-mode stdout is not guaranteed to contain only the JSON document. SeaTunnelConfValidateCommand.execute() calls ConfigParserUtil.checkGraph(...) (line 161) for both the static and connect phases, before either the success or failure JSON is printed. ConfigParserUtil.checkEdge() (seatunnel-engine/seatunnel-engine-core/.../parse/ConfigParserUtil.java:113-117) does log.info(String.format("Currently, incorrect configuration of %s and %s options don't affect job running...", ...)) whenever a source/sink pair's result_table_name/source_table_name don't line up exactly (a real, non-degenerate, "compatible with previous issues" legacy pattern, not just an error path). SeaTunnel's default client logging config, config/log4j2_client.properties, routes INFO to consoleStdoutAppender with target = SYSTEM_OUT (rootLogger.level = INFO), and this is the config bin/seatunnel.sh wires in via -Dlog4j2.configurationFile=${CONF_DIR}/log4j2_client.properties (seatunnel-core/seatunnel-starter/src/main/bin/seatunnel.sh:83-84) — i.e., this is the real, documented CLI entry point this PR's own docs use as the example command. So a plain-text log line can land on stdout ahead of/around the JSON document for a real class of configs, breaking the "stdout contains exactly one parseable JSON document" assumption the docs state ("The JSON document is written to standard output on both success and validation failure") without qualification. This directly answers SEZ9's F4 — the answer given ("No additional text-mode logging is added by this change") is true only in the narrow sense that this PR's own new code doesn't add a println; it doesn't address that the pre-existing call graph this feature is built on top of already writes to stdout via the logger.

  • Potential risk: naive automation that does json.loads(subprocess_stdout) will fail to parse on any config exercising this legacy compatibility branch; more defensive callers that scan for the JSON line will work, but that's not what "stdout is the JSON document" promises in the docs.
  • Best improvement: either (a) route the JSON payload through a channel checkGraph's logger can't touch (harder, bigger change), or — the minimal fix — (b) document the actual contract precisely ("the last line of stdout is the JSON document; other diagnostic output may precede it") instead of implying stdout is exclusively the JSON document, and/or add a regression test that exercises a config hitting checkEdge's mismatch branch with --format json to make the current behavior visible instead of implicit.
  • Severity: Medium — this is exactly the class of thing SEZ9 asked to have addressed before merge, and the current answer doesn't hold up against the call chain.

Issue 2 (new, real): success-path JSON emission remains inside the same try its own failure handling wraps. printJsonResultIfRequested(ConfigValidationResult.success(validationPhase())) at line 186 is still textually inside the try block that begins at line 105, exactly as before SEZ9's F6 question. ConfigValidationResult.toJson() (ConfigValidationResult.java:73-88) calls Jackson's ObjectNode.toString(), which internally wraps ObjectMapper.writeValueAsString() and rethrows any IOException as an unchecked IllegalArgumentException — for a plain tree of String/boolean values (no custom serializers, no I/O) this is not practically reachable today, so I'm not calling this an active bug. But it is still true, contrary to the reply's claim ("successful JSON emission is not converted into a validation failure by the catch block"), that if serialization ever threw, the surrounding catch (Exception e) would catch it and report the run as a validation failure — misclassifying a config that actually passed validation as invalid, purely because of a downstream serialization concern unrelated to the config's correctness.

  • Potential risk: low today (requires a future change to ConfigValidationResult/toJson() that introduces a genuinely throwable path), but it's a footgun for whoever touches that model next, and it's specifically the kind of never-let-success-look-like-failure guarantee that a "trustworthy machine-readable result" feature should hold structurally, not just currently by accident.
  • Best improvement: move printJsonResultIfRequested(ConfigValidationResult.success(...)) to after the try/catch (i.e., set a local boolean succeeded/build the result inside the try, and only call printJsonResultIfRequested once execution has left the try/catch entirely), so the catch block can never observe a success-path exception.
  • Severity: Low — not exploitable with the current implementation of ConfigValidationResult, but a real structural gap the reply didn't actually close.

Compatibility-relevant observation (unchanged from earlier rounds, reconfirmed): Path configPath = FileUtils.getConfigPath(clientCommandArgs) remains moved inside the try (line 106). FileUtils.getConfigPath (seatunnel-core/seatunnel-core-starter/.../utils/FileUtils.java:45-56) only throws for an unreachable default deploy-mode branch or a @NonNull null-arg check — neither reachable from the CLI — so this remains safe in practice.

1.2 Compatibility Impact

Fully compatible. Reconfirmed concretely against the current head:

  • Default outputFormat = OutputFormat.TEXT (ClientCommandArgs.java:57) means printJsonResultIfRequested never fires unless --format json is explicitly passed — a flag that didn't exist before this PR, so no existing script can already be passing it.
  • Normal job submission never routes to SeaTunnelConfValidateCommand (ClientCommandArgs.java:199-211) — the production job-execution path this PR was scoped to check is untouched.
  • ConfigCheckException's message text for the CONNECT branch is byte-for-byte unchanged from dev HEAD; for the static branch the message differs only when the raw message actually contained a JDBC URL or a sensitive key=value pair the sanitizer masks — that's the intended security fix from the earlier round, not a regression.
  • No config default, protocol, or serialization format elsewhere is touched.

1.3 Performance / Side-Effect Analysis

Negligible: one Jackson ObjectNode build + toString() and (on failure) one regex-based sanitize pass per validation run, only when --format json is requested. No new retries, locks, threads, or persistent I/O. No change to CPU/memory/GC profile of the normal job-execution path (it isn't touched at all).

1.4 Error Handling and Logging

The sanitization inconsistency from the first round (Issue 1 in my 290c31f review) remains fixed and verified by testJsonStaticFailureSanitizesThrownException. New in this round: Issues 1 and 2 above — the JSON output's "stdout purity" and "success can't be miscast as failure" guarantees aren't yet structurally enforced, only true by the current shape of the code/logging. Neither leaks credentials (the sanitizer is applied to both channels correctly), so this is a machine-readability/robustness gap, not a new security regression.

2. Code Quality Assessment

2.1 Coding Standards

Consistent with the surrounding code. The previous style nit (implicit &&/|| precedence in validateCommandOptions()) is now fixed with explicit parentheses (F8) — no remaining nit here.

2.2 Test Coverage and Test Stability

Coverage is strong for the stated feature and has grown across rounds: ClientCommandArgsTest covers rejection/acceptance of --format json; SeaTunnelConfValidateCommandTest covers JSON success, JSON failure, static-failure exception sanitization (testJsonStaticFailureSanitizesThrownException, with a JDBC-URL-with-credentials fixture), and "default text mode emits no JSON" (testDefaultOutputDoesNotEmitJson); ConfigValidationResultTest now covers JSON-escaping of quotes/newlines/tabs (escapesSpecialCharactersInErrorMessages).

Gap: no test exercises the Issue 1 scenario (a config that trips ConfigParserUtil.checkEdge's mismatch branch) under --format json to demonstrate/guard against stdout interleaving, and no test exercises Issue 2 (a toJson() failure being swallowed into a false-negative validation result) — understandably hard to trigger today given toJson() can't currently throw, but a comment or a defensive test would make the invariant explicit instead of implicit.

All tests remain synchronous and deterministic — tapSystemOutNormalized around a direct method call, fixed/generated config files, no sleeps, no ordering dependencies, no shared mutable state between tests. Stability rating: Stable.

2.3 Documentation Updates

docs/en/engines/zeta/user-command.md and docs/zh/engines/zeta/user-command.md are both updated and consistent with each other and with the code (--format [text|json], default text, the schemaVersion/valid/phase/errors contract, sanitization). One accuracy nit tied to Issue 1: the docs say "The JSON document is written to standard output on both success and validation failure" without qualifying that other diagnostic log lines can also land on stdout ahead of it — see the recommended doc wording in Issue 1's "Best improvement."

3. Architectural Soundness

3.1 Elegance of the Solution

Precise, additive feature. Reuses the existing ConfigValidationResult/ConfigValidationError model (from an earlier PR) instead of inventing a parallel one, and the new option is properly gated and validated.

3.2 Maintainability

Good overall. The toValidationError() keyword-sniffing classification is a little fragile as string matching goes, but it's isolated, documented, and falls back to a generic category rather than throwing. Issues 1 and 2 above are maintainability-relevant: both are "true by accident of the current call graph/model," not structurally guaranteed, so they're exactly the kind of thing a future refactor could silently break.

3.3 Extensibility

The OutputFormat enum and ConfigValidationResult's SCHEMA_VERSION field make future formats/schema evolution straightforward without breaking existing consumers.

3.4 Historical-Version Compatibility

Fully compatible — default value, success-path behavior for existing (non---format) invocations, and message text for all pre-existing invocation shapes are unchanged, as verified in 1.2.

4. Issue Summary

# Issue Location Severity Raised by another reviewer
1 JSON-mode stdout is not guaranteed to contain only the JSON document — pre-existing log.info in ConfigParserUtil.checkEdge can interleave for configs with mismatched result_table_name/source_table_name, since the default log4j2_client.properties routes INFO to stdout seatunnel-engine/seatunnel-engine-core/src/main/java/org/apache/seatunnel/engine/core/parse/ConfigParserUtil.java:113-117; reached from SeaTunnelConfValidateCommand.java:161 Medium Yes (@SEZ9, F4)
2 Success-path printJsonResultIfRequested(ConfigValidationResult.success(...)) is still inside the same try its own failure handling wraps; a future toJson() failure would be miscast as a validation failure instead of propagating as an internal error seatunnel-core/seatunnel-starter/src/main/java/org/apache/seatunnel/core/starter/seatunnel/command/SeaTunnelConfValidateCommand.java:186 Low Yes (@SEZ9, F6)
3 Static-validation-failure exception message wasn't sanitized — fixed in 0fec6dd35, verified by testJsonStaticFailureSanitizesThrownException SeaTunnelConfValidateCommand.java Resolved Yes (@DanielLeens, prior round)
4 validateCommandOptions() boolean guard relied on implicit operator precedence — fixed in 885428e53 ClientCommandArgs.java:284-286 Resolved Yes (@DanielLeens, F8/prior round)

5. Merge Recommendation

Conclusion: Ready to merge after fixes

  1. Blockers — must be fixed

    • Issue 1: either close the stdout-interleaving gap for the checkEdge legacy-compatibility log line under --format json, or make the docs precisely state that other diagnostic output may precede the JSON line on stdout (the CLI's own docs currently promise otherwise). Given this is a core part of what makes the output "machine-readable," and SEZ9 specifically asked for it before merge, I'm keeping this as a blocker rather than a follow-up.
  2. Recommended fixes — non-blocking

    • Issue 2: move the success-path JSON emission outside the try/catch so a hypothetical future serialization failure can never be reported as a validation failure. Low current risk, but worth closing structurally rather than relying on toJson() staying simple forever.
    • Consider a short doc caveat or added test coverage for the two gaps above so the current behavior is explicit rather than implicit.

Overall assessment: This remains a well-scoped, backward-compatible feature addition with solid bilingual documentation and a test suite that has grown appropriately across rounds — every prior blocker (message-sanitization consistency, style nit) is genuinely fixed and regression-tested. The two new findings in this round are both about the robustness of the JSON output channel itself rather than about the config-validation logic or compatibility with existing callers: neither leaks anything sensitive, and neither affects text-mode or normal job execution at all. Issue 1 is real and reachable through a legitimate, non-exotic config shape via the exact CLI invocation this PR's docs demonstrate, so I'd like it addressed (or precisely documented) before merge; Issue 2 is a structural hardening recommendation I wouldn't block on by itself.

CI status: the fork's Build workflow run for the current head (885428e53) is still queued (no jobs started) at the time of this review — I have no CI result yet to reconcile against this pass; the prior head's (0fec6dd35) CI failures were already traced to unrelated, tracked flakes (TestFilterRowKindIT, Couchbase bootstrap) outside this diff's blast radius per my previous review, and this PR's own unit-test/style/license/dead-link checks passed at that commit.

@CryoThrust

Copy link
Copy Markdown
Contributor Author

Follow-up on the second review, pushed as a874fde:\n\n- Success-result serialization is now outside the validation try/catch. The validation block first builds a ConfigValidationResult, and the output adapter runs only after successful validation; a future serialization failure therefore cannot be reported as a validation failure.\n- The English and Chinese docs now describe the actual stdout contract: the validation result is emitted on stdout, while existing diagnostics may also appear there, so consumers should select the result line. No unrelated logging code was changed.\n\nSpotless apply and git diff --check pass. The remaining Build check is still the GitHub run whose logs/API are unavailable (404); no local production failure has been observed.

@DanielLeens DanielLeens left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the quick follow-up, @CryoThrust, and thanks again @SEZ9 for pushing this into the right level of detail with the F1-F8 checklist. I re-reviewed the current head (a874fdef2) from scratch — full diff against dev, not just the delta — rather than trusting either the reply's summary or my own prior write-up, since a "carryover issue" call deserves the same rigor as a first pass.

Reply-thread check, verified line-by-line against source, not against the reply text:

  • Issue 1 (JSON-mode stdout purity): the reply chose the documented-contract fix (option (b) from my last review) rather than the code-level fix (option (a)). I re-checked both docs and re-confirmed the underlying fact they now describe is still true: ConfigParserUtil.checkEdge() (seatunnel-engine/seatunnel-engine-core/src/main/java/org/apache/seatunnel/engine/core/parse/ConfigParserUtil.java:113-117, still @Deprecated/unchanged, reached from SeaTunnelConfValidateCommand.execute():161) still does log.info(...) for the "compatible with previous issues" result_table_name/source_table_name mismatch branch, and config/log4j2_client.properties still routes INFO through consoleStdoutAppender (target = SYSTEM_OUT, ThresholdFilter level=WARN onMatch=DENY onMismatch=ACCEPT, i.e. sub-WARN levels are accepted to stdout) — unchanged from my last review. Both docs/en/engines/zeta/user-command.md:74 and docs/zh/engines/zeta/user-command.md:90 now say the result is "written to standard output" while "existing diagnostic messages from the validation path may also be written to standard output, so callers should select the result line" — that's an accurate statement of the actual contract, and it was exactly the minimal fix I suggested as acceptable. I'm marking Issue 1 resolved.
  • Issue 2 (success-path JSON emission inside the try/catch): this one did get a real code fix, and I traced it end to end rather than taking "moved outside the try/catch" at face value. In SeaTunnelConfValidateCommand.java, successResult is now declared before the try (line 105) and assigned as the last statement inside try (line ~186, successResult = ConfigValidationResult.success(validationPhase());); printJsonResultIfRequested(successResult) now sits after the catch block closes (line ~215). I checked Java's definite-assignment rules apply cleanly here: every path that falls through past the catch block is the "try completed normally" path, where successResult was just assigned; both branches of the catch (CONNECT and static) unconditionally throw, so there's no path where execution reaches the post-catch printJsonResultIfRequested call without successResult having been set. I also traced what happens if toJson()/System.out.println did throw in that new position: it's no longer inside the local catch (Exception e), so it propagates out of execute() and is caught by SeaTunnelClient's caller, SeaTunnel.run() (seatunnel-core/seatunnel-core-starter/.../SeaTunnel.java:38-45), which logs it via showFatalError (not showConfigError) and rethrows — i.e. a hypothetical serialization failure now correctly surfaces as an internal/fatal error, not as "your config is invalid." That's precisely the guarantee I asked for. Issue 2 resolved, confirmed structurally, not just by inspection of the diff.
  • No unrelated logging code was touched in this commit — confirmed via git diff between 885428e53 and a874fdef2: only docs/en, docs/zh, and SeaTunnelConfValidateCommand.java changed, all consistent with the two claims above.

What Problem Does This PR Solve?

  • User pain point: seatunnel.sh --check / --dry-run static / --dry-run connect only ever produced free-form human-readable text, so automation (CI gates, pre-deploy checks, IDE tooling) had nothing structured to parse.
  • Fix approach: an opt-in --format [text|json] CLI flag, valid only alongside --check/--dry-run static/--dry-run connect, that additionally prints a versioned ConfigValidationResult JSON document to stdout on both success and failure, with failure messages sanitized before serialization or throwing.
  • One-sentence summary: a clean, additive, now fully self-consistent CLI feature for machine-readable config validation — both robustness gaps identified in the last round are closed (one by a real structural fix, one by making the documented contract match reality).

One concrete example

sh bin/seatunnel.sh --config app.conf --check --format json

Success: {"schemaVersion":"1.0","valid":true,"phase":"static","errors":[]} on stdout (now emitted strictly after validation succeeds and outside any catch that could reclassify a serialization problem as a validation failure), exit code 0. Failure: a sanitized JSON error document on stdout followed by a non-zero exit via ConfigCheckException.

Runtime flow that reaches the changed code

bin/seatunnel.sh --check|--dry-run static|--dry-run connect [--format json]
  -> SeaTunnelClient.main() -> CommandLineUtils.parse(...) -> ClientCommandArgs
     -> validateCommandOptions() (rejects --format json without --check/--dry-run static|connect, or with --dry-run sample)
     -> buildCommand() -> SeaTunnelConfValidateCommand
        -> execute():
             try { ...graph/plugin/SQL/connect validation... successResult = ConfigValidationResult.success(...) }
             catch (Exception e) { sanitize -> printJsonResultIfRequested(failure) -> throw ConfigCheckException }
             printJsonResultIfRequested(successResult)   <-- now outside try/catch (this round's fix)

Normal job submission never enters SeaTunnelConfValidateCommand — buildCommand() routes it straight to ClientExecuteCommand — so production job execution remains untouched by this PR, unchanged from prior rounds.

1. Code Change Review

1.1 Core Logic Analysis

Confirmed against current source: the try block's only fall-through path assigns successResult; both catch branches unconditionally throw; printJsonResultIfRequested(successResult) runs only on the success fall-through, now genuinely outside the exception-to-"validation failed" translation logic. This closes the structural gap from Issue 2 without touching the failure paths, the sanitization logic, or the CONNECT-vs-static branching — a minimal, precise diff.

Key findings:

  • Both blocking/non-blocking items from the previous round are now closed (one via code, one via docs) with source-level verification, not just diff inspection.
  • No new call sites, no new dependencies, no behavioral change to text-mode (default) output.
  • successResult's definite-assignment safety is sound under Java's flow analysis (verified by hand, and empirically by the green unit-test CI jobs, since this wouldn't compile otherwise).
  • Doc wording is now accurate to the underlying log.info/log4j2 behavior, which I independently re-verified rather than assuming was still true.

1.2 Compatibility Impact

Fully compatible, reconfirmed: default outputFormat = OutputFormat.TEXT means printJsonResultIfRequested never fires without the explicit new flag; normal job submission still bypasses this command entirely; no config default, protocol, or serialization format elsewhere is touched. The only behavioral difference from 885428e53 is the ordering of one System.out.println call relative to a try/catch that, in practice, it was never going to trip anyway — observable output for every existing test and every realistic config is byte-for-byte identical.

1.3 Performance / Side-Effect Analysis

No change from prior rounds: one Jackson ObjectNode build + toString(), and on failure one regex sanitize pass, only when --format json is requested. No new locks, threads, retries, or I/O.

1.4 Error Handling and Logging

No blocking issues found in this round. One minor, non-blocking clarity nit (new, Low): the updated doc sentence "callers should select the result line" doesn't say how to select it (e.g. "the last line" or "the line starting with {"). Not incorrect, just a little vaguer than it needs to be for someone writing a parser against it — worth a one-line tightening but not worth blocking on.

2. Code Quality Assessment

2.1 Coding Standards

Consistent with the surrounding code; the new local variable and the comment explaining why the success print is outside the try/catch are clear and appropriately placed.

2.2 Test Coverage and Test Stability

No new tests were added in this commit (only docs + the one production file changed), which is acceptable here: Issue 1's fix is documentation-only (nothing new to test), and Issue 2's fix is a structural/ordering change that the existing testJsonOutputForSuccessfulValidation and testDefaultOutputDoesNotEmitJson already exercise end-to-end (they invoke execute() and assert on the tapped stdout, so they'd have caught a regression in the success path). I did independently confirm on GitHub Actions that the relevant unit-test (8/11, ubuntu-latest/windows-latest) jobs for this head all passed. All test code remains synchronous, deterministic, uses tapSystemOutNormalized around direct method calls, no sleeps, no shared mutable state. Stability rating: Stable.

Minor non-blocking gap (carried over, not new): still no dedicated regression test that exercises the Issue-1 checkEdge stdout-interleaving scenario under --format json to make the documented "other diagnostics may precede the JSON line" behavior visible in the test suite rather than only in docs. Not blocking, since the docs now correctly describe it either way.

2.3 Documentation Updates

docs/en and docs/zh are both updated, consistent with each other and with the verified source behavior.

3. Architectural Soundness

3.1 Elegance of the Solution

Precise fix. Both remaining gaps are closed with the smallest change that actually closes them — a doc correction where a doc correction was sufficient, and a real structural reorder where structure was the actual problem.

3.2 Maintainability

Improved from last round: the success path can no longer be silently miscast as a validation failure by a future change to ConfigValidationResult/toJson(), which was exactly the "true by accident of the current call graph" risk flagged before.

3.3 Extensibility

Unchanged and fine — OutputFormat enum and ConfigValidationResult.SCHEMA_VERSION still make future formats/schema evolution straightforward.

3.4 Historical-Version Compatibility

Fully compatible — default behavior, message text, and all pre-existing invocation shapes remain unchanged, reconfirmed against current source.

4. Issue Summary

# Issue Location Severity Raised by another reviewer
1 Doc wording "callers should select the result line" doesn't specify how (e.g. last line / line starting with {) docs/en/engines/zeta/user-command.md:74, docs/zh/engines/zeta/user-command.md:90 Low No
2 JSON-mode stdout not guaranteed to contain only the JSON document — resolved: docs now accurately state the contract docs/en, docs/zh user-command.md Resolved Yes (@SEZ9, F4; @DanielLeens prior round)
3 Success-path JSON emission inside the validation try/catch — resolved: moved outside try/catch, verified structurally SeaTunnelConfValidateCommand.java Resolved Yes (@SEZ9, F6; @DanielLeens prior round)
4 Static-failure exception message not sanitized — resolved in 0fec6dd35, unchanged since SeaTunnelConfValidateCommand.java Resolved Yes (@SEZ9 F1, @DanielLeens prior rounds)
5 validateCommandOptions() implicit operator precedence — resolved in 885428e53, unchanged since ClientCommandArgs.java:284-286 Resolved Yes (@DanielLeens, F8/prior round)

5. Merge Recommendation

Conclusion: Ready to merge

  1. Blockers — must be fixed

    • None.
  2. Recommended fixes — non-blocking

    • Tighten the doc wording ("callers should select the result line") to say precisely how to identify it, e.g. "the last line of stdout" or "the line beginning with {".
    • Optional: add a regression test exercising --format json against a config that trips ConfigParserUtil.checkEdge's mismatch branch, to make the documented interleaving behavior explicit in the test suite.

CI status: the apache-side Build check is a pointer to the fork's Actions run (https://github.com/CryoThrust/seatunnel/actions/runs/34181897083), which shows two real failures, both unrelated to this diff:

  • all-connectors-it-2 (11, ubuntu-latest): CouchbaseIT.testFakeSourceToCouchbaseSink fails on Couchbase testcontainer bootstrap — this is the known, tracked, rerun-proof Couchbase container-bootstrap break on ubuntu-latest (fix tracked separately in #11845), not something this PR's diff can trigger (it never touches connector code).
  • jdbc-connectors-it-part-6 (8, ubuntu-latest): JdbcHanaIT fails with ContainerLaunchException bringing up the SAP HANA testcontainer — again a container-bootstrap/environment failure in an unrelated JDBC dialect's E2E suite, not something a CLI-validation-only change can cause.
  • All the jobs that actually matter for this diff — unit-test (8/11, ubuntu-latest/windows-latest), Run / Code style, Run / License header, Run / Dead links — are green.
  • mergeStateStatus is BLOCKED (review-required gate, since my last review state was CHANGES_REQUESTED), not a merge conflict — mergeable is MERGEABLE, confirmed via the GitHub API.

Overall assessment: both items I flagged as carryover in the last round are now genuinely closed, and I verified that concretely against the current source rather than trusting the reply's phrasing — the try/catch restructuring is provably safe under Java's definite-assignment rules and I traced the exact downstream handling if it ever did throw, and the doc fix matches the actual (unchanged, re-verified) logging/log4j2 behavior. I don't see anything else worth blocking on in this fresh top-to-bottom pass. The only two CI failures on the current head are both pre-existing, tracked, environmental container-bootstrap flakes in connector E2E suites this PR never touches — safe to disregard for merge purposes, and a rerun of just those two jobs would very likely go green on retry.

@davidzollo

Copy link
Copy Markdown
Contributor

Updated with an ordinary merge of current upstream dev and a JSON-validation confidentiality correction. Static JSON failures now discard the unsanitized exception cause, preventing the CLI's full stack-trace logging from exposing fixture credentials; text-mode diagnostic causes remain. The existing regression captures/parses emitted JSON and checks the complete thrown stack trace. No new dependency or authored POM delta.

Scoped formatting and independent source review passed. The sync includes merged HANA readiness #12128. Current-head functional CI remains pending; the historical Couchbase KV SASL failure in #12127 is not claimed fixed by startup retries or readiness-timeout configuration. No failure was suppressed or blindly rerun.

@DanielLeens DanielLeens left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this, @CryoThrust, and thanks @davidzollo for the latest hardening commit. I went through the full diff and re-traced the validation command at the new head 55831abaef. The head now includes a merge of current dev plus commit 55831abaef ("Protect JSON validation failure diagnostics"). I re-verified the whole PR-owned diff, and my previous carryover items stay closed. This review is by code reading only; nothing was executed locally.

What Problem Does This PR Solve?

  • User pain point: seatunnel.sh --check / --dry-run static|connect only reports success or failure as human-readable text, so CI pipelines and tools must scrape messages.
  • Fix approach: add --format [text|json] that prints one credential-safe JSON record (schemaVersion, valid, phase, errors[]) to stdout for both success and failure; failure still exits non-zero.
  • One-sentence summary: machine-readable output for the config validation commands, with sanitized messages.

1. Code Change Review

1.1 Core Logic Analysis

Runtime path:

seatunnel.sh --check --format json
  -> ClientCommandArgs (OutputFormatConverter, validateCommandOptions: json only with --check/static/connect)
  -> SeaTunnelConfValidateCommand.execute()
     try { getConfigPath, ConfigBuilder, env/source/transform/sink validation -> successResult }
     catch (Exception e) { sanitize -> printJsonResultIfRequested(failure) -> throw ConfigCheckException }
  -> success: printJsonResultIfRequested(successResult) OUTSIDE the try

What changed since my last review (a874fdef28): the static-failure catch block (SeaTunnelConfValidateCommand.java:204-217) now discards the unsanitized cause when --format json is used:

if (clientCommandArgs.getOutputFormat() == OutputFormat.JSON) {
    throw new ConfigCheckException(validationMode + " failed: " + sanitizedMessage);   // no cause
}
throw new ConfigCheckException(validationMode + " failed: " + sanitizedMessage, e);

This is a real improvement: the CLI logs the full exception chain, so keeping e as the cause would have re-printed the credential-bearing original message in the stack trace even though the stdout JSON was sanitized. The regression testJsonStaticFailureSanitizesThrownException now asserts that the whole stack trace of the thrown exception and the captured stdout contain no secret, and that the JSON parses with valid=false.

Other findings (re-verified at this head):

  • Success serialization is outside the validation try, so an output failure cannot be misreported as a config error (my earlier carryover item, still closed).
  • printJsonResultIfRequested is the only writer of the machine-readable line, and validateResult() (programmatic use) calls execute() with the default TEXT format, so it does not print JSON.
  • JSON is built via Jackson (ConfigValidationResult.toJson()), and the new escapesSpecialCharactersInErrorMessages test covers quotes, newline and tab.
  • Normal path vs edge path: the new option is opt-in (--format json), so the default flow only reaches the shared catch block when validation fails.

1.2 Compatibility Impact

Partially incompatible (message text only, Low). New CLI flag with default text, no change to exit codes, config, or JSON schema of existing APIs. However the shared failure branch now applies DryRunConnectFailureMessageSanitizer.sanitize() to the thrown ConfigCheckException message in default text mode too (previously the raw message was thrown for static failures). The sanitizer masks credential-like key=value pairs, replaces jdbc: URLs, and truncates at 2048 characters (DryRunConnectFailureMessageSanitizer.java). Users who parse the old text, or who validate configs with very long multi-error messages, will see a shorter, masked message. I requested sanitization in an earlier round, so this is intentional, but it deserves an explicit sentence in the docs.

1.3 Performance / Side-Effect Analysis

Validation-time only; one JSON serialization of a small object. Cause-dropping in JSON mode loses the original stack trace for diagnosis, which is the intended trade-off.

1.4 Error Handling and Logging

  • Issue 1 (Low, new): default text mode now receives sanitized and possibly truncated static-validation messages (see 1.2). Please mention this in docs/en/engines/zeta/user-command.md and the Chinese counterpart, or keep the raw message for text mode if exact old text is a compatibility goal. Not raised by other reviewers.
  • Issue 2 (Low, informational): System.out.println(result.toJson()) (SeaTunnelConfValidateCommand.java:254) is the right channel for a stdout protocol, and the docs now state that callers must select the result line because diagnostics may share stdout. No change required.

2. Code Quality Assessment

2.1 Coding Standards

Good: new OutputFormat enum carries an ASF header and Javadoc, OutputFormatConverter rejects empty/unknown values before any validation or submission starts, and the mixed &&/|| condition is parenthesized.

2.2 Test Coverage and Test Stability

Rating: Risk present (Low).

  • Good: testJsonFormatRequiresValidationCommand and testJsonFormatIsAcceptedForCheck (ClientCommandArgsTest) cover option parsing; SeaTunnelConfValidateCommandTest covers success JSON, failure JSON, sanitization of the thrown exception and the default-no-JSON case.
  • Risk (Low): testJsonStaticFailureSanitizesThrownException parses the entire captured stdout with JsonUtils.readTree(output). If any other component (a plugin, a dependency) prints a line to stdout during validation, the parse fails. The docs explicitly warn that this can happen in real runs; the test is therefore sensitive to the same noise. Consider extracting the last non-empty line before parsing.
  • tapSystemOutNormalized comes from system-lambda, which is already declared in the root pom.xml dependencies, so no new dependency is introduced. The test does not use sleeps or fixed ports and creates its temp file with deleteOnExit.

2.3 Documentation Updates

Both docs/en/engines/zeta/user-command.md and docs/zh/engines/zeta/user-command.md list the flag and the JSON contract. Only the text-mode message change from Issue 1 is missing.

3. Architectural Soundness

3.1 Elegance

Long-term solution in a small footprint (a stable JSON contract, reused serializer, opt-in).

3.2 Maintainability

Good separation: format selection in args, rendering in the command. The duplicated failure(...) construction in the connect and static branches could share a helper, which is a style nit only.

3.3 Extensibility

The enum leaves room for more formats and the schema carries schemaVersion.

3.4 Historical-Version Compatibility

No impact on job config, state or checkpoints; new flag is additive.

4. Issue Summary

Number Issue Location Severity
1 Default text mode now gets sanitized/truncated static-failure messages; document it SeaTunnelConfValidateCommand.java:204-217, user-command.md (en/zh) Low
2 Test parses whole stdout, fragile to unrelated stdout noise SeaTunnelConfValidateCommandTest.java (testJsonStaticFailureSanitizesThrownException) Low

5. Merge Recommendation

Conclusion: Ready to merge after fixes

Blockers (must fix): none on the code side. All items I flagged earlier (sanitization of the thrown exception, output outside the validation try, docs of the stdout contract) are verified fixed, and the new commit closes the remaining confidentiality gap in JSON mode.

Recommended fixes (non-blocking): Issue 1 (one documentation sentence) and Issue 2 (parse only the result line).

CI on the current head (55831abaef): CI has not executed on this head. The only workflow run attached to it is PR signal with conclusion action_required (waiting for a maintainer to approve workflow runs), and there are no check runs. The branch is 0 commits behind dev with no merge conflict. Please have the workflows approved and wait for unit-test (including the seatunnel-starter module) and Code style to pass on this exact head.

Overall assessment: a clean, opt-in feature with the sensitive-data handling done right. Once CI is green on this head, my view is that it is ready for a maintainer approval. There is no better alternative design I would suggest.

@DanielLeens DanielLeens left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update, @CryoThrust, and for the confidentiality repair summary. I re-reviewed all eight changed files at 55831abaef1e1aac58988977c1da8e73a27d9417 and traced the CLI argument, validation, JSON serialization, and top-level error-reporting paths. The JSON-mode exception-cause leak is closed for the reviewed failure path. I found no blocking source issue; current-head CI is still absent.

What problem this PR solves

  • User pain: Configuration-check automation has only human diagnostics to inspect, and an otherwise sanitized JSON failure could still expose its original credential-bearing exception through CLI stack-trace logging.
  • Fix approach: Add opt-in versioned JSON results, preserve failure exit behavior, and discard the raw cause for JSON-mode static validation failures.
  • One-line summary: Expose a structured validation result while keeping the reviewed error-message and exception-chain output sanitized.

Example: seatunnel.sh --config app.conf --check --format json emits a result with schemaVersion, valid, phase, and errors. Invalid configuration still fails. Existing diagnostic output may precede/interleave on stdout; the documentation correctly does not promise stdout contains only JSON.

1. Code-change review

1.1 Core logic analysis

The full diff is +258/-3. ClientCommandArgs adds the text-default format enum/converter and rejects JSON outside check/static/connect validation. The important exception change in SeaTunnelConfValidateCommand.java:205-217 is:

String sanitizedMessage = DryRunConnectFailureMessageSanitizer.sanitize(message);
printJsonResultIfRequested(/* failure built from sanitizedMessage */);
if (clientCommandArgs.getOutputFormat() == OutputFormat.JSON) {
    throw new ConfigCheckException(validationMode + " failed: " + sanitizedMessage);
}
throw new ConfigCheckException(validationMode + " failed: " + sanitizedMessage, e);

Before, retaining e allowed top-level ExceptionUtils.getStackTrace logging to print the original message even after the displayed result was sanitized. JSON now omits that cause; text mode retains diagnostic causes. Success emission is after the validation catch block:

// Successful validation assigned successResult inside try.
printJsonResultIfRequested(successResult);
CLI parse / programmatic buildCommand()
  -> ClientCommandArgs.validateCommandOptions():286 onward
  -> check/static/connect -> SeaTunnelConfValidateCommand.execute():104 onward
      -> getConfigPath -> ConfigBuilder -> graph/plugin/option/SQL/connect checks
      -> failure:
          -> sanitize raw message before building structured error fields
          -> Jackson-backed ConfigValidationResult.toJson() -> stdout
          -> throw ConfigCheckException
              -> JSON static and CONNECT paths retain no raw cause
      -> success:
          -> success result assigned during validation
          -> serialize/print outside validation try/catch
  -> SeaTunnel.run():38-47
      -> showConfigError():52-60 -> logs message and full thrown stack trace
      -> failure remains an exception/nonzero CLI result

Ordinary job submission -> ClientExecuteCommand, not this validation command

Key findings:

  1. The opt-in validation path reaches this behavior; normal job execution and source/sink dataflow are not rerouted.
  2. Structured location/plugin/option fields are derived from the sanitized message, not separately from the raw exception.
  3. Removing the cause closes the specific stack-trace escape route. It does not sanitize arbitrary output emitted independently by a third-party plugin.
  4. Jackson object nodes handle quotes/control characters; no hand-built JSON concatenation is used.
  5. Success serialization outside the catch prevents a serializer failure from being relabeled as invalid user configuration. This is a focused adapter change.

1.2 Compatibility impact

Compatible for existing successful commands and runtime job behavior. Text remains the default; JSON is additive, with schemaVersion 1.0 and unchanged shared result shape. There is no connector option, protocol, checkpoint, or state serialization change.

Two intentional diagnostic details deserve precision: static failure's outer text message now uses the shared sanitizer while retaining the original cause in text mode; moving path resolution inside the validation catch classifies a path-resolution exception as a configuration failure rather than an uncaught fatal error. Therefore I would not claim every exceptional text-mode message/type is byte-for-byte unchanged. These are diagnostic changes, not a data/state migration requirement.

1.3 Performance and side effects

JSON mode adds one small object-tree serialization per validation result. Failure uses the existing bounded message sanitizer/regexes. There is no per-record work, new network operation, thread, lock, buffer, retry, replay, or resource lifetime. Existing validation/plugin loading can perform its existing I/O; the flag does not turn validation into a sandbox.

1.4 Error handling, logging, and formal issues

The CONNECT path already drops raw causes; the static JSON path now does the same. Null messages receive a non-null fallback before structured error parsing. The thrown diagnostic can still say failed: null for a null source message, but JSON remains valid and correctly indicates failure. No swallowed success or new raw-cause leak was found in the reviewed path.

No blocking issue found. I agree with @SEZ9's F1-F8 concerns after independently checking their dispositions: sanitizer/cause handling, real JSON escaping, null-safe structured errors, accurately documented stdout limitations, explicit path-error classification, success serialization placement, paired contract docs, and grouped argument conditions are all accounted for. The earlier claim that unrelated failed CI could simply be disregarded is not carried forward as a merge pass.

Issue 1 — Clarify how consumers identify the result record (Low, non-blocking carryover).

  • Location: docs/en/engines/zeta/user-command.md:85 and corresponding Chinese paragraph.
  • Description/risk: “Select the result line” leaves consumers guessing how to distinguish it from diagnostics. Assuming the final line or any line beginning with a brace is stronger than the current contract guarantees.
  • Best improvement: Recommend parsing candidate single-line JSON objects and recognizing the documented schemaVersion/valid/phase/errors shape. Optionally make the existing checkEdge diagnostic-interleaving case visible in a regression test.
  • Already raised by another reviewer: Related to @SEZ9's F4 stdout concern and Daniel's prior non-blocking documentation note; no new blocker is introduced.

2. Code quality assessment

2.1 Coding conventions

The enum/converter and output helper document their adapter purpose; the cause-dropping comment explains the confidentiality invariant. The new enum file has an ASF header. Static git diff --check upstream/dev...HEAD is clean. No local compilation, formatter, tests, service, or actual CLI job was executed.

2.2 Test coverage and stability

ConfigValidationResultTest.java:69-82 round-trips special characters through the actual serializer. ClientCommandArgsTest.java:86-107 checks the opt-in restriction and accepted check mode. SeaTunnelConfValidateCommandTest.java:69-151 checks success/failure JSON, default text behavior, and a temporary credential-bearing fixture whose emitted JSON and complete thrown stack trace must not contain the dummy secret.

The static confidentiality assertion now exercises the error chain rather than checking only the outer message. Existing result-classification tests remain in place.

Stability rating: Stable under the suite's existing sequential execution. Added tests are synchronous, use unique temporary files and fixed inputs, and restore captured stdout through SystemLambda. No sleeps, port binding, clock-dependent assertions, external service, or ordering dependency is added. Capturing process-wide stdout should remain isolated if parallel test execution is enabled in the future. The confidentiality fixture expects a quiet captured stdout record; the broader documented diagnostic-interleaving scenario remains the optional coverage note in Issue 1.

The fresh exact-head fork query returns no workflow runs, and the Apache rollup currently contains no checks. This is missing execution evidence, not a successful CI result and not proof that Actions are disabled. Please trigger the existing fork Build on this branch, enabling workflows first only if GitHub presents that requirement. The latest base already includes the cited HANA readiness change; it does not establish that the distinct historical Couchbase KV SASL failure was fixed. Those old failures must not be attributed to this new head or suppressed without new results.

2.3 Documentation

Both language pages document the option, allowed validation modes, stdout caveat, nonzero validation-failure status, result fields, and unavailable-field nulls. They match the implemented contract. Issue 1 is a small usability improvement.

3. Architectural assessment

3.1 Solution quality

A focused CLI adapter over the existing shared validation result; no duplicate schema or JSON library is introduced.

3.2 Maintainability

Validation outcome and success serialization are separated. Preserve the deliberate JSON-versus-text cause policy so future diagnostics do not reopen this leak.

3.3 Extensibility

The existing versioned result can serve other adapters. This change does not claim runtime-equivalent validation or a zero-output environment.

3.4 Historical compatibility

Existing job execution, config/state formats, and successful text commands are retained. Exceptional diagnostic changes are described above; no data migration is required.

4. Issue summary

Number Issue Location Severity
Issue 1 Result-line selection guidance remains underspecified user-command.md JSON paragraph, both languages Low, non-blocking

5. Merge conclusion

Conclusion: Can merge after the remaining CI and approval gates pass

  1. Blocking items: No source change remains required from Daniel's review. Obtain current-head Build/test results; absent checks cannot count as passed. Effective maintainer approval remains separate.
  2. Suggested fixes, non-blocking: Issue 1 improves consumer guidance and optional diagnostic-interleaving coverage.

I have incorporated @SEZ9's discussion checklist; there is no independent non-Daniel formal approval/change-request review in the fetched review list. The branch is ahead by 6 and behind by 0 (ahead), with no conflict. Another base sync is not a meaningful prescription for missing current-head CI here.

Overall the confidentiality repair is sound and the feature remains small. No larger alternative is needed for this adapter. Daniel's READ permission means this COMMENT records technical clearance; any historical requested-changes display requires a write-capable maintainer's final approval/dismissal as applicable. Thank you for checking the complete exception output in the regression.

@DanielLeens

Copy link
Copy Markdown
Contributor

Thanks for the contribution. The CI fact cited in my previous conclusion has changed; this follow-up updates that gate on the unchanged reviewed head, without issuing another full source review.

Gate snapshot (2026-10-28T16:02:19+00:00), head 55831abaef1e1aac58988977c1da8e73a27d9417: Build is ACTION_REQUIRED.

The exact blocking stage is Build workflow-run detection: the check says no fork Build was found for this SHA. This is not an executed test failure and does not by itself prove that fork Actions is disabled. Open the fork Actions tab, enable workflows if needed, then manually run the existing Build workflow for this PR branch. If a matching run already exists, link it for a maintainer to reconcile the aggregate. No empty commit or speculative dependency change is requested.

Upstream check: current dev retains the fork-run adoption workflow and its scheduled/manual status-refresh path. A base sync alone cannot enable fork Actions or supply a missing exact-head workflow run, so I am not prescribing sync as the fix for this activation gate.

My previous source conclusion remains clear for the reviewed scope. CI is not being passed by inference, and this follow-up is not an effective approval.

Comparison recorded in this scan: base dev, diverged, ahead 6 / behind 46, no merge conflict. Branch drift is metadata here and is not an additional sync request.

My source blocker is cleared, but an older CHANGES_REQUESTED opinion may remain in the review summary after a COMMENT-only technical conclusion. With Daniel currently READ-only, a write-capable maintainer must separately reconcile the effective approval/dismissal gate; this clarification does not claim that action was performed.

@SEZ9

SEZ9 commented Oct 29, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the follow-up work on this.

At head 55831abaef1e1aac58988977c1da8e73a27d9417, the earlier source conclusion still stands for the reviewed scope; this note is not a new full source review and is not an approval.

The remaining blocker is CI: Build is ACTION_REQUIRED at the Build workflow-run detection stage, because no fork Build run was found for this SHA. This is not an executed test failure.

Next steps:

  1. Open the Actions tab on your fork, enable workflows if they are disabled, and manually run the existing Build workflow for this PR branch at the current head.
  2. If a matching run for this SHA already exists, please link it here so a maintainer can reconcile the aggregate check.

No empty commit or dependency change is needed. Once a fork Build run exists for this exact head and CI is green, a write-capable maintainer can reconcile the review summary and move this forward.

@DanielLeens

Copy link
Copy Markdown
Contributor

Thanks @SEZ9. My source-level clearance is unchanged. The current aggregate still reports the exact-head fork Build discovery gate, rather than an executed source-test failure. Please use the fork Actions tab to enable workflows if disabled and start the existing Build for this branch, or provide an already-existing matching run for maintainer reconciliation. No empty commit, dependency edit or drift-only rebase is needed. Historical requested changes and the eventual effective approval/dismissal still belong to a write-capable maintainer.

Checked 2026-10-29T17:14:09+00:00; head 55831abaef1e1aac58988977c1da8e73a27d9417. Signal pull request update = SUCCESS; Build = ACTION_REQUIRED

Comparison: base dev, head 55831abaef1e1aac58988977c1da8e73a27d9417, diverged, ahead 6 / behind 58; GitHub mergeable state blocked. Behind/diverged alone is recorded metadata and does not add a sync request.

Daniel has READ repository permission. This is a discussion/CI clarification, not a new complete source review, an effective APPROVED event or dismissal of historical requested changes. A write-capable maintainer must perform any required final approval/dismissal. Thanks for keeping the follow-up focused.

@SEZ9

SEZ9 commented Oct 30, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the update on this PR.

On CI: the automated check reports head 55831abaef1e1aac58988977c1da8e73a27d9417 with "Signal pull request update" = SUCCESS but "Build" = ACTION_REQUIRED, i.e. the Build has not actually executed for this branch yet. Could you enable workflows in your fork's Actions tab (if disabled) and start the existing Build for this branch, or point us to an already-existing matching run? No empty commit or rebase is needed for that.

Separately, the previous review findings on SeaTunnelConfValidateCommand.java and the docs are still open from my side, so please confirm the status of each or push the fixes:

  1. Static-validation failure path (HIGH) — the thrown ConfigCheckException still re-attaches the unsanitized exception as its cause, which undoes the credential sanitization. Please drop the raw cause (or wrap a sanitized one).
  2. JSON escaping (MEDIUM) — sanitized messages go into the machine-readable JSON output; please make sure they are emitted through a proper JSON serializer so quotes/newlines/control chars cannot break the document.
  3. Null message (MEDIUM) — sanitize(message) is called before the null guard; the guard only protects the JSON payload, not the thrown exception. Please move the null check ahead of sanitize.
  4. Stdout purity in JSON mode (MEDIUM) — in JSON mode the failure path still propagates ConfigCheckException, so text-mode logging/error output can interleave with the JSON on stdout. Please ensure stdout contains only the JSON document in that mode.
  5. FileUtils.getConfigPath() moved into the try (MEDIUM) — this changes the exception type/message for missing or unresolvable config files in default text mode. Please either keep the original behavior for text mode or call out the change explicitly.
  6. Success JSON emission inside the try (MEDIUM) — a serialization failure would be misreported as a validation failure and could throw again inside the catch. Please emit the success JSON outside the validation try/catch.
  7. Docs (MEDIUM) — the schemaVersion / valid / phase / errors contract should be documented in docs/en/engines/zeta/user-command.md.
  8. Readability (LOW) — please factor the duplicated failure-JSON emission into one helper and add explicit parentheses to the mixed &&/|| condition.

Once the Build has run on the fork and the points above are addressed (or you explain why any of them should stay as-is), I'll do another pass. Note that final approval/dismissal of the earlier requested changes will be done by a write-capable maintainer.

@DanielLeens

Copy link
Copy Markdown
Contributor

Thanks @SEZ9. I rechecked the current code behind your checklist. SeaTunnelConfValidateCommand.java:212-217 deliberately drops the raw cause in JSON mode while retaining legacy text diagnostics; :219-221 serializes success outside the validation catch. The shared sanitizer handles null before matching, and structured errors use a non-null fallback. ConfigValidationResult.toJson:73-87 uses Jackson nodes for escaping. Both user-command pages document schemaVersion/valid/phase/errors and explicitly allow diagnostic stdout alongside the result (English :85-87); pure-JSON stdout is not the current advertised contract. My prior full review also explicitly records the exceptional text-mode path-error classification change, rather than claiming byte-for-byte diagnostic compatibility. The remaining result-record selection clarification is Low/nonblocking. I therefore keep my source clearance and respectfully do not reopen those eight source requests from an older checklist. The exact-head Build discovery gate remains actionable: start/link the existing fork Build, enabling workflows only if disabled. No sync-only cure, empty commit or unrelated dependency change is requested.

Checked 2026-10-30T03:30:37.151877+00:00; head 55831abaef1e1aac58988977c1da8e73a27d9417. Signal pull request update=SUCCESS; Build=ACTION_REQUIRED. Base dev, diverged, ahead 6/behind 61; merge blocked.

This is an unchanged-head discussion/CI clarification, not another full source review or an effective approval. Daniel has READ repository permission.

@CryoThrust

Copy link
Copy Markdown
Contributor Author

Pushed ce93a3a44 after syncing dev at 37309e1a8, including #13203. No SFTP-specific patch or backpressure-test change was added.

Mapping the review findings to the current implementation:

  • F1/F3: the JSON adapter consumes a sanitized result and returns an exit status without propagating a validation exception to the launcher. Missing exception messages receive a fallback before sanitization. Default static text-mode cause behavior is retained.
  • F2: ConfigValidationResult.toJson() uses Jackson object/array nodes. The existing quote, newline and control-character round-trip test passes.
  • F4: SeaTunnelClient uses the explicit JSON exit status instead of SeaTunnel.run's text-error logger. The Bash launcher sets the supplied logging configuration's console target to stderr before JVM startup. Other launchers/custom logging requirements are documented.
  • F5: FileUtils.getConfigPath() is outside the text validation catch again; a regression asserts that its original exception instance is preserved.
  • F6: JSON serialization is performed after validateResult() returns, outside validation error handling.
  • F7: both command guides describe schemaVersion, valid, phase, errors and error-entry fields.
  • F8: one result-emission path replaces the duplicated failure blocks. The argument-validation expression already groups the mixed boolean conditions explicitly.

JDK 11 verification: 65 starter/argument/launcher tests and three schema tests pass without skips. The actual Zeta container test also passes: one JSON document on stdout for success/failure, exit codes 0/1, and no text configuration-error banner on failure. Scoped formatting, dependency-reactor verification and final starter/E2E-module verification pass. Native Windows launcher execution was not tested locally.

The earlier engine backpressure failure remains a separate CI gate; these local results do not establish that it is fixed. I will keep any recurrence visible in the new-head Build result.

@SEZ9

SEZ9 commented Nov 17, 2026

Copy link
Copy Markdown
Collaborator

@CryoThrust thanks for the point-by-point mapping on ce93a3a44; it makes the follow-up easy to track.

Your description explains the intent, but I have not yet checked it against the changed code, so I am not marking any of the previous findings resolved yet. A few points need clarification in the meantime:

  1. F1 (text mode): you note that the default static text-mode cause behavior is retained. The original concern was that the unsanitized exception is re-attached as the cause of the thrown ConfigCheckException, which defeats the sanitization. If the text-mode path still carries the unsanitized cause, this finding is still open. Please either sanitize or drop the cause there, or explain why the cause chain cannot expose credentials in text mode.

  2. F3: does the fallback for missing exception messages also apply to the ConfigCheckException thrown in text mode, or only to the JSON result? The original finding was that the null guard protected only the JSON payload. If a test exercises a null-message exception, please point to it; if not, please add one.

  3. F4: the launcher change and the container result you describe are local results that I still need to confirm against the code. Since native Windows launcher execution was not tested, please make sure the documentation is explicit about which launchers the JSON-only stdout behavior was verified on.

  4. F8: you mention that the argument-validation expression already groups the mixed boolean conditions explicitly. That reads as disagreement with that part of the finding rather than a change. Could you point to the expression you mean so I can re-check it?

For F2, F5, F6 and F7, your description matches what was asked. They stay open until I have confirmed them against the code.

@CryoThrust

CryoThrust commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor Author

Thanks for the clarification. Pushed 90fd7b7eb on top of ce93a3a44.

  • F1: You were right: sanitizing the outer message did not make the original text-mode cause safe. Validation failures now omit that cause in text mode too. testStaticTextFailureDoesNotExposeRawCause checks the complete printed stack trace against password/token values in the original exception and a credential in its nested cause. It fails before the fix and passes after it. The existing pre-validation path-resolution exception contract remains covered separately.
  • F3: Added testStaticTextNullMessageUsesFallback, which makes ConfigBuilder throw a message-less exception and asserts the actual text-mode ConfigCheckException message is Static analysis failed: Validation failed. This verifies the text path directly, rather than only inspecting a JSON result.
  • F4: Both command guides now explicitly state that the launcher integration test covers Bash and does not cover native Windows launchers. The updated real Zeta/Bash test also checks a text-mode failure: a credential-bearing invalid config value produces a sanitized diagnostic, exit status 1, and no raw credential in either stdout or stderr. Its existing JSON success/failure checks remain.
  • F8: The expression I meant is ClientCommandArgs, lines 289 onward: outputFormat == OutputFormat.JSON && ((!checkConfig && dryRun == null) || dryRun == DryRun.SAMPLE). Those parentheses were already present at ce93a3a44; my earlier reply was a source clarification, not a claimed change to that expression.

JDK 11 verification passes: 67 starter/argument/launcher cases, 3 JSON schema cases, and the updated Zeta/Bash integration test, all without skips. Formatting and both changed modules' skip-tests verification also pass.

CI update: the current-head Build is still running and has a Google Pub/Sub JDK 11 failure: GooglePubSubIT.testGooglePubSubSourceAcknowledgesAfterCheckpoint times out at line 228, jobFuture.get(120, TimeUnit.SECONDS). The source message is emitted, checkpoints complete, the server records CANCELED, and the submitted CLI's captured output is logged at 07:19:52.993Z. The timeout occurs at 07:21:53.193Z.

That future also includes SeaTunnelContainer.doExecuteJob's post-command thread/classloader cleanup, which can itself wait 120 seconds. This is not evidence that checkpoint progress or the CLI command timed out; the outer timeout may be hiding the cleanup failure. The log alone does not identify the retained thread or prove the cause. The same Pub/Sub test passes on upstream dev/JDK 11 and the synchronized base/JDK 11, so I am not dismissing this as a demonstrated baseline failure. The connector, its IT and shaded dependency files are unchanged by this PR; no timeout/assertion workaround has been added.

@SEZ9

SEZ9 commented Nov 17, 2026

Copy link
Copy Markdown
Collaborator

Thanks @CryoThrust for the follow-up in 90fd7b7eb.

Sounds right, but not yet confirmed against the diff

  • F1: Omitting the original cause on validation failures in text mode is the direction I asked for, and testStaticTextFailureDoesNotExposeRawCause as you describe it (full printed stack trace, including a credential in the nested cause) is the coverage I wanted. I'll keep this open until I've confirmed it in the diff.
  • F3: testStaticTextNullMessageUsesFallback asserting the text-mode ConfigCheckException message Static analysis failed: Validation failed sounds like the right check. This one also stays open until I've confirmed it in the diff.

Remaining asks

  • F8 (grouping): The finding was filed against SeaTunnelConfValidateCommand.java, while the expression you quote is in ClientCommandArgs. Is there a mixed &&/|| condition without explicit grouping in SeaTunnelConfValidateCommand.java itself, or is the ClientCommandArgs expression the only one?
  • F8 (duplication): What is the status of the duplicated failure-JSON emission blocks?
  • F4: The Bash-only note in the guides and the new text-mode failure check are useful. The original concern was narrower, though: in JSON mode, stdout must contain only the JSON document on the failure path. Do the existing JSON failure checks assert that stdout is exactly one parseable JSON document, with no log or error text interleaved? If not, please add that assertion.
  • F5: You mention that the pre-validation path-resolution exception contract "remains covered separately". Does that mean the exception type and message for a missing or unresolvable config file in default text mode are unchanged from before this PR? Please name the test that pins this.
  • F2, F6, F7: Your comment doesn't mention these, so could you give a short status for each?
    • F2: How is JSON escaping guaranteed for the sanitized messages embedded in the output?
    • F6: Is the success JSON emission still inside the try block, where a serialization failure would be reported as a validation failure?
    • F7: Is the output schema (schemaVersion, valid, phase, errors) now documented in user-command.md?

@CryoThrust

Copy link
Copy Markdown
Contributor Author

Pushed 841c8d50c with a test-only strengthening for F4. Here is the current mapping:

  • F8 grouping: I checked the whole SeaTunnelConfValidateCommand at this head. It has no condition combining && with ||; the mixed expression is in ClientCommandArgs and is explicitly grouped. The command's other conditions use either operator separately. My earlier pointer was to that actual mixed expression, not a change in the command file.
  • F8 duplication / F6: executeForExitCode() has the single System.out.println(result.toJson()) emission, after validateResult() returns. The latter's try/catch returns a success/failure model and does not serialize or print. Thus success serialization is outside validation error handling, and there are no separate failure-JSON emission blocks.
  • F4: The Bash/Zeta test already checked one stdout line and parsed valid for both success and missing-file failure. That parser could accept a first JSON value without rejecting trailing tokens. The new commit uses a local Jackson mapper with FAIL_ON_TRAILING_TOKENS for both paths, retaining the one-line assertion and exit-code checks. A second JSON value or trailing log text now fails parsing. The actual container test passes: one case, no failures/errors/skips. Native Windows remains outside this test's coverage.
  • F5: testNullMessageAndPathResolutionPreserveTextContract mocks FileUtils.getConfigPath() to throw and asserts that execute() throws the same IllegalArgumentException instance. getConfigPath() remains before the validation try/catch, so its type, message and cause are not wrapped or rewritten. This pins exception propagation, not every filesystem/platform error wording.
  • F2: ConfigValidationResult.toJson() builds Jackson ObjectNode/ArrayNode values and uses put for each message, then serializes the tree; it does not concatenate messages into JSON. ConfigValidationResultTest.escapesSpecialCharactersInErrorMessages round-trips quotes, newline and tab characters.
  • F7: Both EN/ZH engines/zeta/user-command.md guides describe schemaVersion, valid, phase and errors, including error-entry fields and the Bash-only coverage boundary.

F1/F3 remain as implemented in 90fd7b7eb, with the credential-stack-trace and text-mode null-message regressions named in the previous reply; this follow-up changes no production code.

The fork Build on 90fd7b7eb is now successful: 88 successful jobs and 9 conditional skips. Pub/Sub JDK 11 passes on retry (job 134068552589); that does not establish the earlier cleanup wait's cause. The new test-only head still needs fresh CI. Its actual Zeta/Bash integration test, scoped formatting, E2E-module -DskipTests verify and whitespace checks pass locally. No timeout or assertion workaround was added to Pub/Sub or engine tests.

@DanielLeens DanielLeens left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for missing a launcher/parsing mismatch in the previous review. It was present in the earlier version and remains in this test-only update. Thanks for the detailed F1–F8 mapping and the strict trailing-token check.

What problem does this PR solve?

User problem. A script running Zeta config validation has to interpret human-readable output to learn whether a config is valid.

Change. Add a JSON validation format with a structured model, a nonzero validation-failure status, and a launcher setting that routes regular diagnostics to stderr.

For example, a config-check integration can parse schemaVersion, valid, phase and errors without parsing a stack trace.

1. Code changes

1.1 Core logic

Before, SeaTunnelClient always ran the command through SeaTunnel.run, which printed text diagnostics on exceptions. After, SeaTunnelClient.java:47-58 executes JSON validation directly. SeaTunnelConfValidateCommand.java:112-119 builds exactly one result and prints its serialized model.

Bash launcher → JVM log target → CommandLineUtils → ClientCommandArgs.validateCommandOptions/buildCommand → SeaTunnelConfValidateCommand.executeForExitCode → FileUtils / ConfigBuilder → env rules → plugin classloading + DAG/option checks → optional DryRunConnectValidator source/transform/sink probes → ConfigValidationResult and Jackson → stdout/result exit code. Text retains its run wrapper and preserves the pre-validation path resolution exception. JSON catches path resolution exceptions as model failures. Neither path submits a job or reaches checkpoint state.

1.2 Compatibility

Compatible for the existing CLI options and stored data. Text remains the default. Text validation failures now omit the underlying cause and use a safe fallback message; this changes diagnostic detail intentionally. JSON introduces a versioned output schema. No config defaults, engine API, RPC or serialized state changes.

1.3 Performance and side effects

JSON adds a small response allocation and serialization at command completion. The existing static checks and optional connectivity probes keep their previous network/CPU scope. No new persistent queue, lock or retry is introduced.

1.4 Errors, logging, and findings

Issue 1 (Medium, blocking) — Keep the shell's JSON detection in sync with argument parsing. ClientCommandArgs.java:265-270 trims the supplied format, but seatunnel.sh:83-89 only recognizes the exact four-character value. With a quoted whitespace-padded format accepted by the Java converter, the launcher keeps the default stdout appender in log4j2_client.properties:40-46. A successful connect validation then calls DryRunConnectValidator.java:457-462, whose INFO summary precedes the JSON. A reader expecting a single document fails even though the command exits successfully. Give the launcher and converter the same normalization, or consistently reject the extra spelling, and cover the decision through the Bash entry point. This remains separate from @SEZ9's trailing-token test request.

The text-mode wrapper now drops the original validation exception cause and preserves sanitized failure text. Missing messages inside validation use the fallback; path-resolution failures follow the existing text-mode contract.

2. Code quality

2.1 Conventions

The result model keeps JSON rendering out of validation. I confirmed @CryoThrust's F8 clarification: the only mixed conditional is grouped at ClientCommandArgs.java:289-290, and the output write is shared by success and failure.

2.2 Test coverage and stability

Stability: Stable. SeaTunnelConnectorTest.java:134-208 checks exit code, one line and strict JSON parsing on process completion without fixed sleeps. The scoped static mocks in SeaTunnelConfValidateCommandTest.java:150-240 close automatically. The special-character JSON round trip is deterministic. F1/F3/F5 are covered by the text-mode cause, fallback and path-resolution assertions. F4's strict parser now rejects a second token. Add a noncanonical accepted invocation in connectivity mode to catch Issue 1; current inputs use exact json with --check.

2.3 Documentation

The English and Chinese Zeta guides describe the same schema and Bash scope. The existing examples use the canonical spelling. Preserve the promised one-document stdout for all accepted spellings, including the connectivity path.

3. Architecture

3.1 Change location

Validation and rendering have a useful common boundary. The launcher's stdout contract must agree with CLI parsing because Log4j chooses the appender before Java argument handling.

3.2 Maintainability

Keep the one JSON emission and the versioned model. Define the accepted format spelling consistently across both entry points.

3.3 Extensibility

The same output adapter can expose future validation phases without changing the underlying job path.

3.4 Upgrade impact

Existing job configs remain valid and no data migration is needed. Automation consuming the new format should rely on its explicit schemaVersion field.

4. Findings summary

# Finding Location Severity
1 Accepted format can leave the log appender on stdout seatunnel.sh:83 Medium

5. Merge recommendation

Merge after fixes

Blocking items: Issue 1 and current-head CI/review. The Build for 841c8d50c was queued at review time. The successful Build on 90fd7b7 applies to its older head. It supersedes the older SFTP/engine investigation for that head only.

Non-blocking suggestions: None beyond the launcher regression.

Thanks @SEZ9 for the earlier findings and @CryoThrust for the focused fixes. The strict stdout check is a good basis for the additional launcher case.

CI and repository state: no check reported in the Apache rollup; Build: queued. GitHub reports BLOCKED / REVIEW_REQUIRED.

Verification: Reviewed all changed files and the referenced call sites at 841c8d50c14348007d68d0d4c2764e0591790422 against merge base 37309e1a8c1b6d35573d73fb167c1aabbacb9452. git diff --check passed. I did not build, run tests, or execute SeaTunnel locally.

@DanielLeens DanielLeens left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Build for the unchanged head has moved from queued to cancelled. It did not establish a successful result for this revision. The launcher stdout issue from my full review remains a source blocker; please include its fix and obtain a completed Build on that resulting head. There is no new source finding in this CI clarification.

@SEZ9

SEZ9 commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator

Quick status update on where this stands.

The Build run for the unchanged head (run 44220308134) went from queued to cancelled, so it did not produce a successful result for this revision. This clarification adds no new source finding.

The stdout issue from the earlier review is still the blocker. In JSON mode, stdout is not guaranteed to contain only the JSON document, because the failure path still propagates ConfigCheckException and the existing text-mode logging and error handling can interleave with the JSON.

Remaining asks:

  1. Push a fix so that JSON mode emits only the JSON document on stdout, including on the validation-failure path.
  2. Get a completed Build on the head that contains that fix, since the cancelled run can't stand in for it.

Could you also add a short note on how you handled the failure path (where the exception and the log output end up in JSON mode)? That will make the re-check quicker. Thanks for sticking with this one!

@CryoThrust

Copy link
Copy Markdown
Contributor Author

The cancelled Build is not a pass; I will keep the next run separate from the older green result.

I rechecked the failure path against the current head. The production change is already in ce93a3a44: validateConfig() can throw ConfigCheckException, but JSON mode calls it through validateResult(), which catches validation exceptions and returns the failure model. executeForExitCode() prints that model once and returns 1. SeaTunnelClient.main() uses that status directly instead of invoking SeaTunnel.run() and its text-mode exception logging. Text mode still takes the existing exception path. The Bash launcher sets seatunnel.console.target=SYSTEM_ERR before Java starts; the supplied Log4j client config uses that target for diagnostics.

The prior launcher test exercised a missing file, which fails before the config validation block. I have now extended the same test with an existing file containing an invalid job.mode, so it exercises the internal ConfigCheckException path as well. The real Zeta/Bash container run passes: success exits 0; both missing-file and invalid-value failures exit 1; each stdout is exactly one complete JSON value with trailing-token rejection. For the invalid value, the JSON contains a sanitized message, stderr contains diagnostics without the text-mode error banner, and neither stream exposes the dummy password. The same file in text mode retains its sanitized failure diagnostic.

This follow-up changes only the existing integration test, with no additional production fix claimed. Scoped Spotless, E2E-module skip-tests verify and whitespace checks pass. Native Windows and arbitrary custom logging configurations remain outside this launcher test; the documented stderr configuration requirement still applies there.

@DanielLeens DanielLeens left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for extending the real launcher test to an internal validation failure. I re-reviewed the complete current Apache SeaTunnel diff and command/logging entry points. The previously reported stdout blocker is resolved in the source; current-head CI remains separate.

What problem does this PR solve?

User pain: automation cannot reliably parse text-only config validation or distinguish validation failure without exception output. Fix: add --format json, one structured stdout value and explicit exit status. Example: an invalid job.mode returns valid=false and exit 1 while diagnostics go to stderr.

1. Code changes

1.1 Core logic

Complete runtime path:

Bash launcher scans --format json before JVM/Log4j initialization -> console target SYSTEM_ERR
ClientCommandArgs -> validation-only output mode -> SeaTunnelClient.main
 -> SeaTunnelConfValidateCommand.executeForExitCode -> validateResult
 -> validateConfig or captured failure -> sanitized ConfigValidationResult
 -> one JSON serialization/println -> status 0/1, bypass text exception wrapper
text mode -> existing command path, sanitized validation exception without raw cause
programmatic validateResult -> model only, no printing

Key findings and correctness:

The current head handles both missing-path and internal validation failures. JSON mode does not propagate ConfigCheckException to the generic text logger, and serialization occurs once after the validation result is formed. The supplied launcher redirects diagnostics before logging starts; custom/native launchers retain the documented configuration responsibility. Default text output remains selected and its path-resolution exception behavior is intentionally preserved. The structured result uses Jackson tree construction rather than string concatenation.

Before:

# JAVA_OPTS="${JAVA_OPTS} -Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=5000,suspend=n"

# Log4j2 Config
JAVA_OPTS="${JAVA_OPTS} -Dlog4j2.isThreadContextMapInheritable=true"
if [ -e "${CONF_DIR}/log4j2_client.properties" ]; then
  JAVA_OPTS="${JAVA_OPTS} -Dhazelcast.logging.type=log4j2 -Dlog4j2.configurationFile=${CONF_DIR}/log4j2_client.properties"

After:

# JAVA_OPTS="${JAVA_OPTS} -Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=5000,suspend=n"

# Log4j2 Config
# Keep validation diagnostics off the JSON protocol's stdout. Set the target before Log4j starts.
previous_arg=""
for arg in "${args[@]}"; do
  if [[ ( "$previous_arg" == "--format" && "$arg" == [Jj][Ss][Oo][Nn] ) || "$arg" == --format=[Jj][Ss][Oo][Nn] ]]; then
    JAVA_OPTS="${JAVA_OPTS} -Dseatunnel.console.target=SYSTEM_ERR"
  fi
  previous_arg="$arg"
done
JAVA_OPTS="${JAVA_OPTS} -Dlog4j2.isThreadContextMapInheritable=true"
if [ -e "${CONF_DIR}/log4j2_client.properties" ]; then
  JAVA_OPTS="${JAVA_OPTS} -Dhazelcast.logging.type=log4j2 -Dlog4j2.configurationFile=${CONF_DIR}/log4j2_client.properties"

1.2 Compatibility

Fully compatible default text command selection and validation semantics; JSON is opt-in and schemaVersion identifies its result contract. Sanitized text failures now intentionally omit raw causes, as documented. No job API, configuration option default, row/checkpoint bytes or connector SPI changes.

1.3 Performance and side effects

JSON tree/serialization is command-result work, outside the data path. No new network request, worker, lock, retry or engine resource ownership; existing validation classloader cleanup remains.

1.4 Errors, logging, and findings

No new source-level blocker found. Exceptions must still reach the existing job failure path; this review does not substitute for current-head CI.

I respectfully disagree with @SEZ9's latest statement that JSON still propagates ConfigCheckException into text logging: current executeForExitCode calls validateResult, catches validation exceptions there, prints once and returns the status directly through SeaTunnelClient.main. The expanded actual-launcher invalid-value case now pins that exact path. The earlier concern was valid for the older implementation, but is resolved at this head.

2. Code quality

2.1 Conventions

Reviewed all changed files for license, imports, naming, core-method and state-field comments. No additional convention blocker found.

2.2 Test coverage and stability

Stability rating: Stable. Unit tests exercise success/failure status, no extra stdout, programmatic silence, escaping, sanitized raw/nested causes, NULL-message fallback and preserved text path-resolution exceptions. Existing starter E2E now invokes the actual Zeta/Bash launcher with success, missing-file and an existing invalid-value file, rejects trailing JSON tokens and checks both stdout/stderr for the dummy secret. This last case reaches the internal ConfigCheckException path, not just path lookup. Native Windows/custom logging remain outside that test. Scoped static mocks and stdout/exit capture are released.

2.3 Documentation

EN/ZH document fields, phase names, exit status, validation modes, sanitization and the Bash/native/custom logging coverage boundary consistently.

3. Architecture

3.1 Change location

The CLI adapter owns output format and exit status; the pure validation model remains reusable without printing. Log routing must happen before JVM logging initialization.

3.2 Maintainability

Keep the behavior, lifecycle ownership, and failure contract together. The CLI adapter owns output format and exit status; the pure validation model remains reusable without printing. Log routing must happen before JVM logging initialization.

3.3 Extensibility

Prefer the existing component boundary and tests over unrelated shared abstractions.

3.4 Upgrade impact

Fully compatible default text command selection and validation semantics; JSON is opt-in and schemaVersion identifies its result contract. Sanitized text failures now intentionally omit raw causes, as documented. No job API, configuration option default, row/checkpoint bytes or connector SPI changes.

4. Findings summary

# Finding Location Severity
- No new source blocker found - -

5. Merge recommendation

Can merge once the recorded CI and repository gates are satisfied

Blocking items: No source blocker. Current-head CI and write-capable maintainer review remain independent requirements.

Non-blocking suggestions: None beyond the validation limits above.

Overall: the reviewed source path is coherent; no runtime acceptance is claimed beyond the actual CI result. Daniel has READ permission, so this COMMENT cannot dismiss historical requested changes or satisfy a write-capable maintainer approval gate.

CI and repository state: no check reported in the Apache rollup; Build: in_progress. GitHub reports BLOCKED / REVIEW_REQUIRED.

Verification: Reviewed all changed files and the referenced call sites at 17762e94b893ff4cc5870a189f057d79dc76ca6e against merge base 37309e1a8c1b6d35573d73fb167c1aabbacb9452. git diff --check passed. I did not build, run tests, or execute SeaTunnel locally.

Review time: 2026-11-19T07:07:49.388924-05:00

Local evidence: git fetch obtained head 17762e94b893ff4cc5870a189f057d79dc76ca6e; git merge-base returned 37309e1a8c1b6d35573d73fb167c1aabbacb9452; git diff --stat reports 13 files changed, 511 insertions(+), 19 deletions(-). git show and source searches were used for the entry points above. No local build, unit test, E2E, Docker run or service startup was executed.

@SEZ9

SEZ9 commented Nov 19, 2026

Copy link
Copy Markdown
Collaborator

Thanks for extending the real launcher test to cover an internal validation failure. Here is where the earlier review points stand after the latest re-review.

Resolved in the current source

  • Raw cause in text mode: text mode now throws a sanitized validation exception without the raw cause.
  • JSON escaping: the structured result uses Jackson tree construction rather than string concatenation.
  • stdout in JSON mode: ConfigCheckException is no longer propagated to the generic text logger. The bash launcher scans for --format json and sets the console target to SYSTEM_ERR before Log4j starts. Custom or native launchers keep the documented configuration responsibility.
  • Text-mode compatibility: default text output remains selected and its path-resolution exception behavior is preserved.
  • Serialization placement: serialization happens once, after the validation result is formed.

Still to confirm

  1. Null exception message: could you confirm that sanitization is safe when the exception message is null, for both the JSON payload and the thrown ConfigCheckException? A small test for a null-message failure would settle this.
  2. Docs: could you confirm that the JSON output schema (schemaVersion, valid, phase, errors) is documented in user-command.md? It is a versioned, machine-readable contract.
  3. Readability: could you confirm that the duplicated failure-JSON emission blocks are gone, and that the mixed &&/|| condition was either removed or given explicit grouping?

CI on the current head is separate from the points above.

@DanielLeens

Copy link
Copy Markdown
Contributor

Thanks, @SEZ9. All three confirmation points are visible in this head:

  1. SeaTunnelConfValidateCommand.safeMessage at lines 235-237 replaces a null message with Validation failed before sanitization. The tests at lines 179-191 cover the programmatic JSON result/path-resolution boundary, and lines 223-235 cover the thrown text ConfigCheckException fallback. The text exception omits the raw cause.
  2. EN user-command.md:85-89 and ZH user-command.md:100-104 document stdout/stderr ownership and schemaVersion, valid, phase, errors and error-entry fields.
  3. executeForExitCode:112-119 forms the result and emits JSON once; validateResult produces the model without stdout output. The previous mixed emission condition is no longer used.

I inspected the code and deterministic assertions; I did not run them locally. My existing source-clear conclusion remains unchanged, with the documented native/custom-launcher and CI limits.

Checked unchanged head 17762e94b893ff4cc5870a189f057d79dc76ca6e against dev: compare diverged, ahead 11 / behind 38. This drift is recorded independently; it does not by itself request synchronization. This is a discussion/CI follow-up, not another full source review. No local build, test or runtime execution was performed. Daniel has READ repository permission; effective maintainer approval/dismissal remains a separate repository gate. Checked 2026-11-20T11:59:57.811808+00:00.

@DanielLeens

Copy link
Copy Markdown
Contributor

The CI fact cited in the previous review has changed at unchanged head 17762e94b893ff4cc5870a189f057d79dc76ca6e: the exact-head Build is now failure (attempt 1), not a queued or running result. The Java 11 Linux unit, JDBC partition 2 Java 17 and Oracle CDC Java 17 lanes fail Maven-wrapper bootstrap. Connector partition 7 Java 11 fails downloading apache-maven-3.8.4-bin.zip with FileNotFoundException, before its tests. Unit job, distribution-download job. Current dev retains both download URLs; no verified upstream correction makes a branch sync the cure. Please complete the failed lanes after download availability is restored. My previous source/security/CLI conclusion remains cleared; the Build and effective maintainer gate remain outstanding. Do not add unrelated dependency or launcher changes to manufacture green CI. This is a current-CI clarification, not a new full source review. No local build or test was run; write-capable maintainer approval remains separate.

@SEZ9

SEZ9 commented Nov 20, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the updates. Here is where the earlier review points stand at head 17762e94b893ff4cc5870a189f057d79dc76ca6e.

Looks addressed

  • Null message and unsanitized cause: safeMessage now replaces a null message with Validation failed before sanitization, and the thrown text-mode ConfigCheckException omits the raw cause.
  • Single JSON emission: validateResult builds the result without writing to stdout, executeForExitCode emits the JSON once, and the previous mixed emission condition is no longer used.
  • Schema docs: the EN and ZH user-command.md now document stdout/stderr ownership and the schemaVersion, valid, phase, errors and error-entry fields.

These were confirmed by reading the code and test assertions, not by running the tests. The earlier source conclusion remains cleared, so there are no open code questions from the previous review.

CI

Build run 44452256373 is now failure at this head. The Java 11 Linux unit, JDBC partition 2 Java 17 and Oracle CDC Java 17 lanes fail at Maven-wrapper bootstrap, and Connector partition 7 Java 11 fails with a FileNotFoundException downloading apache-maven-3.8.4-bin.zip, before its tests ran (jobs 135319831816 and 135319832920).

Please re-run the failed lanes once the download is available again, and please don't add unrelated dependency or launcher changes to this PR to work around it. The Build and maintainer approval are the remaining items.

@github-actions github-actions Bot added the e2e label Nov 21, 2026
@DanielLeens

Copy link
Copy Markdown
Contributor

Thanks, @SEZ9. I agree that the earlier CLI/source/security points are clear. The actual remaining CI failures are wrapper/bootstrap failures in Linux Unit/JDK11, JDBC part 2/JDK17 and Oracle/JDK17, plus the connector-7/JDK11 Maven distribution download failure before tests. These are not green test results. Current dev retains the same download coordinates, and I found no verified upstream fix that makes a blind sync sufficient. Please complete the affected checks when artifact access is restored; no unrelated CLI source change is requested.

Checked unchanged head 17762e94b893ff4cc5870a189f057d79dc76ca6e against dev: compare diverged, ahead 11 / behind 41. This drift is recorded independently; it does not by itself request synchronization. This is a discussion/CI follow-up, not another full source review. No local build, test or runtime execution was performed. Daniel has READ repository permission; effective maintainer approval/dismissal remains a separate repository gate. Checked 2026-11-21T12:06:29.365986+00:00.

@SEZ9

SEZ9 commented Nov 22, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the continued work on this.

Previous review points

The follow-up on this thread records the earlier CLI/source/security points as clear at head 17762e94b893ff4cc5870a189f057d79dc76ca6e, so no further source change is requested for:

  • the unsanitized exception cause on the static-validation failure path
  • JSON escaping of the sanitized messages
  • the null-message handling before sanitize
  • stdout purity in JSON mode
  • the FileUtils.getConfigPath() exception behavior in text mode
  • the success-JSON emission inside the try block
  • the duplicated failure-JSON blocks and the &&/|| grouping

One confirmation, please: the follow-up names only the CLI/source/security points as clear, and does not mention the docs point. Could you confirm whether the JSON output contract (schemaVersion, valid, phase, errors) is documented in docs/en/engines/zeta/user-command.md, and point to where?

What is still open

The Build run 44452256373 at the same unchanged head is reported as failure, so there is no green test result for this head yet. Per the thread, every failure happens before any tests run:

  • The Java 11 Linux unit, JDBC partition 2 Java 17 and Oracle CDC Java 17 lanes fail at Maven-wrapper bootstrap.
  • The connector partition 7 Java 11 lane fails downloading apache-maven-3.8.4-bin.zip with FileNotFoundException.

Remaining asks

  1. Re-run the failed lanes once download availability is restored, so the checks complete on this head.
  2. Please do not add unrelated dependency, launcher or CLI source changes to get CI green.
  3. No sync with dev is requested for this. The thread notes dev keeps the same download coordinates, so a sync alone is not expected to fix it.

Once the lanes complete and the docs point is confirmed, what remains is the maintainer approval gate.

@DanielLeens

Copy link
Copy Markdown
Contributor

Thanks @SEZ9. The documentation confirmation is already present on this exact head: docs/en/engines/zeta/user-command.md:85-89 documents JSON stdout, exit status, launcher/logging limits, and the schemaVersion/valid/phase/errors fields; the individual error fields are listed at line 89. The matching Chinese section is part of the reviewed change. There is no further source/docs patch requested from my side. Build remains failed, and the reported wrapper bootstrap failures are a separate gate. I compared mvnw and .mvn/wrapper/maven-wrapper.properties with current dev a76348f: both files are identical, so sync is not an established cure for those downloads. Retry the specific failed lanes once bootstrap availability is restored; do not add unrelated CLI or dependency changes. Effective maintainer approval remains separate.

@CryoThrust

CryoThrust commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor Author

Confirmed on the unchanged head 17762e94b893ff4cc5870a189f057d79dc76ca6e: the English command guide, lines 85–89 documents one JSON stdout document, exit status, launcher/logging limits, schemaVersion, valid, phase, errors, and the individual error fields. No documentation patch is needed for that confirmation.

Both exact Maven-wrapper artifact URLs returned HTTP 200 to local availability probes, so I requested a rerun of only the failed jobs in Build 44452256373 on the same head. No wrapper, dependency, launcher or CLI changes, and no dev sync, were made for the retry.

Update: attempt 2 has completed with a failure in JDBC connectors part 2 / JDK 17. The job received HTTP 429 from Maven Central for maven-wrapper-3.1.0.jar on all five attempts, including the 5/10/20/40-second backoffs, then failed with ClassNotFoundException: org.apache.maven.wrapper.MavenWrapperMain. Its summary found zero Surefire/Failsafe XML reports: this job did not reach test execution. The hosted run remains failed; local artifact availability did not predict this runner's result. I have not requested another immediate rerun or changed assertions to work around bootstrap.

@DanielLeens

Copy link
Copy Markdown
Contributor

Thanks for the precise runner evidence. A successful local artifact probe does not clear the hosted job: the reported HTTP 429 and missing MavenWrapperMain occurred before test execution, so that lane remains unvalidated. Please keep the retry limited to that failed lane once runner artifact access recovers; no immediate repeated retries, unrelated dependency patch or base sync is justified by that signal. My previous source/documentation clearance remains unchanged. The current aggregate still reports FAILURE; I am not treating the retry as passed.

Discussion-only follow-up on unchanged head 17762e94b893ff4cc5870a189f057d79dc76ca6e; no new full source review or local build/test/runtime execution is claimed. Daniel's technical conclusion does not replace write-capable maintainer approval or dismissal of historical changes requested.

@SEZ9

SEZ9 commented Nov 25, 2026

Copy link
Copy Markdown
Collaborator

@CryoThrust thanks for the precise follow-up on head 17762e94b893ff4cc5870a189f057d79dc76ca6e.

JSON output contract docs: Your confirmation that docs/en/engines/zeta/user-command.md (lines 85–89) documents the single JSON stdout document, exit status, launcher/logging limits, schemaVersion, valid, phase, errors and the individual error fields covers the documentation point from the previous review. I agree no documentation patch is needed.

Retry of Build 44452256373: The local HTTP 200 probes do not clear the hosted job. As you reported, job 138939854032 (JDBC connectors part 2 / JDK 17) got HTTP 429 for maven-wrapper-3.1.0.jar on all five attempts. It then failed with ClassNotFoundException: org.apache.maven.wrapper.MavenWrapperMain and produced zero Surefire/Failsafe reports. That lane never reached test execution, so it is still unvalidated and the run remains failed. I am not treating the retry as passed.

Remaining asks:

  • Once runner artifact access recovers, please rerun only that failed lane on the same head and post the result here.
  • Please keep holding off on immediate repeated reruns, as you already have.
  • Please do not add wrapper or dependency patches, a dev sync, or assertion changes to work around the bootstrap failure; nothing in this signal justifies them.

@DanielLeens

Copy link
Copy Markdown
Contributor

Thanks, @SEZ9. The CLI JSON output contract remains documented; no new source patch is requested on that point. The current failing hosted lane is still independent of local HTTP probes: zero test reports after MavenWrapperMain/bootstrap failure is not passing validation.

The lowest-cost next step remains a completed rerun of that specific JDBC/JDK17 lane after runner artifact access recovers, with its new job URL if it fails again. The guarded wrapper mirror proposal #13466 is not in the captured dev baseline; merely syncing now is not a demonstrated fix. Please keep the JSON-output PR free of unrelated packaging changes.

Discussion-only follow-up on unchanged head 17762e94b893ff4cc5870a189f057d79dc76ca6e; no new full source review or local build/test/runtime execution is claimed. Daniel has READ permission; effective write-maintainer approval/dismissal remains separate.

@SEZ9

SEZ9 commented Nov 26, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the follow-up. Here is where things stand on the unchanged head 17762e94b893ff4cc5870a189f057d79dc76ca6e.

  • JSON output contract docs: the CLI JSON output contract (schemaVersion, valid, phase, errors) remains documented, and no new source patch is requested on that point.
  • Earlier source points: the previous source/documentation clearance remains unchanged, so none of those points are being reopened. This is a discussion-only follow-up; no new full source review or local build/test/runtime execution is claimed.

The one open item is the failing hosted JDBC/JDK17 lane. The reported HTTP 429 and missing MavenWrapperMain occurred before test execution, so that lane has zero test reports and remains unvalidated. The aggregate was still reported as FAILURE, and a successful local probe does not clear it.

Next step: once runner artifact access recovers, please do one completed rerun of that specific lane, without immediate repeated retries, and share the new job URL if it fails again. Please also keep this PR free of unrelated packaging or dependency changes.

@CryoThrust

Copy link
Copy Markdown
Contributor Author

The requested targeted retry has now completed successfully on unchanged 17762e94b893ff4cc5870a189f057d79dc76ca6e: JDBC part 2 / JDK 17, job 140258459755. Build 44452256373, attempt 3 is also successful.

Only the failed lane was rerun; previously successful jobs were carried forward. No wrapper, dependency, source, or assertion changes were made. The PR description now distinguishes this current-head result from the older builds. This clears the reported fork-CI failure, not the separate upstream maintainer approval/merge gate.

@DanielLeens DanielLeens left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the precise retry evidence. I independently checked Build attempt 3: it is completed successfully on 17762e94b893ff4cc5870a189f057d79dc76ca6e, including the previously failed JDBC part 2 / JDK 17 job. +1 to @SEZ9 that the earlier source/documentation clearance remains intact. Previously only CI was blocking my source-cleared review; CI has recovered, so I am changing my review to approve. No wrapper/dependency/source workaround is needed for that recovered failure. This APPROVED record does not claim READ-level approval can satisfy a required write-capable reviewer or dismiss historical requests.

This is a discussion/gate follow-up on unchanged head 17762e94b893ff4cc5870a189f057d79dc76ca6e, not a new full source review. Base dev compare: diverged, ahead 11 / behind 111. Branch drift alone is not a request to sync. No local build/test/runtime execution was performed. Daniel has READ permission; any required write-capable maintainer approval or historical-review dismissal remains separate.

@SEZ9

SEZ9 commented Nov 27, 2026

Copy link
Copy Markdown
Collaborator

@CryoThrust thanks for the precise retry evidence.

  • CI: The targeted rerun of JDBC part 2 / JDK 17 (job 140258459755) and Build 44452256373, attempt 3, are both successful on the unchanged head 17762e94b893ff4cc5870a189f057d79dc76ca6e. That clears the reported fork-CI failure, with no wrapper, dependency, source, or assertion changes.
  • Previous review points: The head is unchanged, and the follow-up review on this thread records the earlier source/documentation clearance as intact. It was explicitly a gate follow-up rather than a new full source review. On that basis I have no new asks on the earlier SeaTunnelConfValidateCommand findings (sanitization, JSON output handling, config-path exception behaviour) or the user-command.md documentation point.
  • Remaining gate: As you noted, the upstream write-capable maintainer approval/merge gate is separate and still open. The APPROVED record on this thread does not satisfy it or dismiss historical review requests.

Remaining asks:

  1. Please keep the head at 17762e94b893ff4cc5870a189f057d79dc76ca6e unless a reviewer asks for a change, so the current CI result and clearance stay valid. Branch drift alone is not a request to sync.
  2. If you consider any of the earlier points still open or only partially addressed, please say which one here so it can be looked at before the maintainer pass.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core SeaTunnel core module document e2e

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants