-
Notifications
You must be signed in to change notification settings - Fork 4
fix: altimate-dbt compile, execute, and children commands fail with runtime errors #255
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
9f0afa8
fix: `altimate-dbt` compile, execute, and children commands — CLI fal…
anandgupta42 a582fbd
fix: 3-tier version resilience for dbt CLI fallbacks
anandgupta42 5f9e772
test: e2e tests against real dbt project — 5 versions (1.7, 1.8, 1.9,…
anandgupta42 108b7be
fix: make `children`/`parents` async to catch rejections and await fa…
anandgupta42 d803cfe
fix: address 6-model consensus code review — 7 issues fixed
anandgupta42 0ece4e3
feat: robust dbt binary resolver for 16 Python environment managers
anandgupta42 613ea88
test: e2e tests for dbt resolver — 10 real Python environment scenarios
anandgupta42 d329159
chore: move e2e tests to test/e2e/ — default `bun test` runs in 2.8s
anandgupta42 f3cd0da
fix: address Sentry PR comments — 4 remaining issues
anandgupta42 7a7dfc0
ci: add dbt-tools unit tests (PRs) and e2e tests (merge to main)
anandgupta42 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,30 @@ | ||
| fix: comprehensive XSS hardening for trace viewer HTML | ||
| fix: `altimate-dbt` compile, execute, and children commands — CLI fallbacks for dbt 1.11+ (#252) | ||
|
|
||
| Systematically escape all user-controllable fields in `viewer.ts`: | ||
| The `@altimateai/dbt-integration` library's JSON output parsing breaks with | ||
| newer dbt versions (1.11.x) where the log format changed. Three commands | ||
| were affected: | ||
|
|
||
| - Escape `span.kind` and `span.status` in detail panel, waterfall, tree, and log views | ||
| - Escape `span.spanId` in `data-sid` attributes | ||
| - Coerce all numeric fields with `Number()` to prevent string injection via `.toLocaleString()` | ||
| - Add single-quote escaping (`'`) to the `e()` function for defense-in-depth | ||
| - `execute`: `dbt show` output no longer contains `data.preview` in the | ||
| expected format — `d[0].data` throws when the filter returns empty. | ||
| - `compile`: `dbt compile` output no longer contains `data.compiled` — | ||
| same `o[0].data` pattern failure. | ||
| - `children`: `nodeMetaMap.lookupByBaseName()` fails when the manifest | ||
| file-path resolution doesn't populate the model-name lookup map. | ||
|
|
||
| Additionally, `tryExecuteViaDbt` in opencode incorrectly expected | ||
| `raw.table` on `QueryExecutionResult`, which actually has `{ columnNames, | ||
| columnTypes, data }` — causing the dbt-first execution path to always | ||
| fall through to native drivers silently. | ||
|
|
||
| Fixes: | ||
| - Add try-catch in execute/compile/graph commands with fallback to direct | ||
| `dbt` CLI subprocess calls (`dbt show`, `dbt compile`, `dbt ls`) | ||
| - New `dbt-cli.ts` module with resilient multi-format JSON output parsing | ||
| (handles `data.preview`, `data.rows`, `data.compiled`, `data.compiled_code`, | ||
| `result.node.compiled_code`) | ||
| - Fix `tryExecuteViaDbt` to recognize `QueryExecutionResult` shape first, | ||
| then fall back to legacy `raw.table` format | ||
|
|
||
| Closes #252 | ||
|
|
||
| Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: The error handling in
compile.tsonly catchesTypeError, unlikeexecute.tsandgraph.ts, potentially missing other error types and preventing the intended fallback from executing.Severity: MEDIUM
Suggested Fix
Align the error handling in
compile.tswith the pattern used inexecute.tsandgraph.ts. Broaden thecatchcondition to includee instanceof Errorand check for specific, relevant error messages if known, or handle allErrorinstances to ensure the fallback is always triggered on parsing failures.Prompt for AI Agent