🚀 Enhancements
fix: propagate component-type level dependencies through stack processor @osterman (#2127)
## what- Stack processor now extracts and merges
dependenciesfrom global (Scope 1) and component-type (Scope 2) sections - Component-type level dependencies defined via
terraform.dependencies.tools(and helmfile/packer/ansible equivalents) now flow through to component configs - Toolchain auto-install is now triggered for mixin-pattern dependencies defined at the component-type level
- Dependencies merge chain now includes all 3 scopes: global/component-type → base component → component instance
why
The bug prevented users from configuring dependencies at the component-type level (Scope 2) via mixin patterns like:
terraform:
dependencies:
tools:
terraform: "1.6.0"The stack processor dropped this data before it reached the toolchain resolver, so auto-install never triggered. Users reported exec: "terraform": executable file not found in $PATH errors when they configured Scope 2 dependencies.
This fix ensures all 3 scopes of dependencies are properly extracted, merged with correct precedence, and propagated through to component sections where the resolver can access them.
references
Fixes the bug discussed in the Slack conversation where Jonathan Rose configured Scope 2 dependencies but toolchain auto-install wasn't triggered.
Changes:
errors/errors.go: Added 5 sentinel errors for dependencies validationinternal/exec/stack_processor_process_stacks_helpers.go: AddedGlobalDependenciesfield toComponentProcessorOptionsinternal/exec/stack_processor_process_stacks.go: Extract and merge dependencies from all 3 scopes, pass through opts buildersinternal/exec/stack_processor_merge.go: Updated merge chain to include global dependencies with lowest prioritytests/: Added 2 integration tests proving Scope 2 dependencies trigger toolchain auto-install
Summary by CodeRabbit
-
New Features
- Declare dependencies at global, component-type, and component scopes; these are merged with defined precedence and propagated into component processing.
-
Chores
- Added validation error sentinels to surface invalid dependencies sections across component types.
-
Tests
- Added integration fixtures and unit tests covering dependency propagation, precedence, inheritance, binary/toolchain handling, and invalid-section error paths.