Sync materialization & ingestr strategy lists with Bruin CLI - #807
Sync materialization & ingestr strategy lists with Bruin CLI#807DjamilaBaroudi wants to merge 5 commits into
Conversation
Add datavault_hub/link/satellite and time_interval to the materialization strategy enum, and scd2 to the ingestr incremental strategy list, matching the current Bruin CLI and ingestr sources. Prevents stale validation errors in the editor for valid strategies.
| "append", | ||
| "scd2" | ||
| "scd2", | ||
| "none" |
There was a problem hiding this comment.
When an asset contains incremental_strategy: none, the ingestr editor has no matching option and displays a blank selection; choosing its empty-valued “None” option then removes the field from the saved parameters instead of preserving the valid literal.
Rule Used: What: Comments should be concise and targeted to s... (source)
Knowledge Base Used: Webview UI (Vue Frontend)
Prompt To Fix With AI
This is a comment left during a code review.
Path: schemas/yaml-assets-schema.json
Line: 221
Comment:
**`none` is not preserved**
When an asset contains `incremental_strategy: none`, the ingestr editor has no matching option and displays a blank selection; choosing its empty-valued “None” option then removes the field from the saved parameters instead of preserving the valid literal.
**Rule Used:** What: Comments should be concise and targeted to s... ([source](https://app.greptile.com/bruin/-/custom-context?memory=6adfbd2b-1b23-4560-9e00-6254e7cb7c70))
**Knowledge Base Used:** [Webview UI (Vue Frontend)](https://app.greptile.com/bruin/-/custom-context/knowledge-base/bruin-data/bruin-vscode/-/docs/webview-ui.md)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
Prompt To Fix All With AI### Issue 1
schemas/yaml-assets-schema.json:221
**`none` is not preserved**
When an asset contains `incremental_strategy: none`, the ingestr editor has no matching option and displays a blank selection; choosing its empty-valued “None” option then removes the field from the saved parameters instead of preserving the valid literal.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (1): Last reviewed commit: "Sync materialization & ingestr strategy ..." | Re-trigger Greptile |
…ssets Ingestr assets only accept create+replace/delete+insert/append/merge/ truncate+insert for materialization.strategy (bruin translates these to ingestr's incremental strategies). Add a type-conditional so the editor rejects SQL-only strategies (ddl, scd2_*, datavault_*, time_interval) and guides 'replace' to 'create+replace' on ingestr assets, matching bruin validate.
|
Reviews (2): Last reviewed commit: "Restrict materialization.strategy to the..." | Re-trigger Greptile |
ingestr removed truncate+insert (use replace) and supports scd2. Align the ingestr materialization.strategy set accordingly: create+replace, delete+insert, append, merge, scd2_by_time, scd2_by_column (the scd2_* names map to ingestr's scd2). Matches the Bruin CLI once its bruin->ingestr strategy map is updated.
|
Reviews (3): Last reviewed commit: "Update ingestr strategy set: drop trunca..." | Re-trigger Greptile |
|
Reviews (4): Last reviewed commit: "Bump to 0.83.3; changelog + release note..." | Re-trigger Greptile |
The Bruin CLI is adding 'replace' as an alias for 'create+replace'. Allow it in both the base materialization strategy enum and the ingestr subset so a valid 'strategy: replace' no longer shows a false validation error.
|
Reviews (5): Last reviewed commit: "Accept 'replace' as an alias for 'create..." | Re-trigger Greptile |
The extension's strategy lists had drifted from the Bruin CLI, so valid strategies showed up as validation errors / missing autocomplete in the editor.
Sync the strategy lists with the CLI source of truth:
AllAvailableMaterializationStrategies, bruinpkg/pipeline/pipeline.go): addedtime_interval(was missing from the schema) anddatavault_hub,datavault_link,datavault_satellite.internal/config/config.go): addedscd2; addednoneto the schema enum.Make
materialization.strategytype-aware for ingestr assets:The schema applied one flat strategy enum to every asset type, but ingestr assets only accept a subset. Added an
if type == ingestrconditional so the editor rejects SQL-only strategies (ddl,datavault_*,time_interval) and guidesreplace→create+replace.The ingestr set reflects what ingestr supports now:
create+replace, delete+insert, append, merge, scd2_by_time, scd2_by_column. This dropstruncate+insert(ingestr removed it — "use replace") and adds scd2 (thescd2_*names map to ingestr'sscd2), matching the Bruin CLI once its bruin→ingestr strategy map is updated.Verified with a draft-07 validator across ingestr + SQL assets.
Strategies change far less often than connection types, so these lists stay hand-maintained (unlike
config-schema.json, which is synced daily) — the CLI has no command to enumerate strategies.