Skip to content

Sync materialization & ingestr strategy lists with Bruin CLI - #807

Open
DjamilaBaroudi wants to merge 5 commits into
mainfrom
update-strategy-lists
Open

Sync materialization & ingestr strategy lists with Bruin CLI#807
DjamilaBaroudi wants to merge 5 commits into
mainfrom
update-strategy-lists

Conversation

@DjamilaBaroudi

@DjamilaBaroudi DjamilaBaroudi commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

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:

  • Materialization strategies (AllAvailableMaterializationStrategies, bruin pkg/pipeline/pipeline.go): added time_interval (was missing from the schema) and datavault_hub, datavault_link, datavault_satellite.
  • Ingestr incremental strategies (ingestr internal/config/config.go): added scd2; added none to the schema enum.

Make materialization.strategy type-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 == ingestr conditional so the editor rejects SQL-only strategies (ddl, datavault_*, time_interval) and guides replacecreate+replace.

The ingestr set reflects what ingestr supports now: create+replace, delete+insert, append, merge, scd2_by_time, scd2_by_column. This drops truncate+insert (ingestr removed it — "use replace") and adds scd2 (the scd2_* names map to ingestr's scd2), 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.

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"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 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)

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.

Fix in Conductor

@greptile-apps

greptile-apps Bot commented Jul 30, 2026

Copy link
Copy Markdown

Fix All in Conductor

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.
@greptile-apps

greptile-apps Bot commented Jul 30, 2026

Copy link
Copy Markdown

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.
@greptile-apps

greptile-apps Bot commented Jul 30, 2026

Copy link
Copy Markdown

Reviews (3): Last reviewed commit: "Update ingestr strategy set: drop trunca..." | Re-trigger Greptile

@greptile-apps

greptile-apps Bot commented Jul 30, 2026

Copy link
Copy Markdown

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.
@greptile-apps

greptile-apps Bot commented Jul 30, 2026

Copy link
Copy Markdown

Reviews (5): Last reviewed commit: "Accept 'replace' as an alias for 'create..." | Re-trigger Greptile

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