Skip to content

validation: auto-promote source.targetNaming: withSchema to top-level targetNaming#2824

Draft
jshearer wants to merge 1 commit intojshearer/target_namingfrom
jshearer/target_naming_with_model_fix
Draft

validation: auto-promote source.targetNaming: withSchema to top-level targetNaming#2824
jshearer wants to merge 1 commit intojshearer/target_namingfrom
jshearer/target_naming_with_model_fix

Conversation

@jshearer
Copy link
Copy Markdown
Contributor

@jshearer jshearer commented Mar 31, 2026

Description:

During validation, materializations with source.targetNaming set to withSchema (or the legacy alias fromSourceName) and no top-level targetNaming now get promoted to targetNaming: { strategy: matchSourceStructure } as a model fix. These two settings produce identical resource paths, so the promotion is behavior-preserving.

This enables progressive migration away from the legacy source.targetNaming field. The old field remains functional via the fallback in update_materialization_resource_spec, so specs that haven't been re-published yet continue to work. Once the UI is updated to write the new top-level field directly, the legacy path can be removed.

  • Add promotion logic in walk_materialization that fires only when target_naming is None
  • Add test_target_naming_promotion verifying the fix fires and sets MatchSourceStructure
  • Add test_target_naming_no_promotion_when_set verifying an explicit top-level value is not overwritten

…el `targetNaming`

During validation, materializations with `source.targetNaming` set to `withSchema` (or the legacy alias `fromSourceName`) and no top-level `targetNaming` now get promoted to `targetNaming: { strategy: matchSourceStructure }` as a model fix. These two settings produce identical resource paths, so the promotion is behavior-preserving.

This enables progressive migration away from the legacy `source.targetNaming` field. The old field remains functional via the fallback in `update_materialization_resource_spec`, so specs that haven't been re-published yet continue to work. Once the UI is updated to write the new top-level field directly, the legacy path can be removed.

* Add promotion logic in `walk_materialization` that fires only when `target_naming` is `None`
* Add `test_target_naming_promotion` verifying the fix fires and sets `MatchSourceStructure`
* Add `test_target_naming_no_promotion_when_set` verifying an explicit top-level value is not overwritten
@jshearer jshearer self-assigned this Mar 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant