Nikk8091 opened a new pull request, #12944: URL: https://github.com/apache/seatunnel/pull/12944
### Purpose of this pull request Yes, I am contributing this fix to Apache SeaTunnel. Fixes #12928. The scope was confirmed in https://github.com/apache/seatunnel/issues/12928#issuecomment-6332517166 after the reporter handed it over. **Draft: depends on #12443.** This PR reuses `ConfigMapPathUtils.quoteInvalidPathKeys` from that PR, as requested. The helper is not in `dev` yet, so this branch cannot compile independently until the dependency lands. The diff deliberately contains only `MetadataProviderManager` and its existing test class, not the dependency's implementation. Please merge #12443 first; this PR then needs an updated base and fresh verification before it is ready for merge. Metadata resolution unwraps a Config and reparses it through `ConfigFactory.parseMap`, which interprets map keys as paths. That loses quoting for valid literal keys such as `^t_nova_.*$`, even when no datasource is requested. The same problem occurs while merging provider configurations. This change protects both conversion boundaries: the final job-config rebuild in `resolveDataSourceConfigs` and the connector-config rebuild in `mergeConfig`. It uses the shared helper rather than introducing another quoting policy. Valid path expressions, datasource-over-job precedence, provider lifecycle and the flat/nested merge structure are unchanged. ### Does this PR introduce any user-facing change? Yes. In the tested dev revision, a quoted regex schema key fails with `ConfigException.BadPath` when metadata resolution is enabled. With this fix, the key survives both the no-datasource path and actual datasource merges. No configuration option, default, public API or provider SPI changes. The change is confined to metadata resolution and its tests, per the approved scope. It restores acceptance of quoted configuration keys rather than introducing new syntax; connector registration and documentation are unchanged. ### How was this patch tested? Local validation uses Temurin JDK 11.0.32 and Maven 3.9.9, on dev `ee83c538ebfadd29d60d5622afd9a12213f02d36` combined with #12443 head `3d6c855f30d0a0b915befbe29abea3e31e6e7bb3`, plus this PR's metadata changes. These are **combined-tree results**, not a standalone build of this dependency-blocked branch or a GitHub CI result. Extended the existing `MetadataProviderManagerTest` with eight parameterized cases: - Metadata disabled/enabled, each with plain and quoted regex field names and no datasource ID. Assert the whole job configuration is retained and no datasource lookup occurs. - Actual datasource merges in flat/nested forms for both source and sink. Assert preservation of original and provider literal keys, including maps inside lists; datasource URL precedence; retained job query; `->` path semantics and literal dotted keys; unchanged input data; and exactly one datasource lookup. Before the production fix, the 14-test class had five errors caused by `BadPath`: the enabled/no-datasource regex case and all four merge cases. After the fix, all 14 tests pass with zero failures, errors or skips. The complete API prerequisite reactor also passed `verify`: 415 API tests, 87 common-module tests and 11 config-shade tests, with zero failures, errors or skips (513 total). Formatting checks, compilation and packaging passed in all six reactor modules. Commands used on the combined tree: ```sh mvn -o -B -ntp -pl seatunnel-api spotless:apply mvn -o -B -ntp -pl seatunnel-api -am -DskipTests install mvn -o -B -ntp -pl seatunnel-api -Dtest=MetadataProviderManagerTest test mvn -o -B -ntp -pl seatunnel-api -am verify git diff --check ``` No external metadata service or engine job was run; the tests use the existing fake-provider/cache-registration pattern and invoke the public metadata-resolution method. ### Check list - No new JAR or third-party dependency is introduced. - The dependency on #12443 is explicit; no competing helper implementation is included. - No connector registration, distribution, plugin mapping or E2E infrastructure change is required for this metadata-only fix. - No option rename, default change or incompatible configuration change is introduced. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
