feat(dbt-tools): build entire project when altimate-dbt build has no --model#465
feat(dbt-tools): build entire project when altimate-dbt build has no --model#465
Conversation
`altimate-dbt build` without arguments now builds the whole project via `unsafeBuildProjectImmediately`, replacing the need for the separate `build-project` command. Updated all dbt skill references accordingly. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review to trigger a review.
Tip: disable this comment in your organization's Code Review settings.
📝 WalkthroughWalkthroughReplaced documentation references to Changes
Sequence Diagram(s)sequenceDiagram
participant CLI as "CLI"
participant BuildCmd as "build(command)"
participant Adapter as "DBTProjectIntegrationAdapter"
CLI->>BuildCmd: invoke `altimate-dbt build` or `altimate-dbt build --model <name> [--downstream]`
alt full-project?
BuildCmd->>Adapter: unsafeBuildProjectImmediately()
Adapter-->>BuildCmd: project build result
else model-specific
BuildCmd->>Adapter: unsafeBuildModelImmediately({modelName, plusOperatorLeft, plusOperatorRight})
Adapter-->>BuildCmd: model build result
end
BuildCmd-->>CLI: stdout / exit code
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
Covers: no-model → project build, --model → single model, --downstream flag. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
packages/dbt-tools/test/build.test.ts (1)
38-46: Consider adding result and mutual-exclusion assertions for consistency.Tests 1 and 2 assert both the return value and that the "other" method was not called. This test only checks the call parameters. Adding similar assertions would make the suite consistent.
Suggested enhancement
test("build --model <name> --downstream sets plusOperatorRight", async () => { const adapter = makeAdapter() - await build(adapter, ["--model", "orders", "--downstream"]) + const result = await build(adapter, ["--model", "orders", "--downstream"]) expect(adapter.unsafeBuildModelImmediately).toHaveBeenCalledWith({ plusOperatorLeft: "", modelName: "orders", plusOperatorRight: "+", }) + expect(adapter.unsafeBuildProjectImmediately).not.toHaveBeenCalled() + expect(result).toEqual({ stdout: "model built" }) })🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/dbt-tools/test/build.test.ts` around lines 38 - 46, Capture the return value from await build(adapter, ["--model", "orders", "--downstream"]) into a result variable and assert it equals the mocked return value of adapter.unsafeBuildModelImmediately (mock its return if not already mocked), and also add a mutual-exclusion assertion that adapter.unsafeBuildModelQueued was not called; locate the test using makeAdapter(), build(), adapter.unsafeBuildModelImmediately and adapter.unsafeBuildModelQueued and add expect(result).toEqual(<mockedValue>) and expect(adapter.unsafeBuildModelQueued).not.toHaveBeenCalled().
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/dbt-tools/test/build.test.ts`:
- Line 2: The import statement imports an unused symbol "project" from
"../src/commands/build"; remove "project" from the import so only "build" is
imported (i.e., change `import { build, project } ...` to `import { build }
...`), then run tests/lint to confirm the unused-import error is resolved.
---
Nitpick comments:
In `@packages/dbt-tools/test/build.test.ts`:
- Around line 38-46: Capture the return value from await build(adapter,
["--model", "orders", "--downstream"]) into a result variable and assert it
equals the mocked return value of adapter.unsafeBuildModelImmediately (mock its
return if not already mocked), and also add a mutual-exclusion assertion that
adapter.unsafeBuildModelQueued was not called; locate the test using
makeAdapter(), build(), adapter.unsafeBuildModelImmediately and
adapter.unsafeBuildModelQueued and add expect(result).toEqual(<mockedValue>) and
expect(adapter.unsafeBuildModelQueued).not.toHaveBeenCalled().
🪄 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: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 8e27511c-8b32-4f04-b66a-502f08543363
📒 Files selected for processing (1)
packages/dbt-tools/test/build.test.ts
| @@ -0,0 +1,47 @@ | |||
| import { describe, test, expect, mock } from "bun:test" | |||
| import { build, project } from "../src/commands/build" | |||
There was a problem hiding this comment.
Remove unused project import.
project is imported but never used in this file.
Suggested fix
-import { build, project } from "../src/commands/build"
+import { build } from "../src/commands/build"📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| import { build, project } from "../src/commands/build" | |
| import { build } from "../src/commands/build" |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@packages/dbt-tools/test/build.test.ts` at line 2, The import statement
imports an unused symbol "project" from "../src/commands/build"; remove
"project" from the import so only "build" is imported (i.e., change `import {
build, project } ...` to `import { build } ...`), then run tests/lint to confirm
the unused-import error is resolved.
Summary
altimate-dbt buildwithout--modelnow builds the entire project (callsunsafeBuildProjectImmediately), instead of returning an errorbuild-projectcommand still works as beforealtimate-dbt-commands.mdreference files to document the new behaviorTest plan
altimate-dbt buildin a dbt project directory builds the full projectaltimate-dbt build --model <name>still builds a single modelaltimate-dbt build --model <name> --downstreamstill builds with downstream🤖 Generated with Claude Code
Summary by CodeRabbit
altimate-dbt buildfor full-project builds andaltimate-dbt build --model <name> [--downstream]for single-model builds; removedaltimate-dbt build-project.altimate-dbt buildnow performs full project compile+run+test when no--modelis provided.