feat(cli): node selection for compile - #26
Merged
Conversation
…tions) `compile` now accepts the same selection flags as `run`/`build` (--actions, --tags, --include-deps, --include-dependents) and prunes the compiled graph before printing, mirroring dbt's `compile --select`. The whole project still compiles (ref() resolution needs every action registered); this only filters the printed output. A clean graph is pruned when a selector is present; on compile errors the full graph + errors print unchanged. A selector matching nothing emits an empty graph and exits 0, matching prune's run-side behavior. Reuses the existing prune() and the shared yargs option definitions — no proto changes. Adds a `compile node selection` test suite over an upstream->midstream->downstream project covering each flag, empty matches, and the "--include-deps without a selector is rejected" validation. Closes #25 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Jun 16, 2026
Merged
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Adds node selection to
compile, mirroringdbt compile --select.compilenow accepts the same selection flags asrun/build—--actions,--tags,--include-deps,--include-dependents— and filters the printed graph to just the selected action(s):How it works
This is output filtering, not partial compilation. The whole project must still compile (
ref()resolution and the dependency graph require every action registered), so we compile fully and then prune the result before printing — reusing the existing, battle-testedprune()thatrun/buildalready use, plus the shared yargs option definitions. No proto changes.prune's run-side behavior.--include-deps/--include-dependentsretain their existing validation (only valid alongside--actions/--tags).Tests
New
compile node selectionsuite incli/index_compile_test.tsover anupstream -> midstream -> downstreamproject, covering: full graph (no selector),--actions,--include-deps,--include-dependents,--tags, empty-match exits 0, and the no-selector validation error.//cli:index_compile_testpasses (full suite + new tests).Closes #25
🤖 Generated with Claude Code