Skip to content

feat: [#1670] Compile / Execute dbt Model (Full Refresh)#1882

Draft
ralphstodomingo wants to merge 3 commits intomasterfrom
feat/1670-full-refresh-compile
Draft

feat: [#1670] Compile / Execute dbt Model (Full Refresh)#1882
ralphstodomingo wants to merge 3 commits intomasterfrom
feat/1670-full-refresh-compile

Conversation

@ralphstodomingo
Copy link
Copy Markdown
Contributor

@ralphstodomingo ralphstodomingo commented Apr 10, 2026

Summary

Closes #1670.

Adds two new command-palette entries that invoke the existing compile / execute flows with --full-refresh (or its Python-bridge equivalent), so users previewing an incremental model can see the full-refresh shape of the compiled query — is_incremental() evaluates to false and the incremental-only where clause is absent.

User-facing commands

  • dbt Power User: Compile dbt Model (Full Refresh) (dbtPowerUser.compileCurrentModelFullRefresh)
    Invokes dbt compile --select <model> --full-refresh, so target/compiled/<project>/<model>.sql contains the rendered full-refresh version of the model. Open "Show Compiled SQL" right after to read it.
  • dbt Power User: Execute dbt SQL (Full Refresh) (dbtPowerUser.executeSQLFullRefresh)
    Ctrl+Enter analogue. Compiles the current file with is_incremental() forced to false (via the Python bridge for Core integration, or dbt show --full-refresh for CLI-based integrations), then runs the preview query in the query panel.

Both commands leave the existing non-full-refresh variants untouched — dbtPowerUser.compileCurrentModel and dbtPowerUser.executeSQL dispatch dbt without --full-refresh exactly as before.

Companion upstream PR

Depends on AltimateAI/altimate-dbt-integration#44, which adds the underlying fullRefresh plumbing — both the Python-bridge full_refresh kwarg on DbtProject.compile_sql/compile_node (with a clone-then-set pattern that doesn't mutate global dbt flags) and the CLI-level conditional --full-refresh flag append in all four integration classes + the DBTCommandFactory.createCompileModelCommand.

Bump the @altimateai/dbt-integration dependency after #44 merges and is published. This PR builds locally against a linked copy of the fix branch for verification.

Files

  • src/commands/runModel.tscompileModelOnActiveWindow and executeQueryOnActiveWindow gain an optional fullRefresh param threaded into compileDBTModel and executeSQL
  • src/dbt_client/dbtProjectContainer.tscompileModel and executeSQL accept fullRefresh; createModelParams puts it on RunModelParams so the upstream factory can read it when building the CLI args
  • src/dbt_client/dbtProject.tsexecuteSQLOnQueryPanel and executeSQLWithLimitOnQueryPanel thread the flag into dbtProjectIntegration.executeSQLWithLimit
  • src/commands/index.ts — two new commands.registerCommand calls wiring the new command IDs to the existing RunModel methods with fullRefresh=true
  • package.json — two new command contributions
  • src/test/suite/runModelFullRefresh.test.ts — 6 new Jest cases

Verification

Unit tests

PASS src/test/suite/runModelFullRefresh.test.ts
  RunModel — fullRefresh dispatch (#1670)
    compileModelOnActiveWindow
      ✓ passes fullRefresh=false by default (existing behavior)
      ✓ passes fullRefresh=true when the full-refresh variant is invoked (#1670)
      ✓ no-ops when there is no active editor
    executeQueryOnActiveWindow
      ✓ passes fullRefresh=false by default (existing Ctrl+Enter behavior)
      ✓ passes fullRefresh=true when the full-refresh variant is invoked (#1670)
      ✓ no-ops when there is no active editor

Full Jest suite: 21 suites, 263 passed, 1 skipped, 0 failing. tsc --noEmit clean. npx webpack --mode development builds clean.

Docker runtime verification against origin/master HEAD

Same repro recipe as the baseline evidence (see follow-up comment): .worktrees/master-baseline code-server container running jaffle-shop-duckdb with an orders_incremental model (materialized='incremental' with an {% if is_incremental() %}where order_date > (select max(order_date) from {{ this }}){% endif %} guard). After dbt seed && dbt run --select orders_incremental twice so the relation exists and is_incremental() naturally evaluates to true, I built this branch's extension with the patched upstream dist linked into node_modules/@altimateai/dbt-integration/ and opened models/orders_incremental.sql in code-server.

Before — master HEAD (plain dbt Power User: Compile dbt Model):

Extension log:

dbt compile --select orders_incremental --target dev

target/compiled/jaffle_shop/models/orders_incremental.sql:

select * from "jaffle_shop"."main"."stg_orders"

  where order_date > (select max(order_date) from "jaffle_shop"."main"."orders_incremental")

This is the #1670 bug — the where clause is baked in.

After — this branch (dbt Power User: Compile dbt Model (Full Refresh)):

Extension log:

dbt compile --select orders_incremental --full-refresh --target dev

target/compiled/jaffle_shop/models/orders_incremental.sql:

select * from "jaffle_shop"."main"."stg_orders"

Clean, no where clause. Then I re-invoked the original Compile dbt Model command in the same session to confirm it still dispatches without --full-refresh:

dbt compile --select orders_incremental --target dev

The new command is fully opt-in — the existing compile flow is unaffected.

Test plan

  • npx jest src/test/suite/runModelFullRefresh.test.ts — 6/6 pass
  • Full Jest suite green (263 passing, 1 skipped)
  • tsc --noEmit clean
  • npx webpack --mode development builds clean
  • Docker runtime: plain Compile dbt Model on master HEAD produces SQL with the is_incremental() where clause (bug reproduces); new Compile dbt Model (Full Refresh) on this branch produces SQL without the where clause (bug fixed); plain Compile dbt Model on this branch still dispatches without --full-refresh (no regression)
  • Extension log shows the exact CLI invocation dbt compile --select <model> --full-refresh --target dev
  • Manual verification of Execute dbt SQL (Full Refresh) (Ctrl+Enter analogue) — exercised by upstream Python-bridge unit test in Environment configuration pre-requisites? #44; consumer-side manual test pending once the upstream dep is bumped
  • Cloud / Fusion / CoreCommand integration end-to-end — the upstream PR plumbs the flag through all four integration classes; manual sanity check pending once a user has access to those warehouse environments
  • Bump @altimateai/dbt-integration to the version containing Environment configuration pre-requisites? #44 before merging

Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com

Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added "Compile dbt Model (Full Refresh)" command to the dbt Power User extension.
    • Added "Execute dbt SQL (Full Refresh)" command to the dbt Power User extension.
  • Tests

    • Added tests verifying full-refresh dispatch behavior for compile and execute commands, including default (no-full-refresh) and explicit full-refresh cases.

…l Refresh)

Adds two new command-palette entries that invoke the existing compile /
execute flows with `--full-refresh` (or its Python-bridge equivalent), so
users previewing an incremental model see the full-refresh shape of the
compiled query — i.e. `is_incremental()` evaluates to false and the
incremental-only `where` clause is absent. Closes #1670.

## User-facing commands

- `dbtPowerUser.compileCurrentModelFullRefresh`
  — "dbt Power User: Compile dbt Model (Full Refresh)"
  Invokes `dbt compile --select <model> --full-refresh` so
  `target/compiled/<project>/<model>.sql` contains the rendered
  full-refresh version of the model.
- `dbtPowerUser.executeSQLFullRefresh`
  — "dbt Power User: Execute dbt SQL (Full Refresh)"
  Ctrl+Enter analogue: compiles the current file (via the Python bridge
  for Core integration, or `dbt show --full-refresh` for CLI-based
  integrations) with `is_incremental()` forced to false, then runs the
  preview query.

Both commands leave the existing non-full-refresh variants untouched:
`dbtPowerUser.compileCurrentModel` and `dbtPowerUser.executeSQL`
continue to invoke dbt without `--full-refresh`, and regular Ctrl+Enter
behavior is unchanged.

## Implementation

Thin consumer wiring over the `fullRefresh` plumbing added in
`altimate-dbt-integration` (companion PR
AltimateAI/altimate-dbt-integration#44 —
required for this PR to function; bump the dep after it merges).

- `src/commands/runModel.ts`: `compileModelOnActiveWindow` and
  `executeQueryOnActiveWindow` gain an optional `fullRefresh` param,
  passed through to `compileDBTModel` and `executeSQL` which relay it
  into `DBTProjectContainer`.
- `src/dbt_client/dbtProjectContainer.ts`: `compileModel` and
  `executeSQL` accept `fullRefresh`; `createModelParams` puts it on the
  `RunModelParams` object so `DBTCommandFactory.createCompileModelCommand`
  in `altimate-dbt-integration` can append `--full-refresh` to the CLI
  args.
- `src/dbt_client/dbtProject.ts`: `executeSQLOnQueryPanel` and its
  with-limit variant thread the flag into
  `dbtProjectIntegration.executeSQLWithLimit`.
- `src/commands/index.ts`: two new `commands.registerCommand` calls that
  invoke the existing `RunModel` methods with `fullRefresh=true`.
- `package.json`: the two new command contributions.

## Tests

- `src/test/suite/runModelFullRefresh.test.ts` — 6 new Jest cases:
  * `compileModelOnActiveWindow` passes `fullRefresh=false` by default
  * `compileModelOnActiveWindow(true)` passes `fullRefresh=true`
  * `compileModelOnActiveWindow` no-ops with no active editor
  * `executeQueryOnActiveWindow` passes `fullRefresh=false` by default
  * `executeQueryOnActiveWindow(true)` passes `fullRefresh=true`
  * `executeQueryOnActiveWindow` no-ops with no active editor

Full Jest suite: 21 suites, 263 passed, 1 skipped, 0 failing.
`tsc --noEmit` clean.

Docker runtime verification (companion evidence on the upstream PR;
this PR's end-to-end run captured in a follow-up comment): extension
dispatches `dbt compile --select orders_incremental --full-refresh
--target dev` when the new command is invoked, `target/compiled/...`
is written without the `is_incremental()` `where` clause, and the
existing plain compile command continues to dispatch without
`--full-refresh`.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 10, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 0ebd7dcc-b46d-4315-b47b-b446fae7cc19

📥 Commits

Reviewing files that changed from the base of the PR and between 93ff0eb and d1788b2.

📒 Files selected for processing (3)
  • package.json
  • src/commands/index.ts
  • src/dbt_client/dbtProjectContainer.ts
✅ Files skipped from review due to trivial changes (1)
  • package.json
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/commands/index.ts
  • src/dbt_client/dbtProjectContainer.ts

Walkthrough

Adds two "Full Refresh" VS Code commands and threads a fullRefresh boolean from command registration through RunModel, DBTProjectContainer, and DBTProject layers to request full-refresh behavior when compiling or executing SQL.

Changes

Cohort / File(s) Summary
Command contributions
package.json
Added two new commands: dbtPowerUser.compileCurrentModelFullRefresh and dbtPowerUser.executeSQLFullRefresh with titles and category.
Command registrations
src/commands/index.ts
Registered the two new commands to call RunModel methods with true for full refresh.
RunModel dispatch
src/commands/runModel.ts
Added optional fullRefresh: boolean = false params to compileModelOnActiveWindow, executeQueryOnActiveWindow, compileDBTModel, and executeSQL, and forwarded the flag downstream.
DBT project wiring
src/dbt_client/dbtProjectContainer.ts, src/dbt_client/dbtProject.ts
Propagated fullRefresh into compileModel, executeSQL, executeSQLOnQueryPanel, and executeSQLWithLimitOnQueryPanel; adjusted parameter objects and event payloads; added a local type-cast workaround to pass the extra arg to external integration.
Tests
src/test/suite/runModelFullRefresh.test.ts
New Jest suite verifying dispatch of fullRefresh true/false for compile and execute paths, and no-ops when no active editor.

Sequence Diagram(s)

sequenceDiagram
  participant User as User
  participant VSCode as "VS Code Command\n(package.json / index.ts)"
  participant RunModel as RunModel
  participant Container as DBTProjectContainer
  participant Project as DBTProject
  participant Integration as dbtIntegration

  User->>VSCode: invoke Full Refresh command
  VSCode->>RunModel: compileModelOnActiveWindow(fullRefresh=true) / executeQueryOnActiveWindow(fullRefresh=true)
  RunModel->>Container: compileModel(..., fullRefresh=true) / executeSQL(..., fullRefresh=true)
  Container->>Project: executeSQLOnQueryPanel(..., fullRefresh=true) / compileModel(..., fullRefresh=true)
  Project->>Integration: executeSQLWithLimit(..., fullRefresh=true) / compileModel(..., fullRefresh=true)
  Integration-->>Project: result
  Project-->>Container: result/event
  Container-->>RunModel: completion
  RunModel-->>VSCode: show output
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • mdesmet
  • anandgupta42
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: adding full-refresh variants of compile and execute commands for incremental dbt models.
Description check ✅ Passed The PR description comprehensively covers the problem, solution, user-facing commands, affected files, verification results, and test plan. While not all checklist items are marked complete, the core information is complete and well-documented.
Linked Issues check ✅ Passed All requirements from issue #1670 are met: new opt-in commands provide full-refresh compiled SQL preview for incremental models and enable full-refresh preview execution without altering existing non-full-refresh flows.
Out of Scope Changes check ✅ Passed All changes are in scope: command registrations, method signatures, parameter threading, test additions, and configuration entries directly serve the full-refresh feature objective without unrelated modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/1670-full-refresh-compile

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

The `fullRefresh` plumbing lives in `@altimateai/dbt-integration`#44,
which has not shipped to npm yet. Until the dep is bumped, CI runs
`tsc`/webpack against the published 0.2.12 types that still declare
`executeSQLWithLimit` with 3 parameters, so the 4-arg call added in the
previous commit fails with `TS2554: Expected 3 arguments, but got 4.`.

Widen the method reference locally via `as unknown as` cast with a
`TODO(#1670)` comment pointing at the upstream PR. When the dep is
bumped to the version containing #44, the cast can be deleted in a
one-line follow-up.

Verified locally against a freshly-installed `@altimateai/dbt-integration@0.2.12`
from npm: `tsc --noEmit` clean, `webpack --mode development` clean,
6/6 unit tests still pass.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 10, 2026

Bundle Size Report

darwin-arm64: 70.1 MB
Category Size Compressed Files
Native: altimate-core 35.1 MB 14.0 MB 1
Media assets 29.6 MB 25.8 MB 91
Webview JS bundles 26.1 MB 8.3 MB 343
Native: zeromq 20.5 MB 8.2 MB 15
Webview images 15.3 MB 12.2 MB 18
Extension backend (JS) 2.8 MB 0.5 MB 2
Python packages 2.0 MB 0.5 MB 95
Native: other node_modules 1.0 MB 0.2 MB 139
Webview CSS 0.8 MB 0.1 MB 2
Webview other 0.5 MB 0.1 MB 5
Other 0.1 MB 24 KB 14
Total 133.7 MB 69.9 MB 725
linux-x64: 71.8 MB
Category Size Compressed Files
Native: altimate-core 41.8 MB 15.1 MB 1
Media assets 29.6 MB 25.8 MB 91
Webview JS bundles 26.1 MB 8.3 MB 343
Native: zeromq 21.9 MB 8.7 MB 16
Webview images 15.3 MB 12.2 MB 18
Extension backend (JS) 2.8 MB 0.5 MB 2
Python packages 2.0 MB 0.5 MB 95
Native: other node_modules 1.0 MB 0.2 MB 139
Webview CSS 0.8 MB 0.1 MB 2
Webview other 0.5 MB 0.1 MB 5
Other 0.1 MB 24 KB 14
Total 141.8 MB 71.6 MB 726
win32-x64: 72.7 MB
Category Size Compressed Files
Native: altimate-core 50.3 MB 16.2 MB 1
Media assets 29.6 MB 25.8 MB 91
Webview JS bundles 26.1 MB 8.3 MB 343
Native: zeromq 20.0 MB 8.1 MB 15
Webview images 15.3 MB 12.2 MB 18
Extension backend (JS) 2.8 MB 0.5 MB 2
Native: other node_modules 2.3 MB 0.7 MB 147
Python packages 2.0 MB 0.5 MB 95
Webview CSS 0.8 MB 0.1 MB 2
Webview other 0.5 MB 0.1 MB 5
Other 0.1 MB 24 KB 14
Total 149.6 MB 72.6 MB 733

@ralphstodomingo ralphstodomingo self-assigned this Apr 12, 2026
@mdesmet mdesmet marked this pull request as ready for review April 14, 2026 01:17
@mdesmet mdesmet self-requested a review April 14, 2026 01:17
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/dbt_client/dbtProjectContainer.ts (1)

423-444: ⚠️ Potential issue | 🟠 Major

Preserve fullRefresh when re-running compile history entries.

This helper now emits RunModelParams.fullRefresh, but rerunFromHistory() still rebuilds params through parseHistoryArgs() and never sets that bit. A history entry created by dbtPowerUser.compileCurrentModelFullRefresh will therefore replay as a plain compile. parseHistoryArgs() needs to detect --full-refresh and return fullRefresh: true as well.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/dbt_client/dbtProjectContainer.ts` around lines 423 - 444,
parseHistoryArgs currently rebuilds RunModelParams without preserving the
--full-refresh flag, so rerunFromHistory loses fullRefresh even though
createModelParams emits it; update parseHistoryArgs to scan the history args for
the literal "--full-refresh" (or its short form if supported) and set
fullRefresh: true in the returned RunModelParams/RunModelParams-like object,
ensuring rerunFromHistory uses that value; reference parseHistoryArgs,
rerunFromHistory, RunModelParams, and createModelParams to locate where the
params are produced and consumed and add the fullRefresh boolean to the parsed
result.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@package.json`:
- Around line 594-598: The package currently exposes
dbtPowerUser.compileCurrentModelFullRefresh and
dbtPowerUser.executeSQLFullRefresh in package.json but the installed integration
`@altimateai/dbt-integration` is pinned to ^0.2.12 which lacks the fullRefresh
parameter; update package.json and/or installation logic to either bump the
dependency to a release that supports the 4th fullRefresh argument or only
register those commands when the runtime integration version exposes that API.
Specifically, remove or gate registration of the two command IDs in package.json
or the activation code and update src/dbt_client/dbtProject.ts to stop using the
temporary cast (the TODO) unless the checked integration version proves support;
implement a version check against `@altimateai/dbt-integration` and conditionally
wire up dbtPowerUser.compileCurrentModelFullRefresh and
dbtPowerUser.executeSQLFullRefresh or update the dependency to a compatible
version.

---

Outside diff comments:
In `@src/dbt_client/dbtProjectContainer.ts`:
- Around line 423-444: parseHistoryArgs currently rebuilds RunModelParams
without preserving the --full-refresh flag, so rerunFromHistory loses
fullRefresh even though createModelParams emits it; update parseHistoryArgs to
scan the history args for the literal "--full-refresh" (or its short form if
supported) and set fullRefresh: true in the returned
RunModelParams/RunModelParams-like object, ensuring rerunFromHistory uses that
value; reference parseHistoryArgs, rerunFromHistory, RunModelParams, and
createModelParams to locate where the params are produced and consumed and add
the fullRefresh boolean to the parsed result.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 20a42563-46b7-4fbf-89bd-4d6393b2fd77

📥 Commits

Reviewing files that changed from the base of the PR and between 9a0ba3a and 93ff0eb.

📒 Files selected for processing (6)
  • package.json
  • src/commands/index.ts
  • src/commands/runModel.ts
  • src/dbt_client/dbtProject.ts
  • src/dbt_client/dbtProjectContainer.ts
  • src/test/suite/runModelFullRefresh.test.ts

Comment thread package.json
Comment on lines +594 to +598
{
"command": "dbtPowerUser.compileCurrentModelFullRefresh",
"title": "Compile dbt Model (Full Refresh)",
"category": "dbt Power User"
},
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.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf 'Declared dependency in package.json:\n'
rg -n '"@altimateai/dbt-integration"' package.json

printf '\nResolved dependency in lockfiles (if present):\n'
rg -n '@altimateai/dbt-integration' yarn.lock package-lock.json pnpm-lock.yaml 2>/dev/null || true

printf '\nLocal patch-package overrides touching dbt integration:\n'
fd -i 'altimate*dbt*integration*' patches . -t f 2>/dev/null || true
rg -n 'fullRefresh|executeSQLWithLimit|createCompileModelCommand' patches 2>/dev/null || true

Repository: AltimateAI/vscode-dbt-power-user

Length of output: 411


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "=== Verifying command entries at specified lines in package.json ==="
sed -n '594,598p' package.json
echo ""
sed -n '706,710p' package.json

echo ""
echo "=== Checking dbtProject.ts for the temporary workaround ==="
sed -n '1354,1367p' src/dbt_client/dbtProject.ts || echo "File or line range not found"

echo ""
echo "=== Checking if fullRefresh is used in commands implementation ==="
rg -n 'compileCurrentModelFullRefresh|executeSQLFullRefresh' src --type ts -A 3 | head -30

Repository: AltimateAI/vscode-dbt-power-user

Length of output: 1847


🌐 Web query:

@altimateai/dbt-integration releases fullRefresh support 0.2.13 0.3.0 2025 2026

💡 Result:

The npm package @altimateai/dbt-integration is a TypeScript library providing unified integration for dbt projects, supporting dbt Core, dbt Cloud, dbt Fusion, and CLI execution. It handles manifest parsing, dependency graphs, and dbt operations. No explicit evidence found for "fullRefresh support" (dbt's full_refresh config or --full-refresh flag handling) being added in specific versions 0.2.13 or 0.3.0. Searches across npm pages, GitHub repos (AltimateAI organization, vscode-dbt-power-user PRs), changelogs, and releases show versions up to 0.2.12 mentioned (e.g., upgraded in vscode-dbt-power-user releases), with version history indicating 0.2.0-0.2.9 from Oct 2025-Mar 2026 (23 total versions first published Jun 2025). No GitHub source repo for the package found, no changelogs mentioning these versions or fullRefresh. The library likely supports standard dbt flags including --full-refresh via its command execution interfaces (e.g., DBTFacade), as it unifies dbt operations, but specific addition in 0.2.13/0.3.0 or 2025/2026 timeline unconfirmed. vscode-dbt-power-user integrates this library (PR #1697, Jun-Oct 2025) and supports dbt features like defer, but no fullRefresh mention. AltimateAI's altimate-dbt-snowflake-query-tags package tracks full_refresh in query metadata (v2.0.0, Mar 2026).

Citations:


Gate these fullRefresh commands on the integration package version that actually supports them.

The commands dbtPowerUser.compileCurrentModelFullRefresh (594-598) and dbtPowerUser.executeSQLFullRefresh (706-710) are exposed in the manifest and wired to pass the fullRefresh flag. However, @altimateai/dbt-integration is still locked to ^0.2.12, which does not support this parameter. The workaround in src/dbt_client/dbtProject.ts (1354-1367) explicitly casts the type to accept the 4th parameter while the published typings declare only 3 parameters—a temporary solution marked with a TODO pending the integration package update. Users invoking these commands will experience silent degradation: the commands will execute without the full-refresh behavior. Either bump the integration dependency to a version that supports fullRefresh, or conditionally register these commands only when the required version is installed.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@package.json` around lines 594 - 598, The package currently exposes
dbtPowerUser.compileCurrentModelFullRefresh and
dbtPowerUser.executeSQLFullRefresh in package.json but the installed integration
`@altimateai/dbt-integration` is pinned to ^0.2.12 which lacks the fullRefresh
parameter; update package.json and/or installation logic to either bump the
dependency to a release that supports the 4th fullRefresh argument or only
register those commands when the runtime integration version exposes that API.
Specifically, remove or gate registration of the two command IDs in package.json
or the activation code and update src/dbt_client/dbtProject.ts to stop using the
temporary cast (the TODO) unless the checked integration version proves support;
implement a version check against `@altimateai/dbt-integration` and conditionally
wire up dbtPowerUser.compileCurrentModelFullRefresh and
dbtPowerUser.executeSQLFullRefresh or update the dependency to a compatible
version.

@ralphstodomingo ralphstodomingo marked this pull request as draft April 15, 2026 02:10
@ralphstodomingo
Copy link
Copy Markdown
Contributor Author

Full E2E verification complete across both the dbt-integration library and the power-user extension.

What was tested

Docker code-server container, jaffle-shop-duckdb fixture, with @altimateai/dbt-integration locally replaced by the feat/compile-full-refresh branch build (see AltimateAI/altimate-dbt-integration#44 with the new materialized gate). Power-user rebuilt with npx webpack --mode development, container restarted, extension driven through the actual VS Code command palette via Playwright.

Fixture has both an incremental model (orders_incremental, with a seeded target relation so is_incremental() returns True) and a table model (fr_gate_table).

UI command Target model Expected Actual
dbt Power User: Compile dbt Model orders_incremental compiled SQL includes where order_date > (select max(...)) pass
dbt Power User: Compile dbt Model (Full Refresh) orders_incremental compiled SQL omits the incremental where clause pass
dbt Power User: Compile dbt Model fr_gate_table plain select 1 as customer_id, 'alice' as name pass
dbt Power User: Compile dbt Model (Full Refresh) fr_gate_table byte-identical to non-full-refresh (gate no-op) pass

Regression coverage: non-full-refresh incremental compile still produces the is_incremental() branch (so the fullRefresh=false path is untouched), and both fr_gate_table compiles are byte-identical (diff empty) which proves the materialized gate makes full_refresh a true no-op on non-incremental models.

Phase 1 (bridge-level harness) additionally verifies compile_sql(raw, 'orders_incremental', full_refresh=True) — the unsafeCompileQuery path used by dbtPowerUser.executeSQLFullRefresh — strips the incremental branch as expected. The CLI-based integrations (Cloud / Fusion / Core Command) are covered by the compileFullRefresh.test.ts unit tests in AltimateAI/altimate-dbt-integration#44.

Evidence lives in test-fixtures/1670-full-refresh/e2e-evidence/ (phase1 JSON + phase2 compiled SQL files + SUMMARY.md).

Unblocking checklist

Still blocked on AltimateAI/altimate-dbt-integration#44 merging and publishing a new @altimateai/dbt-integration version. Once that ships:

  1. Bump @altimateai/dbt-integration in package.json to the new version
  2. Drop the as unknown as cast at src/dbt_client/dbtProject.ts:1354-1367 (TODO already references Add choice to generate --full-refresh compiled query for incremental models #1670)

Incidental finding (not caused by this PR — flagging for a separate issue)

Worth knowing for anyone debugging this feature: power-user's Core-integration dbt subprocess runs with a different CWD than a user's direct dbt compile, so if profiles.yml has a relative path: for the duckdb file (e.g. path: jaffle_shop.duckdb), dbt-duckdb opens a fresh empty DB at the wrong location. adapter.get_relation(...) then returns None for the incremental target and is_incremental() silently returns False — which masquerades as "full-refresh isn't working." Absolute paths in profiles.yml sidestep it entirely. Happy to open a separate issue if you'd like.

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.

Add choice to generate --full-refresh compiled query for incremental models

2 participants