v1.225.0-rc.5
Pre-release
Pre-release
feat: dependency-closure selection (--include-dependencies/--include-dependents) + scope --labels/--tags evaluation before filtering Erik Osterman (Cloud Posse) (@osterman) (#2807)
## whatDependency-closure selection (new)
- Every multi-component terraform selection (
--all,--components,--query,-s,--tags,--labels,--affected) accepts two new depth-carrying flags onplan/apply/deploy/destroy/init:--include-dependencies[=N]— also process everything the selection depends on (its prerequisites), N levels deep (bare flag = unlimited).--include-dependents[=N]— the reverse direction. Previously a bool wired only into--affected; now works with every selection and accepts a depth (true/falseremain accepted for compatibility).
- Selectors choose the seed; closure flags expand it: closure members execute even when they don't match the selectors that seeded them, in dependency order (reversed for destroy), with cross-stack edges followed.
destroy --include-dependencieswarns that it also destroys shared prerequisites. - The same flags on
atmos list components/stacks/instancespreview the exact execution set a bulk run would touch. - Depth support in the graph engine:
pkg/dependency.Filtergains per-direction depth bounds with a best-depth BFS; the scheduler adapter is restructured to seed-then-expand (tags/labels/query moved from post-filter to seed narrowing, per-node query skip suppressed when the seed already applied it). - The three-phase scoped evaluation built for
list dependenciesis generalized intodependencies.ResolveScopedClosureand shared with the terraform bulk paths, so closure runs fully evaluate only the stacks the closure touches.
Selector purity (new, by design)
metadata.tags/metadata.labelsare selectors evaluated before auth/templating/YAML functions, so their values must be resolvable without authentication or process execution. Values using!terraform.state,!terraform.output,!store,!store.get,!secret,!aws.*,!emulator,!exec,!random, or template calls toatmos.Component/atmos.Store/atmos.GomplateDatasource/datasources are rejected with a by-design error and migration hint on any command that processes the manifest. Plain strings, simple templates, and local functions (!env,!git.*,!include) remain allowed.- Validation parses template actions with the configured delimiters (
templates.settings.delimiters) via Go's template parser — no regex heuristics — andtags.SelectorUnresolvedis now delimiter-aware too.
Scope-before-evaluate for --labels/--tags (original scope)
- Early-skip scope check in the shared describe-stacks processor: a component excluded by
--tags/--labelsskips auth/template/YAML-function evaluation entirely, generalizing the existing-s/--stackearly-skip. Now also threaded intolist stacks/components/instances(previously they row-filtered after full evaluation). atmos list dependenciescomputes a lightweight dependency graph, derives the reachable closure, and only fully evaluates the stacks that closure touches — re-converging against the resolved graph so templated same-stack dependency targets still resolve.describe.settings.eager_evaluationremains the rollback switch forcing the old full-evaluation behavior.
Tests and docs
- Unit tests across
pkg/tags(purity + delimiter cases),pkg/dependency(depth/cycles/diamonds),pkg/scheduler/adapters(closure retains non-matching prereqs, destroy ordering, query suppression, depth merging),pkg/list/dependencies(scoped-evaluation convergence with a poisoned unrelated stack), and the list/cmd layers; regenerated help-text golden snapshots. - Docusaurus docs for all new flags (terraform + list commands), a Selector Purity section in the stack metadata docs, a changelog blog post (
website/blog/2026-07-27-include-dependencies-closure.mdx), and a roadmap entry.
why
- On a monorepo spanning multiple AWS accounts,
atmos terraform ... --all --labels=.../--tags=...andatmos list dependencies --stack <stack>fully evaluated every stack in the repo (templates, YAML functions, auth/backend) before consulting the selector, so an unrelated account's unreachable backend failed the command. - Deploying "a stack and everything it needs" (or tearing down "a component and everything that depends on it") required hand-maintained bash wrappers around Atmos, even though the dependency graph and topological scheduler already existed — the selection just never followed the edges.
- Making tags/labels drive scoping decisions before evaluation requires them to be cheaply resolvable; the purity contract makes that explicit design rather than a silent perf cliff.
references
- Builds on
docs/fixes/2026-06-22-describe-stacks-scope-and-cache-per-component-auth.md. - See
docs/fixes/2026-07-25-scope-before-evaluate-labels-tags-list-dependencies.mdfor root-cause and verification detail of the scope-before-evaluate work (its Recommendations section is implemented by this PR's closure flags).
🤖 Generated with Claude Code
Summary by CodeRabbit
Release Notes
-
New Features
- Added dependency and dependent expansion with optional depth limits and cross-stack relationships.
- Added dependency-closure previews for component, stack, and instance selections.
- Added tag and label filtering across list commands, including vendor tags.
- Added
levelsoutput for shortest dependency distances. - Label filters now support
key=valueandkey:valueformats.
-
Improvements
- Scoped evaluation skips unrelated components for filtered selections.
- Added eager-evaluation controls for bulk selections.
- Added clearer validation and warnings for unsupported flag combinations and dependency expansion during destroy operations.
- Expanded CLI documentation and help text for new filtering and dependency options.
🚀 Enhancements
fix(config): stop recommending deprecated stacks.name_pattern Erik Osterman (Cloud Posse) (@osterman) (#2842)
## whatatmos aws eks update-kubeconfigand Spacelift stack-name generation now checkstacks.name_templatebefore falling back to the deprecatedstacks.name_pattern, instead of only supporting the deprecated field.- Error messages in
pkg/config,errors/errors.go, andpkg/helmfile/cluster.gothat previously only pointed users at the deprecated fields now recommendname_template/cluster_name_template. - The Getting Started tutorial and the
aws eks update-kubeconfigcommand help/docs no longer teach the deprecatedname_pattern/cluster_name_patternfields. - Converted all
examples/,demo/, and non-backward-compat-testtests/fixturesscenarios fromname_patterntoname_template(a handful of fixtures that specifically test the deprecated field, precedence, or backward compatibility were left untouched on purpose). - Added unit tests covering both the new
name_templatesupport and continuedname_patternbackward compatibility for the two code paths that changed.
why
- Investigating #2827 ("profile-merged
stackssettings are not consistently applied") showed the profile-merge pipeline was already correct and consistent betweendescribe configandlist dependencies. - The actual bug was that
stacks.name_pattern— deprecated in favor ofstacks.name_template— was still treated as the primary/only stack-naming mechanism in a couple of code paths and in several error messages, which is what produced the reported inconsistency and general user confusion about which field to use. name_patterncontinues to work unchanged for backward compatibility; only the recommended path and documentation change.
references
- Investigates #2827
Summary by CodeRabbit
- New Features
- Added Go-template support for stack, Spacelift stack, and EKS cluster naming using context variables.
- Compatibility
- Existing pattern-based naming remains supported as a deprecated fallback.
- Template settings take precedence when both options are configured.
- Documentation
- Updated configuration guidance, examples, and error messages to promote template-based naming.
- Tests
- Added coverage for naming precedence, fallback behavior, template errors, duplicate names, and profile-based stack discovery.