Skip to content

Commit b00c1cd

Browse files
anandgupta42claude
andcommitted
fix: address code review — remove build-project command, update help text, add stderr test
- Remove `build-project` from command map and switch case in `index.ts` (now redundant since `build` without `--model` does the same thing) - Update `build` help text to reflect optional `--model` - Remove unused `project` import from `build.test.ts` - Add test for `format()` stderr error path - Fix comment alignment in all 5 `altimate-dbt-commands.md` reference files Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 8db18a3 commit b00c1cd

7 files changed

Lines changed: 17 additions & 11 deletions

File tree

.opencode/skills/dbt-analyze/references/altimate-dbt-commands.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ altimate-dbt info # Project name, adapter, root
2020
## Build & Run
2121

2222
```bash
23-
altimate-dbt build # full project build (compile + run + test)
23+
altimate-dbt build # full project build (compile + run + test)
2424
altimate-dbt build --model <name> [--downstream] # build a single model
2525
altimate-dbt run --model <name> [--downstream] # materialize only
2626
altimate-dbt test --model <name> # run tests only

.opencode/skills/dbt-develop/references/altimate-dbt-commands.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ altimate-dbt info # Project name, adapter, root
2020
## Build & Run
2121

2222
```bash
23-
altimate-dbt build # full project build (compile + run + test)
23+
altimate-dbt build # full project build (compile + run + test)
2424
altimate-dbt build --model <name> [--downstream] # build a single model
2525
altimate-dbt run --model <name> [--downstream] # materialize only
2626
altimate-dbt test --model <name> # run tests only

.opencode/skills/dbt-docs/references/altimate-dbt-commands.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ altimate-dbt info # Project name, adapter, root
2020
## Build & Run
2121

2222
```bash
23-
altimate-dbt build # full project build (compile + run + test)
23+
altimate-dbt build # full project build (compile + run + test)
2424
altimate-dbt build --model <name> [--downstream] # build a single model
2525
altimate-dbt run --model <name> [--downstream] # materialize only
2626
altimate-dbt test --model <name> # run tests only

.opencode/skills/dbt-test/references/altimate-dbt-commands.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ altimate-dbt info # Project name, adapter, root
2020
## Build & Run
2121

2222
```bash
23-
altimate-dbt build # full project build (compile + run + test)
23+
altimate-dbt build # full project build (compile + run + test)
2424
altimate-dbt build --model <name> [--downstream] # build a single model
2525
altimate-dbt run --model <name> [--downstream] # materialize only
2626
altimate-dbt test --model <name> # run tests only

.opencode/skills/dbt-troubleshoot/references/altimate-dbt-commands.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ altimate-dbt info # Project name, adapter, root
2020
## Build & Run
2121

2222
```bash
23-
altimate-dbt build # full project build (compile + run + test)
23+
altimate-dbt build # full project build (compile + run + test)
2424
altimate-dbt build --model <name> [--downstream] # build a single model
2525
altimate-dbt run --model <name> [--downstream] # materialize only
2626
altimate-dbt test --model <name> # run tests only

packages/dbt-tools/src/index.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,9 @@ const USAGE = {
1111
info: "Get project info (paths, targets, version)",
1212
compile: "Compile a model (Jinja to SQL) --model <name>",
1313
"compile-query": "Compile a raw query --query <sql> [--model <name>]",
14-
build: "Build a model --model <name> [--downstream]",
14+
build: "Build project, or a single model with --model <name> [--downstream]",
1515
run: "Run a model --model <name> [--downstream]",
1616
test: "Test a model --model <name>",
17-
"build-project": "Build entire project",
1817
execute: "Execute SQL --query <sql> [--model <name>] [--limit <n>]",
1918
columns: "Get columns of model --model <name>",
2019
"columns-source": "Get columns of source --source <name> --table <name>",
@@ -171,9 +170,6 @@ async function main() {
171170
case "test":
172171
result = await (await import("./commands/build")).test(adapter, rest)
173172
break
174-
case "build-project":
175-
result = await (await import("./commands/build")).project(adapter)
176-
break
177173
case "execute":
178174
result = await (await import("./commands/execute")).execute(adapter, rest)
179175
break

packages/dbt-tools/test/build.test.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { describe, test, expect, mock } from "bun:test"
2-
import { build, project } from "../src/commands/build"
2+
import { build } from "../src/commands/build"
33
import type { DBTProjectIntegrationAdapter } from "@altimateai/dbt-integration"
44

55
function makeAdapter(overrides: Partial<DBTProjectIntegrationAdapter> = {}): DBTProjectIntegrationAdapter {
@@ -44,4 +44,14 @@ describe("build command", () => {
4444
plusOperatorRight: "+",
4545
})
4646
})
47+
48+
test("build surfaces stderr as error", async () => {
49+
const adapter = makeAdapter({
50+
unsafeBuildProjectImmediately: mock(() =>
51+
Promise.resolve({ stdout: "partial output", stderr: "compilation error" }),
52+
),
53+
})
54+
const result = await build(adapter, [])
55+
expect(result).toEqual({ error: "compilation error", stdout: "partial output" })
56+
})
4757
})

0 commit comments

Comments
 (0)