Skip to content

feat: stack name identity with zero-config filename fallback#1934

Merged
aknysh merged 17 commits intomainfrom
osterman/fix-import-cycle-1932
Jan 10, 2026
Merged

feat: stack name identity with zero-config filename fallback#1934
aknysh merged 17 commits intomainfrom
osterman/fix-import-cycle-1932

Conversation

@osterman
Copy link
Copy Markdown
Member

@osterman osterman commented Jan 5, 2026

what

  • Enforce single stack name identity - each stack now has exactly ONE valid identifier
  • Add filename-based identity - stacks work with just filenames when no naming config exists (zero-config for newcomers)
  • Improve error messages - when using an invalid stack name, error now says "invalid stack" and provides hints suggesting the correct name and how to list available stacks
  • Fix ProcessStacks to recognize the stack manifest name field when matching stacks
  • Add JSON schema documentation for the name field
  • Add PRD documenting the stack name identity rules
  • Add CLI smoke tests with golden snapshots

why

Issue 1: Manifest name not recognized

When a stack manifest has name: "my-explicit-stack", users expect to use that name in commands:

atmos tf plan vpc -s my-explicit-stack

Previously this failed with "Could not find the component vpc in the stack".

Issue 2: Multiple names worked (incorrect)

After the initial fix, ALL of these worked for the same stack:

atmos tf plan vpc -s my-explicit-stack  # explicit name
atmos tf plan vpc -s prod-ue1           # generated from name_template
atmos tf plan vpc -s legacy-prod        # filename

This is incorrect - a stack should have exactly ONE valid identifier.

Issue 3: Misleading error message

When using an invalid stack name (e.g., filename when explicit name exists), the error said "invalid component" instead of "invalid stack":

**Error:** invalid component

Could not find the component vpc in the stack legacy-prod.

New: Zero-config for newcomers

When no name, name_template, or name_pattern is configured, stacks are now identified by their filename. This lets newcomers get started without any naming configuration:

# stacks/prod.yaml - no naming config needed
components:
  terraform:
    vpc:
      vars:
        cidr: "10.0.0.0/16"
# Just works!
atmos terraform plan vpc -s prod

Stack Name Identity Rule

Each stack has exactly ONE valid identifier based on precedence:

Priority Source When Valid
1 name field in manifest If set, ONLY this name works
2 name_template result If set (and no explicit name), ONLY this works
3 name_pattern result If set (and no template/name), ONLY this works
4 Filename Only if nothing else is configured

Evidence

atmos list stacks - shows canonical names
my-legacy-prod-stack
no-name-prod

Note: my-legacy-prod-stack is shown (explicit name), not legacy-prod (filename).

atmos describe component vpc -s no-name-prod - filename works when no naming config
{
  "atmos_component": "vpc",
  "atmos_stack": "no-name-prod",
  "atmos_stack_file": "no-name-prod",
  "stack": "no-name-prod",
  "workspace": "no-name-prod"
}
atmos describe component vpc -s my-legacy-prod-stack - explicit name works
{
  "atmos_component": "vpc",
  "atmos_stack": "my-legacy-prod-stack",
  "atmos_stack_file": "legacy-prod",
  "atmos_manifest": "legacy-prod",
  "stack": "my-legacy-prod-stack",
  "workspace": "my-legacy-prod-stack"
}

Note: atmos_stack is my-legacy-prod-stack (explicit name), while atmos_stack_file shows legacy-prod (the actual filename).

atmos describe component vpc -s legacy-prod - FAILS with helpful suggestions
# Error

**Error:** invalid stack

## Explanation

Stack legacy-prod not found.

## Hints

💡 Did you mean my-legacy-prod-stack?

💡 Run atmos list stacks to see all available stacks.

This is correct - legacy-prod.yaml has name: my-legacy-prod-stack, so only that identifier is valid. The error now correctly identifies this as an invalid stack (not component) and provides hints suggesting the correct name and how to list available stacks.

atmos terraform plan vpc -s legacy-prod - FAILS with helpful suggestions
# Error

**Error:** invalid stack

## Explanation

Stack legacy-prod not found.

## Hints

💡 Did you mean my-legacy-prod-stack?

💡 Run atmos list stacks to see all available stacks.

Changes

  • errors/errors.go: Add ErrInvalidStack sentinel error
  • internal/exec/utils.go: Enforce single-identity matching in findComponentInStacks; return helpful error with suggestion when filename is used for stack with explicit name; enable filename fallback in processStackContextPrefix
  • internal/exec/stack_manifest_name_test.go: Add tests for identity enforcement, filename fallback, and improved error messages
  • tests/test-cases/stack-manifest-name.yaml: Add CLI smoke tests with golden snapshots for stack name identity
  • pkg/datafetcher/schema/atmos/manifest/1.0.json: Add schema documentation for name field
  • docs/prd/stack-name-identity.md: PRD documenting the specification (status: Implemented)
  • website/blog/2026-01-06-stack-name-identity.mdx: Blog post documenting the changes
  • website/src/data/roadmap.js: Add "Filename-based stack identity" to DX roadmap

References

Summary by CodeRabbit

  • New Features

    • Single canonical stack identity with precedence (name → name_template → name_pattern → filename), zero‑config filename naming, and clearer "Did you mean…?" suggestions for invalid stacks.
  • Documentation

    • Added product requirements and a blog post explaining identity rules, examples, migration guidance, and UX notes.
  • Tests

    • Expanded test suites and updated snapshots to validate naming precedence, listing/describe behavior, and suggestion messages.
  • Chores

    • Roadmap updated and CLI telemetry notice added to outputs.

✏️ Tip: You can customize this high-level summary in your review settings.

Add tests that demonstrate the issue where ProcessStacks cannot find a
component when the user specifies the manifest-level 'name' field as the
stack argument.

The test reproduces the scenario where:
- Stack manifest has name: "my-explicit-stack"
- atmos.yaml has name_template configured
- User runs: atmos tf plan vpc -s my-explicit-stack
- Expected: Component is found
- Actual: Error "Could not find the component vpc in the stack"

This affects all commands that call ProcessStacks: terraform, helmfile,
packer, describe component, validate component, etc.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
@osterman osterman requested a review from a team as a code owner January 5, 2026 18:37
@github-actions github-actions bot added the size/s Small size PR label Jan 5, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Jan 5, 2026

Dependency Review

✅ No vulnerabilities or license issues found.

Scanned Files

None

@osterman osterman added the patch A minor, backward compatible change label Jan 5, 2026
Update findComponentInStacks to check against the manifest-level 'name'
field when matching stacks. Previously, only ContextPrefix (derived from
name_template or name_pattern) was checked, causing commands like
`atmos tf plan vpc -s my-custom-name` to fail when the stack used a
manifest name override.

Stack matching now checks against:
1. ContextPrefix (from name_template/name_pattern)
2. Stack manifest name (the 'name' field, if present)
3. Stack filename (for backward compatibility)

Closes #1932

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov bot commented Jan 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.05%. Comparing base (4f7f6d8) to head (8534ad2).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1934      +/-   ##
==========================================
+ Coverage   74.01%   74.05%   +0.04%     
==========================================
  Files         770      770              
  Lines       69326    69352      +26     
==========================================
+ Hits        51313    51362      +49     
+ Misses      14603    14581      -22     
+ Partials     3410     3409       -1     
Flag Coverage Δ
unittests 74.05% <100.00%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
errors/errors.go 100.00% <ø> (ø)
internal/exec/describe_stacks.go 72.75% <100.00%> (-0.14%) ⬇️
internal/exec/utils.go 81.55% <100.00%> (+1.30%) ⬆️

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Add JSON schema documentation for the stack-level 'name' field that
allows explicit stack naming with highest precedence over name_template
and name_pattern from atmos.yaml.

Also documents the metadata.name field for component identity.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@github-actions github-actions bot added size/m Medium size PR and removed size/s Small size PR labels Jan 5, 2026
@osterman osterman changed the title test: add failing test to reproduce stack name override bug fix: honor stack manifest 'name' field in ProcessStacks Jan 6, 2026
Update `findComponentInStacks` to enforce that each stack has exactly
ONE valid identifier based on precedence:

1. Explicit `name` field in manifest (highest priority)
2. Generated name from `name_template` or `name_pattern`
3. Stack filename (only when nothing else is configured)

Previously, all three identifiers worked for the same stack, which
caused confusion. Now, when a stack has an explicit `name` field,
only that name is valid - using the filename or generated name will
fail.

Changes:
- internal/exec/utils.go: Replace OR matching with single-identity rule
- internal/exec/stack_manifest_name_test.go: Add tests verifying rejection
- docs/prd/stack-name-identity.md: Document the specification

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@osterman osterman force-pushed the osterman/fix-import-cycle-1932 branch from 425c23d to a6f0c05 Compare January 6, 2026 14:04
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Jan 6, 2026

📝 Walkthrough

Walkthrough

Implements a single canonical stack identity (precedence: manifest name > name_template > name_pattern > filename), enables zero‑config filename-based stack naming, propagates canonical names during stack discovery, surfaces ErrInvalidStack with “Did you mean …” suggestions, and adds schema, docs, tests, and snapshots.

Changes

Cohort / File(s) Summary
Docs & Blog / Schema
docs/prd/stack-name-identity.md, website/blog/2026-01-06-stack-name-identity.mdx, pkg/datafetcher/schema/atmos/manifest/1.0.json
New PRD and blog post; adds name to manifest schema (root and metadata); documents precedence and zero‑config filename behavior.
Core logic: stack resolution
internal/exec/utils.go, internal/exec/describe_stacks.go
findComponentInStacks now computes canonical stack names per stack and returns a filename→canonical map; processStackContextPrefix falls back to filename for zero‑config; ProcessStacks uses mappings to produce targeted “Did you mean …” hints.
Errors
errors/errors.go
Adds exported sentinel ErrInvalidStack = errors.New("invalid stack").
Tests & Snapshots
internal/exec/stack_manifest_name_test.go, tests/test-cases/stack-manifest-name.yaml, tests/snapshots/*stack-manifest-name*.golden, tests/snapshots/*my-legacy-prod-stack*.golden, tests/snapshots/*legacy-prod_(invalid)*.golden, tests/snapshots/*no-name-prod*.golden
New unit/integration tests for manifest/name precedence, filename fallback, list/describe behaviors, and invalid‑stack suggestions; updated CLI stdout/stderr snapshots (telemetry line and new hints).
Roadmap / Misc
website/src/data/roadmap.js
Adds "Filename-based stack identity (zero-config)" milestone and updates DX progress metric.

Sequence Diagram(s)

sequenceDiagram
  participant CLI as CLI (user)
  participant Process as ProcessStacks
  participant Finder as findComponentInStacks
  participant FS as Stacks (files/manifests)
  participant Err as Error/Hint generator

  CLI->>Process: invoke command with --stack <input>
  Process->>Finder: enumerate stacks, pass atmos config
  Finder->>FS: read each stack manifest/filename
  FS-->>Finder: manifest data (name, name_template, name_pattern) / filename
  alt manifest.name exists
    Finder->>Finder: canonical = manifest.name
  else name_template or name_pattern exists
    Finder->>Finder: canonical = generated ContextPrefix
  else
    Finder->>Finder: canonical = filename (zero-config)
  end
  Finder-->>Process: return matched component(s) + filename→canonical map
  alt match found
    Process->>CLI: proceed with operation using canonical name
  else no match
    Process->>Err: build "invalid stack" error with suggestion from map
    Err-->>CLI: "Error: invalid stack" + "Did you mean <canonical>?" hint
  end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested reviewers

  • osterman
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main feature: adding stack name identity with zero-config filename fallback support.
Linked Issues check ✅ Passed The PR fully addresses issue #1932 by implementing manifest name recognition, consistent stack lookup, and improved error handling across all commands.
Out of Scope Changes check ✅ Passed All changes directly support the stack name identity feature: schema updates, error handling, test coverage, and documentation—no extraneous modifications detected.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch osterman/fix-import-cycle-1932

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 4f7f6d8 and 8534ad2.

📒 Files selected for processing (21)
  • docs/prd/stack-name-identity.md
  • errors/errors.go
  • internal/exec/describe_stacks.go
  • internal/exec/stack_manifest_name_test.go
  • internal/exec/utils.go
  • pkg/datafetcher/schema/atmos/manifest/1.0.json
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_legacy-prod_(invalid_-_should_suggest_correct_name).stderr.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_legacy-prod_(invalid_-_should_suggest_correct_name).stdout.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_my-legacy-prod-stack.stderr.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_my-legacy-prod-stack.stdout.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_no-name-prod.stderr.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_no-name-prod.stdout.golden
  • tests/snapshots/TestCLICommands_atmos_describe_stacks_(stack-manifest-name).stderr.golden
  • tests/snapshots/TestCLICommands_atmos_describe_stacks_(stack-manifest-name).stdout.golden
  • tests/snapshots/TestCLICommands_atmos_list_stacks_(stack-manifest-name).stderr.golden
  • tests/snapshots/TestCLICommands_atmos_list_stacks_(stack-manifest-name).stdout.golden
  • tests/snapshots/TestCLICommands_atmos_terraform_plan_vpc_-s_legacy-prod_(invalid).stderr.golden
  • tests/snapshots/TestCLICommands_atmos_terraform_plan_vpc_-s_legacy-prod_(invalid).stdout.golden
  • tests/test-cases/stack-manifest-name.yaml
  • website/blog/2026-01-06-stack-name-identity.mdx
  • website/src/data/roadmap.js
🧰 Additional context used
📓 Path-based instructions (7)
tests/snapshots/**/*

📄 CodeRabbit inference engine (CLAUDE.md)

Never manually edit golden snapshot files - always use -regenerate-snapshots flag when updating test output

Files:

  • tests/snapshots/TestCLICommands_atmos_describe_stacks_(stack-manifest-name).stderr.golden
  • tests/snapshots/TestCLICommands_atmos_list_stacks_(stack-manifest-name).stderr.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_my-legacy-prod-stack.stderr.golden
  • tests/snapshots/TestCLICommands_atmos_list_stacks_(stack-manifest-name).stdout.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_no-name-prod.stderr.golden
  • tests/snapshots/TestCLICommands_atmos_terraform_plan_vpc_-s_legacy-prod_(invalid).stderr.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_no-name-prod.stdout.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_my-legacy-prod-stack.stdout.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_legacy-prod_(invalid_-_should_suggest_correct_name).stderr.golden
website/**

📄 CodeRabbit inference engine (.cursor/rules/atmos-rules.mdc)

website/**: Update website documentation in the website/ directory when adding new features, ensure consistency between CLI help text and website documentation, and follow the website's documentation structure and style
Keep website code in the website/ directory, follow the existing website architecture and style, and test website changes locally before committing
Keep CLI documentation and website documentation in sync and document new features on the website with examples and use cases

Files:

  • website/src/data/roadmap.js
  • website/blog/2026-01-06-stack-name-identity.mdx
**/*.go

📄 CodeRabbit inference engine (.cursor/rules/atmos-rules.mdc)

**/*.go: Use Viper for managing configuration, environment variables, and flags in CLI commands
Use interfaces for external dependencies to facilitate mocking and consider using testify/mock for creating mock implementations
All code must pass golangci-lint checks
Follow Go's error handling idioms: use meaningful error messages, wrap errors with context using fmt.Errorf("context: %w", err), and consider using custom error types for domain-specific errors
Follow standard Go coding style: use gofmt and goimports to format code, prefer short descriptive variable names, use kebab-case for command-line flags, and snake_case for environment variables
Document all exported functions, types, and methods following Go's documentation conventions
Document complex logic with inline comments in Go code
Support configuration via files, environment variables, and flags following the precedence order: flags > environment variables > config file > defaults
Provide clear error messages to users, include troubleshooting hints when appropriate, and log detailed errors for debugging

**/*.go: All comments must end with periods (enforced by godot linter) in Go code
Organize imports into three groups separated by blank lines, sorted alphabetically: Go stdlib, 3rd-party (NOT cloudposse/atmos), then Atmos packages with maintained aliases (cfg, log, u, errUtils)
All errors MUST be wrapped using static errors defined in errors/errors.go - use errors.Join for combining errors, fmt.Errorf with %w for context, and errors.Is() for error checking
Never manually create mocks - use go.uber.org/mock/mockgen with //go:generate directives in Go code
Keep files small and focused - under 600 lines with one cmd/impl per file, co-locate tests, never use //revive:disable:file-length-limit
Use colors from pkg/ui/theme/colors.go for all UI theming in Go code
Code must be compatible with Linux, macOS, and Windows - use SDKs over binaries, use filepath.Join() instead of h...

Files:

  • internal/exec/describe_stacks.go
  • errors/errors.go
  • internal/exec/utils.go
  • internal/exec/stack_manifest_name_test.go
**/{pkg,internal,cmd}/**/*.go

📄 CodeRabbit inference engine (CLAUDE.md)

Add defer perf.Track(atmosConfig, "pkg.FuncName")() plus blank line to all public functions, using nil if no atmosConfig param - exceptions: trivial getters/setters, command constructors, simple factories, functions delegating to tracked functions

Files:

  • internal/exec/describe_stacks.go
  • internal/exec/utils.go
  • internal/exec/stack_manifest_name_test.go
docs/prd/**/*.md

📄 CodeRabbit inference engine (CLAUDE.md)

Place all Product Requirement Documents (PRDs) in docs/prd/ using kebab-case filenames

Files:

  • docs/prd/stack-name-identity.md
website/blog/*.mdx

📄 CodeRabbit inference engine (CLAUDE.md)

PRs labeled minor or major MUST include a blog post at website/blog/YYYY-MM-DD-feature-name.mdx with YAML frontmatter, using only tags defined in website/blog/tags.yml

Files:

  • website/blog/2026-01-06-stack-name-identity.mdx
**/*_test.go

📄 CodeRabbit inference engine (.cursor/rules/atmos-rules.mdc)

**/*_test.go: Every new feature must include comprehensive unit tests targeting >80% code coverage for all packages
Use table-driven tests for testing multiple scenarios in Go
Include integration tests for command flows and test CLI end-to-end when possible with test fixtures

Prefer unit tests with mocks over integration tests - use interfaces and dependency injection for testability, generate mocks with go.uber.org/mock/mockgen, use table-driven tests, target >80% coverage

Files:

  • internal/exec/stack_manifest_name_test.go
🧠 Learnings (63)
📓 Common learnings
Learnt from: haitham911
Repo: cloudposse/atmos PR: 731
File: internal/exec/validate_stacks.go:93-98
Timestamp: 2024-10-20T00:41:57.135Z
Learning: When downloading schema files in `internal/exec/validate_stacks.go`, use a consistent temporary file name to overwrite the file each time and avoid creating multiple temporary files.
📚 Learning: 2025-01-19T15:49:15.593Z
Learnt from: samtholiya
Repo: cloudposse/atmos PR: 955
File: tests/snapshots/TestCLICommands_atmos_validate_editorconfig_--help.stdout.golden:0-0
Timestamp: 2025-01-19T15:49:15.593Z
Learning: In future commits, the help text for Atmos CLI commands should be limited to only show component and stack parameters for commands that actually use them. This applies to the example usage section in command help text.

Applied to files:

  • tests/snapshots/TestCLICommands_atmos_describe_stacks_(stack-manifest-name).stderr.golden
  • tests/snapshots/TestCLICommands_atmos_list_stacks_(stack-manifest-name).stderr.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_my-legacy-prod-stack.stderr.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_no-name-prod.stderr.golden
  • tests/snapshots/TestCLICommands_atmos_terraform_plan_vpc_-s_legacy-prod_(invalid).stderr.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_no-name-prod.stdout.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_my-legacy-prod-stack.stdout.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_legacy-prod_(invalid_-_should_suggest_correct_name).stderr.golden
📚 Learning: 2025-09-13T16:39:20.007Z
Learnt from: samtholiya
Repo: cloudposse/atmos PR: 1466
File: cmd/markdown/atmos_toolchain_aliases.md:2-4
Timestamp: 2025-09-13T16:39:20.007Z
Learning: In the cloudposse/atmos repository, CLI documentation files in cmd/markdown/ follow a specific format that uses " $ atmos command" (with leading space and dollar sign prompt) in code blocks. This is the established project convention and should not be changed to comply with standard markdownlint rules MD040 and MD014.

Applied to files:

  • tests/snapshots/TestCLICommands_atmos_describe_stacks_(stack-manifest-name).stderr.golden
  • tests/snapshots/TestCLICommands_atmos_list_stacks_(stack-manifest-name).stderr.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_my-legacy-prod-stack.stderr.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_no-name-prod.stderr.golden
  • tests/snapshots/TestCLICommands_atmos_terraform_plan_vpc_-s_legacy-prod_(invalid).stderr.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_no-name-prod.stdout.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_my-legacy-prod-stack.stdout.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_legacy-prod_(invalid_-_should_suggest_correct_name).stderr.golden
📚 Learning: 2025-03-18T12:26:25.329Z
Learnt from: Listener430
Repo: cloudposse/atmos PR: 1149
File: tests/snapshots/TestCLICommands_atmos_vendor_pull_ssh.stderr.golden:7-7
Timestamp: 2025-03-18T12:26:25.329Z
Learning: In the Atmos project, typos or inconsistencies in test snapshot files (such as "terrafrom" instead of "terraform") may be intentional as they capture the exact output of commands and should not be flagged as issues requiring correction.

Applied to files:

  • tests/snapshots/TestCLICommands_atmos_describe_stacks_(stack-manifest-name).stderr.golden
  • tests/snapshots/TestCLICommands_atmos_list_stacks_(stack-manifest-name).stderr.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_my-legacy-prod-stack.stderr.golden
  • tests/snapshots/TestCLICommands_atmos_list_stacks_(stack-manifest-name).stdout.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_no-name-prod.stderr.golden
  • tests/snapshots/TestCLICommands_atmos_terraform_plan_vpc_-s_legacy-prod_(invalid).stderr.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_no-name-prod.stdout.golden
  • tests/test-cases/stack-manifest-name.yaml
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_my-legacy-prod-stack.stdout.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_legacy-prod_(invalid_-_should_suggest_correct_name).stderr.golden
📚 Learning: 2024-12-07T16:16:13.038Z
Learnt from: Listener430
Repo: cloudposse/atmos PR: 825
File: internal/exec/helmfile_generate_varfile.go:28-31
Timestamp: 2024-12-07T16:16:13.038Z
Learning: In `internal/exec/helmfile_generate_varfile.go`, the `--help` command (`./atmos helmfile generate varfile --help`) works correctly without requiring stack configurations, and the only change needed was to make `ProcessCommandLineArgs` exportable by capitalizing its name.

Applied to files:

  • tests/snapshots/TestCLICommands_atmos_describe_stacks_(stack-manifest-name).stderr.golden
  • tests/snapshots/TestCLICommands_atmos_list_stacks_(stack-manifest-name).stderr.golden
  • tests/snapshots/TestCLICommands_atmos_list_stacks_(stack-manifest-name).stdout.golden
  • tests/snapshots/TestCLICommands_atmos_terraform_plan_vpc_-s_legacy-prod_(invalid).stderr.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_my-legacy-prod-stack.stdout.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_legacy-prod_(invalid_-_should_suggest_correct_name).stderr.golden
  • internal/exec/utils.go
  • internal/exec/stack_manifest_name_test.go
📚 Learning: 2024-11-13T21:37:07.852Z
Learnt from: Cerebrovinny
Repo: cloudposse/atmos PR: 764
File: internal/exec/describe_stacks.go:289-295
Timestamp: 2024-11-13T21:37:07.852Z
Learning: In the `internal/exec/describe_stacks.go` file of the `atmos` project written in Go, avoid extracting the stack name handling logic into a helper function within the `ExecuteDescribeStacks` method, even if the logic appears duplicated.

Applied to files:

  • tests/snapshots/TestCLICommands_atmos_describe_stacks_(stack-manifest-name).stderr.golden
  • internal/exec/describe_stacks.go
  • docs/prd/stack-name-identity.md
  • internal/exec/utils.go
  • internal/exec/stack_manifest_name_test.go
📚 Learning: 2025-12-13T03:21:35.786Z
Learnt from: osterman
Repo: cloudposse/atmos PR: 1813
File: cmd/terraform/shell.go:28-73
Timestamp: 2025-12-13T03:21:35.786Z
Learning: In Atmos, when calling cfg.InitCliConfig, you must first populate the schema.ConfigAndStacksInfo struct with global flag values using flags.ParseGlobalFlags(cmd, v) rather than passing an empty struct. The LoadConfig function (pkg/config/load.go) reads config selection fields (AtmosConfigFilesFromArg, AtmosConfigDirsFromArg, BasePath, ProfilesFromArg) directly from the ConfigAndStacksInfo struct, NOT from Viper. Passing an empty struct causes config selection flags (--base-path, --config, --config-path, --profile) to be silently ignored. Correct pattern: parse flags → populate struct → call InitCliConfig. See cmd/terraform/plan_diff.go for reference implementation.

Applied to files:

  • tests/snapshots/TestCLICommands_atmos_describe_stacks_(stack-manifest-name).stderr.golden
  • tests/snapshots/TestCLICommands_atmos_terraform_plan_vpc_-s_legacy-prod_(invalid).stderr.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_no-name-prod.stdout.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_my-legacy-prod-stack.stdout.golden
  • internal/exec/utils.go
  • internal/exec/stack_manifest_name_test.go
📚 Learning: 2025-09-24T20:45:40.401Z
Learnt from: Benbentwo
Repo: cloudposse/atmos PR: 1475
File: tests/fixtures/scenarios/atmos-auth/stacks/deploy/nonprod.yaml:3-4
Timestamp: 2025-09-24T20:45:40.401Z
Learning: In Atmos stack files, the correct syntax for importing other stack files is `import:` (singular), not `imports:` (plural). All stack files in the Atmos codebase consistently use `import:` followed by a list of paths to import.

Applied to files:

  • tests/snapshots/TestCLICommands_atmos_describe_stacks_(stack-manifest-name).stderr.golden
  • tests/snapshots/TestCLICommands_atmos_terraform_plan_vpc_-s_legacy-prod_(invalid).stderr.golden
  • pkg/datafetcher/schema/atmos/manifest/1.0.json
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_legacy-prod_(invalid_-_should_suggest_correct_name).stderr.golden
  • docs/prd/stack-name-identity.md
  • website/blog/2026-01-06-stack-name-identity.mdx
📚 Learning: 2025-02-03T05:57:18.407Z
Learnt from: samtholiya
Repo: cloudposse/atmos PR: 959
File: cmd/cmd_utils.go:121-148
Timestamp: 2025-02-03T05:57:18.407Z
Learning: The Atmos CLI should fail fast (exit) when encountering configuration errors, including command alias configuration issues, to prevent undefined behavior. Use LogErrorAndExit instead of returning errors in such cases.

Applied to files:

  • tests/snapshots/TestCLICommands_atmos_describe_stacks_(stack-manifest-name).stderr.golden
📚 Learning: 2025-10-07T00:25:16.333Z
Learnt from: osterman
Repo: cloudposse/atmos PR: 1498
File: website/src/components/Screengrabs/atmos-terraform-metadata--help.html:25-55
Timestamp: 2025-10-07T00:25:16.333Z
Learning: In Atmos CLI, subcommands inherit flags from their parent commands via Cobra's command inheritance. For example, `atmos terraform metadata --help` shows `--affected` and related flags inherited from the parent `terraform` command (defined in cmd/terraform.go), even though the metadata subcommand doesn't explicitly define these flags. This is expected Cobra behavior and auto-generated help screengrabs accurately reflect this inheritance.

Applied to files:

  • tests/snapshots/TestCLICommands_atmos_describe_stacks_(stack-manifest-name).stderr.golden
  • tests/snapshots/TestCLICommands_atmos_terraform_plan_vpc_-s_legacy-prod_(invalid).stderr.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_no-name-prod.stdout.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_my-legacy-prod-stack.stdout.golden
📚 Learning: 2025-02-14T23:12:38.030Z
Learnt from: Listener430
Repo: cloudposse/atmos PR: 1061
File: tests/snapshots/TestCLICommands_atmos_vendor_pull_ssh.stderr.golden:8-8
Timestamp: 2025-02-14T23:12:38.030Z
Learning: Test snapshots in the Atmos project, particularly for dry run scenarios, may be updated during the development process, and temporary inconsistencies in their content should not be flagged as issues.

Applied to files:

  • tests/snapshots/TestCLICommands_atmos_describe_stacks_(stack-manifest-name).stderr.golden
  • tests/snapshots/TestCLICommands_atmos_list_stacks_(stack-manifest-name).stderr.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_my-legacy-prod-stack.stderr.golden
  • tests/snapshots/TestCLICommands_atmos_list_stacks_(stack-manifest-name).stdout.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_no-name-prod.stderr.golden
  • tests/snapshots/TestCLICommands_atmos_terraform_plan_vpc_-s_legacy-prod_(invalid).stderr.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_no-name-prod.stdout.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_my-legacy-prod-stack.stdout.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_legacy-prod_(invalid_-_should_suggest_correct_name).stderr.golden
📚 Learning: 2025-10-11T19:12:38.832Z
Learnt from: osterman
Repo: cloudposse/atmos PR: 1599
File: tests/snapshots/TestCLICommands_atmos_workflow_invalid_step_type.stderr.golden:0-0
Timestamp: 2025-10-11T19:12:38.832Z
Learning: Usage Examples sections in error output are appropriate for command usage errors (incorrect syntax, missing arguments, invalid flags) but not for configuration validation errors (malformed workflow files, invalid settings in atmos.yaml). Configuration errors should focus on explaining what's wrong with the config, not command usage patterns.

Applied to files:

  • tests/snapshots/TestCLICommands_atmos_describe_stacks_(stack-manifest-name).stderr.golden
📚 Learning: 2025-02-11T08:21:33.143Z
Learnt from: shirkevich
Repo: cloudposse/atmos PR: 1034
File: website/docs/core-concepts/projects/configuration/stores.mdx:173-177
Timestamp: 2025-02-11T08:21:33.143Z
Learning: The parameter for configuring stack path delimiter in store configurations is consistently named `stack_delimiter` (not `stacks_delimiter`) across all store types in Atmos.

Applied to files:

  • tests/snapshots/TestCLICommands_atmos_describe_stacks_(stack-manifest-name).stderr.golden
  • docs/prd/stack-name-identity.md
  • website/blog/2026-01-06-stack-name-identity.mdx
📚 Learning: 2025-02-06T13:38:07.216Z
Learnt from: Listener430
Repo: cloudposse/atmos PR: 984
File: internal/exec/copy_glob.go:0-0
Timestamp: 2025-02-06T13:38:07.216Z
Learning: The `u.LogTrace` function in the `cloudposse/atmos` repository accepts `atmosConfig` as its first parameter, followed by the message string.

Applied to files:

  • tests/snapshots/TestCLICommands_atmos_describe_stacks_(stack-manifest-name).stderr.golden
  • tests/snapshots/TestCLICommands_atmos_list_stacks_(stack-manifest-name).stderr.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_my-legacy-prod-stack.stderr.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_no-name-prod.stderr.golden
📚 Learning: 2025-09-10T17:34:52.568Z
Learnt from: Benbentwo
Repo: cloudposse/atmos PR: 1475
File: pkg/auth/providers/github/oidc.go:96-100
Timestamp: 2025-09-10T17:34:52.568Z
Learning: The ATMOS_ environment variable binding guideline applies to Atmos configuration variables, not external service-required environment variables like GitHub Actions OIDC variables (GITHUB_ACTIONS, ACTIONS_ID_TOKEN_*) which must use their standard names.

Applied to files:

  • tests/snapshots/TestCLICommands_atmos_describe_stacks_(stack-manifest-name).stderr.golden
📚 Learning: 2024-11-25T17:17:15.703Z
Learnt from: RoseSecurity
Repo: cloudposse/atmos PR: 797
File: pkg/list/atmos.yaml:213-214
Timestamp: 2024-11-25T17:17:15.703Z
Learning: The file `pkg/list/atmos.yaml` is primarily intended for testing purposes.

Applied to files:

  • tests/snapshots/TestCLICommands_atmos_list_stacks_(stack-manifest-name).stderr.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_my-legacy-prod-stack.stderr.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_no-name-prod.stderr.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_no-name-prod.stdout.golden
  • tests/test-cases/stack-manifest-name.yaml
  • pkg/datafetcher/schema/atmos/manifest/1.0.json
📚 Learning: 2025-02-19T05:50:35.853Z
Learnt from: samtholiya
Repo: cloudposse/atmos PR: 1068
File: tests/snapshots/TestCLICommands_atmos_terraform_apply_--help.stdout.golden:0-0
Timestamp: 2025-02-19T05:50:35.853Z
Learning: Backtick formatting should only be applied to flag descriptions in Go source files, not in golden test files (test snapshots) as they are meant to capture the raw command output.

Applied to files:

  • tests/snapshots/TestCLICommands_atmos_list_stacks_(stack-manifest-name).stderr.golden
📚 Learning: 2025-11-01T20:24:29.557Z
Learnt from: osterman
Repo: cloudposse/atmos PR: 1714
File: NOTICE:0-0
Timestamp: 2025-11-01T20:24:29.557Z
Learning: In the cloudposse/atmos repository, the NOTICE file is programmatically generated and should not be manually edited. Issues with dependency license URLs in NOTICE will be resolved when upstream package metadata is corrected.

Applied to files:

  • tests/snapshots/TestCLICommands_atmos_list_stacks_(stack-manifest-name).stderr.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_my-legacy-prod-stack.stderr.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_no-name-prod.stderr.golden
📚 Learning: 2026-01-04T00:55:21.720Z
Learnt from: CR
Repo: cloudposse/atmos PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-04T00:55:21.720Z
Learning: Telemetry is auto-enabled via `RootCmd.ExecuteC()` - non-standard paths use `telemetry.CaptureCmd()` and never capture user data

Applied to files:

  • tests/snapshots/TestCLICommands_atmos_list_stacks_(stack-manifest-name).stderr.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_my-legacy-prod-stack.stderr.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_no-name-prod.stderr.golden
📚 Learning: 2025-11-09T19:06:58.470Z
Learnt from: osterman
Repo: cloudposse/atmos PR: 1752
File: pkg/profile/list/formatter_table.go:27-29
Timestamp: 2025-11-09T19:06:58.470Z
Learning: In the cloudposse/atmos repository, performance tracking with `defer perf.Track()` is enforced on all functions via linting, including high-frequency utility functions, formatters, and renderers. This is a repository-wide policy to maintain consistency and avoid making case-by-case judgment calls about which functions should have profiling.

Applied to files:

  • tests/snapshots/TestCLICommands_atmos_list_stacks_(stack-manifest-name).stderr.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_my-legacy-prod-stack.stderr.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_no-name-prod.stderr.golden
📚 Learning: 2025-01-09T19:53:29.847Z
Learnt from: Listener430
Repo: cloudposse/atmos PR: 912
File: pkg/config/config.go:91-92
Timestamp: 2025-01-09T19:53:29.847Z
Learning: In the Atmos project, the `core.inject_github_token` configuration is required to be enabled (`true`) by default to support authenticated GitHub requests and help bypass rate limits.

Applied to files:

  • tests/snapshots/TestCLICommands_atmos_list_stacks_(stack-manifest-name).stderr.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_my-legacy-prod-stack.stderr.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_no-name-prod.stderr.golden
📚 Learning: 2025-01-16T11:41:35.531Z
Learnt from: osterman
Repo: cloudposse/atmos PR: 942
File: internal/exec/describe_affected_utils.go:802-807
Timestamp: 2025-01-16T11:41:35.531Z
Learning: When checking if a component is enabled in Atmos, use standardized helper function that includes logging. The function should check the `enabled` field in the component's metadata section and log a trace message when skipping disabled components.

Applied to files:

  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_my-legacy-prod-stack.stderr.golden
📚 Learning: 2024-12-01T00:33:20.298Z
Learnt from: aknysh
Repo: cloudposse/atmos PR: 810
File: examples/tests/stacks/catalog/terraform/template-functions-test2/defaults.yaml:28-32
Timestamp: 2024-12-01T00:33:20.298Z
Learning: In `examples/tests/stacks/catalog/terraform/template-functions-test2/defaults.yaml`, `!exec atmos terraform output` is used in examples to demonstrate its usage, even though `!terraform.output` is the recommended approach according to the documentation.

Applied to files:

  • tests/snapshots/TestCLICommands_atmos_terraform_plan_vpc_-s_legacy-prod_(invalid).stderr.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_no-name-prod.stdout.golden
  • tests/test-cases/stack-manifest-name.yaml
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_my-legacy-prod-stack.stdout.golden
📚 Learning: 2025-10-10T23:51:36.597Z
Learnt from: osterman
Repo: cloudposse/atmos PR: 1599
File: internal/exec/terraform.go:394-402
Timestamp: 2025-10-10T23:51:36.597Z
Learning: In Atmos (internal/exec/terraform.go), when adding OpenTofu-specific flags like `--var-file` for `init`, do not gate them based on command name (e.g., checking if `info.Command == "tofu"` or `info.Command == "opentofu"`) because command names don't reliably indicate the actual binary being executed (symlinks, aliases). Instead, document the OpenTofu requirement in code comments and documentation, trusting users who enable the feature (e.g., `PassVars`) to ensure their terraform command points to an OpenTofu binary.

Applied to files:

  • tests/snapshots/TestCLICommands_atmos_terraform_plan_vpc_-s_legacy-prod_(invalid).stderr.golden
📚 Learning: 2025-09-10T21:17:55.273Z
Learnt from: samtholiya
Repo: cloudposse/atmos PR: 1466
File: toolchain/http_client_test.go:3-10
Timestamp: 2025-09-10T21:17:55.273Z
Learning: In the cloudposse/atmos repository, imports should never be changed as per samtholiya's coding guidelines.

Applied to files:

  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_no-name-prod.stdout.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_my-legacy-prod-stack.stdout.golden
📚 Learning: 2026-01-04T00:55:21.720Z
Learnt from: CR
Repo: cloudposse/atmos PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-04T00:55:21.720Z
Learning: Applies to tests/snapshots/**/* : Never manually edit golden snapshot files - always use `-regenerate-snapshots` flag when updating test output

Applied to files:

  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_no-name-prod.stdout.golden
📚 Learning: 2026-01-09T04:49:35.038Z
Learnt from: osterman
Repo: cloudposse/atmos PR: 1907
File: demos/fixtures/acme/stacks/catalog/api.yaml:1-29
Timestamp: 2026-01-09T04:49:35.038Z
Learning: In the cloudposse/atmos demos/fixtures, components can provide Terraform outputs via `remote_state_backend.static` configuration blocks instead of traditional Terraform output blocks. This pattern is used for demo/fixture purposes to simulate cross-component state references without deploying actual infrastructure. The `!terraform.state` YAML function reads from these static backends.

Applied to files:

  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_no-name-prod.stdout.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_my-legacy-prod-stack.stdout.golden
📚 Learning: 2024-12-03T05:29:07.718Z
Learnt from: aknysh
Repo: cloudposse/atmos PR: 810
File: internal/exec/terraform_utils.go:145-146
Timestamp: 2024-12-03T05:29:07.718Z
Learning: In the Atmos project, a 5-minute timeout in the `execTerraformOutput` function is acceptable for retrieving `terraform output` for a component in a stack.

Applied to files:

  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_no-name-prod.stdout.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_my-legacy-prod-stack.stdout.golden
📚 Learning: 2025-12-24T04:29:23.938Z
Learnt from: osterman
Repo: cloudposse/atmos PR: 1891
File: pkg/ci/terraform/templates/apply.md:17-17
Timestamp: 2025-12-24T04:29:23.938Z
Learning: In the cloudposse/atmos repository, Terraform CI templates (pkg/ci/terraform/templates/*.md) are rendered using TerraformTemplateContext (defined in pkg/ci/terraform/context.go), not the base ci.TemplateContext. TerraformTemplateContext provides top-level fields: .Resources (ci.ResourceCounts), .HasChanges() method, and .HasDestroy field, which are correctly accessed directly in templates without a .Result prefix.

Applied to files:

  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_no-name-prod.stdout.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_my-legacy-prod-stack.stdout.golden
📚 Learning: 2024-12-03T05:18:49.169Z
Learnt from: aknysh
Repo: cloudposse/atmos PR: 810
File: internal/exec/terraform_utils.go:40-213
Timestamp: 2024-12-03T05:18:49.169Z
Learning: In the context of the Atmos project, it's acceptable for functions like `execTerraformOutput` to remain as single functions if they perform a single purpose, such as retrieving Terraform outputs for a component in a stack, even if the function is lengthy.

Applied to files:

  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_no-name-prod.stdout.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_my-legacy-prod-stack.stdout.golden
📚 Learning: 2024-12-11T18:40:12.808Z
Learnt from: Listener430
Repo: cloudposse/atmos PR: 844
File: cmd/helmfile.go:37-37
Timestamp: 2024-12-11T18:40:12.808Z
Learning: In the atmos project, `cliConfig` is initialized within the `cmd` package in `root.go` and can be used in other command files.

Applied to files:

  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_no-name-prod.stdout.golden
📚 Learning: 2025-12-16T01:01:16.459Z
Learnt from: aknysh
Repo: cloudposse/atmos PR: 1868
File: tests/test-cases/auth-mock.yaml:243-245
Timestamp: 2025-12-16T01:01:16.459Z
Learning: In Atmos tests, the YAML tag !not has project-specific semantics: it negates the value in a way that affects skip conditions, e.g., os: !not windows means skip on Windows (not non-Windows). This is not standard YAML boolean negation. Treat this as a guideline for review: when a test-case YAML uses !not in skip conditions, verify that the skip logic aligns with the project's interpretation. This pattern applies to all YAML test-case files under tests/test-cases (and similar paths in this repo).

Applied to files:

  • tests/test-cases/stack-manifest-name.yaml
📚 Learning: 2025-08-16T23:32:40.412Z
Learnt from: aknysh
Repo: cloudposse/atmos PR: 1405
File: internal/exec/describe_dependents_test.go:455-456
Timestamp: 2025-08-16T23:32:40.412Z
Learning: In the cloudposse/atmos Go codebase, `InitCliConfig` returns a `schema.AtmosConfiguration` value (not a pointer), while `ExecuteDescribeDependents` expects a `*schema.AtmosConfiguration` pointer parameter. Therefore, when passing the result of `InitCliConfig` to `ExecuteDescribeDependents`, use `&atmosConfig` to pass the address of the value.

Applied to files:

  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_my-legacy-prod-stack.stdout.golden
📚 Learning: 2025-12-13T06:07:37.766Z
Learnt from: osterman
Repo: cloudposse/atmos PR: 1686
File: docs/prd/tool-dependencies-integration.md:58-64
Timestamp: 2025-12-13T06:07:37.766Z
Learning: cloudposse/atmos: For PRD docs (docs/prd/*.md), markdownlint issues like MD040/MD010/MD034 can be handled in a separate documentation cleanup commit and should not block the current PR.

Applied to files:

  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_legacy-prod_(invalid_-_should_suggest_correct_name).stderr.golden
📚 Learning: 2026-01-04T00:55:21.720Z
Learnt from: CR
Repo: cloudposse/atmos PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-04T00:55:21.720Z
Learning: PRs labeled `minor` or `major` MUST update `website/src/data/roadmap.js` with shipped milestones, status, changelog link, PR number, and initiative progress percentage

Applied to files:

  • website/src/data/roadmap.js
📚 Learning: 2025-10-13T18:13:54.020Z
Learnt from: aknysh
Repo: cloudposse/atmos PR: 1622
File: pkg/perf/perf.go:140-184
Timestamp: 2025-10-13T18:13:54.020Z
Learning: In pkg/perf/perf.go, the `trackWithSimpleStack` function intentionally skips ownership checks at call stack depth > 1 to avoid expensive `getGoroutineID()` calls on every nested function. This is a performance optimization for the common single-goroutine execution case (most Atmos commands), accepting the rare edge case of potential metric corruption if multi-goroutine execution occurs at depth > 1. The ~19× performance improvement justifies this trade-off.

Applied to files:

  • internal/exec/describe_stacks.go
  • internal/exec/utils.go
📚 Learning: 2024-10-20T00:41:57.135Z
Learnt from: haitham911
Repo: cloudposse/atmos PR: 731
File: internal/exec/validate_stacks.go:93-98
Timestamp: 2024-10-20T00:41:57.135Z
Learning: When downloading schema files in `internal/exec/validate_stacks.go`, use a consistent temporary file name to overwrite the file each time and avoid creating multiple temporary files.

Applied to files:

  • internal/exec/describe_stacks.go
  • internal/exec/utils.go
  • internal/exec/stack_manifest_name_test.go
📚 Learning: 2025-09-29T02:20:11.636Z
Learnt from: aknysh
Repo: cloudposse/atmos PR: 1540
File: internal/exec/validate_component.go:117-118
Timestamp: 2025-09-29T02:20:11.636Z
Learning: The ValidateComponent function in internal/exec/validate_component.go had its componentSection parameter type refined from `any` to `map[string]any` without adding new parameters. This is a type safety improvement, not a signature change requiring call site updates.

Applied to files:

  • internal/exec/describe_stacks.go
  • internal/exec/utils.go
📚 Learning: 2025-12-21T04:10:29.030Z
Learnt from: osterman
Repo: cloudposse/atmos PR: 1891
File: internal/exec/describe_affected.go:468-468
Timestamp: 2025-12-21T04:10:29.030Z
Learning: In Go, package-level declarations (constants, variables, types, and functions) are visible to all files in the same package without imports. During reviews in cloudposse/atmos (and similar Go codebases), before suggesting to declare a new identifier, first check if it already exists in another file of the same package. If it exists, you can avoid adding a new declaration; if not, proceed with a proper package-level declaration. 

Applied to files:

  • internal/exec/describe_stacks.go
  • errors/errors.go
  • internal/exec/utils.go
  • internal/exec/stack_manifest_name_test.go
📚 Learning: 2025-12-13T06:10:13.688Z
Learnt from: osterman
Repo: cloudposse/atmos PR: 1686
File: errors/errors.go:184-203
Timestamp: 2025-12-13T06:10:13.688Z
Learning: cloudposse/atmos: For toolchain work, duplicate/unused error sentinels in errors/errors.go should be cleaned up in a separate refactor PR and not block feature PRs; canonical toolchain sentinels live under toolchain/registry with re-exports in toolchain/errors.go.

Applied to files:

  • errors/errors.go
  • internal/exec/stack_manifest_name_test.go
📚 Learning: 2026-01-04T00:55:21.720Z
Learnt from: CR
Repo: cloudposse/atmos PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-04T00:55:21.720Z
Learning: Applies to **/*.go : All errors MUST be wrapped using static errors defined in `errors/errors.go` - use `errors.Join` for combining errors, `fmt.Errorf` with `%w` for context, and `errors.Is()` for error checking

Applied to files:

  • errors/errors.go
📚 Learning: 2025-10-02T19:17:51.630Z
Learnt from: osterman
Repo: cloudposse/atmos PR: 1504
File: pkg/profiler/profiler.go:20-31
Timestamp: 2025-10-02T19:17:51.630Z
Learning: In pkg/profiler/profiler.go, profiler-specific errors (ErrUnsupportedProfileType, ErrStartCPUProfile, ErrStartTraceProfile, ErrCreateProfileFile) must remain local and cannot be moved to errors/errors.go due to an import cycle: pkg/profiler → errors → pkg/schema → pkg/profiler. This is a valid exception to the centralized errors policy.

Applied to files:

  • errors/errors.go
📚 Learning: 2025-12-13T06:07:34.794Z
Learnt from: osterman
Repo: cloudposse/atmos PR: 1686
File: docs/prd/tool-dependencies-integration.md:58-64
Timestamp: 2025-12-13T06:07:34.794Z
Learning: For docs in the cloudposse/atmos repository under docs/prd/, markdownlint issues MD040, MD010, and MD034 should be deferred to a separate documentation cleanup commit and must not block the current PR. If needed, address these issues in a follow-up PR dedicated to documentation improvements.

Applied to files:

  • docs/prd/stack-name-identity.md
📚 Learning: 2025-01-25T03:51:57.689Z
Learnt from: Listener430
Repo: cloudposse/atmos PR: 934
File: tests/fixtures/scenarios/docs-generate/README.md.gotmpl:99-118
Timestamp: 2025-01-25T03:51:57.689Z
Learning: For the cloudposse/atmos repository, changes to template contents should be handled in dedicated PRs and are typically considered out of scope for PRs focused on other objectives.

Applied to files:

  • docs/prd/stack-name-identity.md
📚 Learning: 2025-10-08T06:48:07.499Z
Learnt from: aknysh
Repo: cloudposse/atmos PR: 1602
File: internal/exec/stack_processor_utils.go:968-1003
Timestamp: 2025-10-08T06:48:07.499Z
Learning: The `FindComponentDependenciesLegacy` function in `internal/exec/stack_processor_utils.go` is legacy code that is not actively used and is kept only for backward compatibility purposes.

Applied to files:

  • internal/exec/utils.go
  • internal/exec/stack_manifest_name_test.go
📚 Learning: 2024-11-19T23:00:45.899Z
Learnt from: osterman
Repo: cloudposse/atmos PR: 795
File: internal/exec/stack_processor_utils.go:378-386
Timestamp: 2024-11-19T23:00:45.899Z
Learning: In the `ProcessYAMLConfigFile` function within `internal/exec/stack_processor_utils.go`, directory traversal in stack imports is acceptable and should not be restricted.

Applied to files:

  • internal/exec/utils.go
  • internal/exec/stack_manifest_name_test.go
📚 Learning: 2024-12-07T16:19:01.683Z
Learnt from: aknysh
Repo: cloudposse/atmos PR: 825
File: internal/exec/terraform.go:30-30
Timestamp: 2024-12-07T16:19:01.683Z
Learning: In `internal/exec/terraform.go`, skipping stack validation when help flags are present is not necessary.

Applied to files:

  • internal/exec/utils.go
📚 Learning: 2025-01-09T22:27:25.538Z
Learnt from: samtholiya
Repo: cloudposse/atmos PR: 914
File: cmd/validate_stacks.go:20-23
Timestamp: 2025-01-09T22:27:25.538Z
Learning: The validate commands in Atmos can have different help handling implementations. Specifically, validate_component.go and validate_stacks.go are designed to handle help requests differently, with validate_stacks.go including positional argument checks while validate_component.go does not.

Applied to files:

  • internal/exec/utils.go
  • internal/exec/stack_manifest_name_test.go
📚 Learning: 2026-01-04T00:55:21.720Z
Learnt from: CR
Repo: cloudposse/atmos PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-04T00:55:21.720Z
Learning: Applies to website/blog/*.mdx : PRs labeled `minor` or `major` MUST include a blog post at `website/blog/YYYY-MM-DD-feature-name.mdx` with YAML frontmatter, using only tags defined in `website/blog/tags.yml`

Applied to files:

  • website/blog/2026-01-06-stack-name-identity.mdx
📚 Learning: 2025-11-24T17:35:37.209Z
Learnt from: CR
Repo: cloudposse/atmos PR: 0
File: .cursor/rules/atmos-rules.mdc:0-0
Timestamp: 2025-11-24T17:35:37.209Z
Learning: Applies to **/*_test.go : Include integration tests for command flows and test CLI end-to-end when possible with test fixtures

Applied to files:

  • internal/exec/stack_manifest_name_test.go
📚 Learning: 2025-11-24T17:35:37.209Z
Learnt from: CR
Repo: cloudposse/atmos PR: 0
File: .cursor/rules/atmos-rules.mdc:0-0
Timestamp: 2025-11-24T17:35:37.209Z
Learning: Applies to **/*_test.go : Every new feature must include comprehensive unit tests targeting >80% code coverage for all packages

Applied to files:

  • internal/exec/stack_manifest_name_test.go
📚 Learning: 2024-10-23T21:36:40.262Z
Learnt from: osterman
Repo: cloudposse/atmos PR: 740
File: cmd/cmd_utils.go:340-359
Timestamp: 2024-10-23T21:36:40.262Z
Learning: In the Go codebase for Atmos, when reviewing functions like `checkAtmosConfig` in `cmd/cmd_utils.go`, avoid suggesting refactoring to return errors instead of calling `os.Exit` if such changes would significantly increase the scope due to the need to update multiple call sites.

Applied to files:

  • internal/exec/stack_manifest_name_test.go
📚 Learning: 2025-11-24T17:35:37.209Z
Learnt from: CR
Repo: cloudposse/atmos PR: 0
File: .cursor/rules/atmos-rules.mdc:0-0
Timestamp: 2025-11-24T17:35:37.209Z
Learning: Applies to **/*_test.go : Use table-driven tests for testing multiple scenarios in Go

Applied to files:

  • internal/exec/stack_manifest_name_test.go
📚 Learning: 2025-10-22T14:55:44.014Z
Learnt from: osterman
Repo: cloudposse/atmos PR: 1695
File: pkg/auth/manager.go:169-171
Timestamp: 2025-10-22T14:55:44.014Z
Learning: Go 1.20+ supports multiple %w verbs in fmt.Errorf, which returns an error implementing Unwrap() []error. This is valid and does not panic. Atmos uses Go 1.24.8 and configures errorlint with errorf-multi: true to validate this pattern.

Applied to files:

  • internal/exec/stack_manifest_name_test.go
📚 Learning: 2025-11-11T03:47:59.576Z
Learnt from: osterman
Repo: cloudposse/atmos PR: 1686
File: toolchain/which_test.go:166-223
Timestamp: 2025-11-11T03:47:59.576Z
Learning: In the cloudposse/atmos repo, tests that manipulate environment variables should use testing.T.Setenv for automatic setup/teardown instead of os.Setenv/Unsetenv.

Applied to files:

  • internal/exec/stack_manifest_name_test.go
📚 Learning: 2025-04-11T22:06:46.999Z
Learnt from: samtholiya
Repo: cloudposse/atmos PR: 1147
File: internal/exec/validate_schema.go:42-57
Timestamp: 2025-04-11T22:06:46.999Z
Learning: The "ExecuteAtmosValidateSchemaCmd" function in internal/exec/validate_schema.go has been reviewed and confirmed to have acceptable cognitive complexity despite static analysis warnings. The function uses a clean structure with only three if statements for error handling and delegates complex operations to helper methods.

Applied to files:

  • internal/exec/stack_manifest_name_test.go
📚 Learning: 2025-08-15T14:43:41.030Z
Learnt from: aknysh
Repo: cloudposse/atmos PR: 1352
File: pkg/store/artifactory_store_test.go:108-113
Timestamp: 2025-08-15T14:43:41.030Z
Learning: In test files for the atmos project, it's acceptable to ignore errors from os.Setenv/Unsetenv operations during test environment setup and teardown, as these are controlled test scenarios.

Applied to files:

  • internal/exec/stack_manifest_name_test.go
📚 Learning: 2025-11-08T19:56:18.660Z
Learnt from: osterman
Repo: cloudposse/atmos PR: 1697
File: internal/exec/oci_utils.go:0-0
Timestamp: 2025-11-08T19:56:18.660Z
Learning: In the Atmos codebase, when a function receives an `*schema.AtmosConfiguration` parameter, it should read configuration values from `atmosConfig.Settings` fields rather than using direct `os.Getenv()` or `viper.GetString()` calls. The Atmos pattern is: viper.BindEnv in cmd/root.go binds environment variables → Viper unmarshals into atmosConfig.Settings via mapstructure → business logic reads from the Settings struct. This provides centralized config management, respects precedence, and enables testability. Example: `atmosConfig.Settings.AtmosGithubToken` instead of `os.Getenv("ATMOS_GITHUB_TOKEN")` in functions like `getGHCRAuth` in internal/exec/oci_utils.go.

Applied to files:

  • internal/exec/stack_manifest_name_test.go
📚 Learning: 2025-09-13T18:06:07.674Z
Learnt from: samtholiya
Repo: cloudposse/atmos PR: 1466
File: toolchain/list.go:39-42
Timestamp: 2025-09-13T18:06:07.674Z
Learning: In the cloudposse/atmos repository, for UI messages in the toolchain package, use utils.PrintfMessageToTUI instead of log.Error or fmt.Fprintln(os.Stderr, ...). Import pkg/utils with alias "u" to follow the established pattern.

Applied to files:

  • internal/exec/stack_manifest_name_test.go
📚 Learning: 2024-11-12T03:16:02.910Z
Learnt from: aknysh
Repo: cloudposse/atmos PR: 775
File: internal/exec/template_funcs_component.go:157-159
Timestamp: 2024-11-12T03:16:02.910Z
Learning: In the Go code for `componentFunc` in `internal/exec/template_funcs_component.go`, the function `cleanTerraformWorkspace` does not return errors, and it's acceptable if the file does not exist. Therefore, error handling for `cleanTerraformWorkspace` is not needed.

Applied to files:

  • internal/exec/stack_manifest_name_test.go
📚 Learning: 2024-11-24T19:13:10.287Z
Learnt from: haitham911
Repo: cloudposse/atmos PR: 727
File: internal/exec/terraform_clean.go:407-416
Timestamp: 2024-11-24T19:13:10.287Z
Learning: In `internal/exec/terraform_clean.go`, when `getStackTerraformStateFolder` returns an error in the `handleCleanSubCommand` function, the error is logged, and the process continues without returning the error.

Applied to files:

  • internal/exec/stack_manifest_name_test.go
📚 Learning: 2024-10-27T04:34:08.011Z
Learnt from: haitham911
Repo: cloudposse/atmos PR: 727
File: internal/exec/terraform_clean.go:183-187
Timestamp: 2024-10-27T04:34:08.011Z
Learning: In the `getStackTerraformStateFolder` function, it's acceptable and not an error if no Terraform state folders are found for a stack.

Applied to files:

  • internal/exec/stack_manifest_name_test.go
📚 Learning: 2024-10-20T00:57:53.500Z
Learnt from: haitham911
Repo: cloudposse/atmos PR: 731
File: internal/exec/validate_stacks.go:0-0
Timestamp: 2024-10-20T00:57:53.500Z
Learning: In `internal/exec/validate_stacks.go`, when downloading the Atmos JSON Schema file to the temp directory, the temporary file is overwritten each time, so explicit removal is not necessary.

Applied to files:

  • internal/exec/stack_manifest_name_test.go
🧬 Code graph analysis (1)
internal/exec/stack_manifest_name_test.go (4)
internal/exec/utils.go (1)
  • ProcessStacks (471-958)
internal/exec/stack_utils.go (1)
  • GetStackNamePattern (206-208)
errors/errors.go (2)
  • ErrInvalidStack (276-276)
  • ErrInvalidComponent (272-272)
internal/exec/describe_stacks.go (1)
  • ExecuteDescribeStacks (117-1023)
🪛 LanguageTool
docs/prd/stack-name-identity.md

[typographical] ~48-~48: Consider using a typographic opening quote here.
Context: ...nvironment: prod stage: ue1 ``` With `name_template: "{{ .vars.environment }}-{{ .vars.stage }...

(EN_QUOTES)


[typographical] ~62-~62: Consider using a typographic opening quote here.
Context: ...nvironment: prod stage: ue1 ``` With `name_template: "{{ .vars.environment }}-{{ .vars.stage }...

(EN_QUOTES)


[typographical] ~75-~75: Consider using a typographic opening quote here.
Context: ...nvironment: prod stage: ue1 ``` With name_pattern: "{environment}-{stage}": - Valid: `a...

(EN_QUOTES)


[typographical] ~198-~198: Consider using a typographic opening quote here.
Context: ...r 2. Using any other identifier returns "stack not found" 3. atmos list stacks ...

(EN_QUOTES)

website/blog/2026-01-06-stack-name-identity.mdx

[typographical] ~22-~22: To join two clauses or introduce examples, consider using an em dash.
Context: ...his precedence: 1. name (highest) - Explicit name from stack manifest 2. **`...

(DASH_RULE)


[typographical] ~24-~24: To join two clauses or introduce examples, consider using an em dash.
Context: ... from atmos.yaml 3. name_pattern - Token pattern from atmos.yaml 4. **Fil...

(DASH_RULE)


[typographical] ~25-~25: To join two clauses or introduce examples, consider using an em dash.
Context: ...om atmos.yaml 4. Filename (lowest) - Basename of the stack file Previously, ...

(DASH_RULE)

⏰ Context from checks skipped due to timeout of 900000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Summary
🔇 Additional comments (34)
tests/snapshots/TestCLICommands_atmos_list_stacks_(stack-manifest-name).stderr.golden (1)

1-1: LGTM! Telemetry notice correctly captured.

The snapshot captures the telemetry notice as expected. This file was generated via the test framework and should not be manually edited going forward.

errors/errors.go (1)

273-276: Well-documented error sentinel.

The distinction between ErrInvalidStack (wrong identifier) and ErrStackNotFound (doesn't exist) is clear and helpful. This will guide proper error handling across the codebase.

tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_no-name-prod.stderr.golden (1)

1-1: LGTM! Telemetry notice correctly captured.

Snapshot generated correctly via the test framework. Consistent with other telemetry notice snapshots in this PR.

website/src/data/roadmap.js (2)

168-168: Progress update reflects shipped milestone.

The 2% increase aligns with the addition of one shipped milestone in the dx initiative.


194-194: Complete milestone entry for shipped feature.

All required fields are present: status, quarter, PR number, changelog link, description, and benefits. The milestone clearly communicates the zero-config value proposition for newcomers.

docs/prd/stack-name-identity.md (1)

1-206: Comprehensive PRD with clear design and testing strategy.

This PRD effectively documents the single identity rule, zero-config behavior, and implementation approach. The precedence table (lines 27-32) provides unambiguous resolution logic, examples demonstrate real-world scenarios, and the testing section explicitly lists verification cases. Backwards compatibility concerns are acknowledged with clear user guidance through error messages.

website/blog/2026-01-06-stack-name-identity.mdx (2)

12-74: LGTM! Clear explanation of the stack identity feature.

The blog post effectively communicates the single identity rule, zero-config behavior, and migration guidance. The structure flows well from newcomer benefits to advanced user considerations.


1-10: Tags verified. Both feature and dx are defined in website/blog/tags.yml and configured correctly. No action needed.

tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_no-name-prod.stdout.golden (1)

1-186: LGTM! Properly generated golden snapshot.

This snapshot correctly captures the CLI output for the no-name-prod stack scenario, demonstrating the zero-config filename-based identity behavior.

pkg/datafetcher/schema/atmos/manifest/1.0.json (2)

7-10: LGTM! Root-level name property correctly documents precedence.

The description clearly establishes that this field takes precedence over name_template and name_pattern, aligning with the single identity rule.


524-527: LGTM! Metadata name property clearly describes component identity.

The description appropriately explains the use case for workspace key prefix auto-generation and notes inheritability from base components.

tests/snapshots/TestCLICommands_atmos_list_stacks_(stack-manifest-name).stdout.golden (1)

1-2: LGTM! Snapshot correctly reflects canonical stack names.

The output shows both the explicit manifest name (my-legacy-prod-stack) and the filename-based identity (no-name-prod), validating the single identity rule implementation.

tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_my-legacy-prod-stack.stderr.golden (1)

1-1: LGTM! Standard telemetry notice.

The stderr output correctly captures the telemetry notice that appears when running Atmos commands.

internal/exec/describe_stacks.go (1)

159-159: LGTM! Stack name derivation properly centralized.

Replacing inline extraction with getStackManifestName improves maintainability and ensures consistent stack identity resolution across the codebase.

tests/snapshots/TestCLICommands_atmos_describe_stacks_(stack-manifest-name).stderr.golden (1)

1-5: Test snapshot looks good.

Error messaging is clear and actionable, guiding users to configure stacks.name_pattern or the environment variable. Telemetry notice is consistent with other CLI outputs.

tests/snapshots/TestCLICommands_atmos_terraform_plan_vpc_-s_legacy-prod_(invalid).stderr.golden (1)

1-14: Excellent error messaging.

The structured error with "Did you mean" suggestion and actionable hints significantly improves the user experience. This guides users to the correct canonical stack name.

tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_legacy-prod_(invalid_-_should_suggest_correct_name).stderr.golden (1)

1-14: Consistent error handling across commands.

This snapshot confirms the improved error messaging works uniformly across both describe component and terraform commands. Good test coverage.

tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_my-legacy-prod-stack.stdout.golden (1)

68-70: Canonical stack identity correctly reflected.

The output properly distinguishes between the stack filename (legacy-prod) and the canonical stack name (my-legacy-prod-stack). This validates the manifest name precedence behavior.

Also applies to: 176-176

tests/test-cases/stack-manifest-name.yaml (3)

1-20: Well-structured test suite for stack identity feature.

The test cases cover the key scenarios: explicit name precedence, filename fallback for zero-config, and helpful error messages when using invalid names. The use of !not "^legacy-prod$" for negative assertions follows the project's established pattern.


91-111: Good documentation for disabled test.

Clear explanation of why the test is disabled and how the feature is tested through alternative paths. This helps future maintainers understand the reasoning.


118-137: Good error path coverage.

Tests the user experience when providing a filename for a stack with an explicit name. The expected stderr patterns align with the new ErrInvalidStack error handling.

internal/exec/utils.go (5)

33-42: Clean helper implementation.

Good use of type assertions with safe fallback to empty string. Using cfg.NameSectionName constant maintains consistency with the codebase.


365-368: Good zero-config fallback.

This enables newcomers to use stacks immediately without configuring name_template or name_pattern. The comment clearly explains the intent.


375-388: Signature update adds useful mapping.

The new stackNameMappings return value enables helpful "Did you mean..." suggestions when users provide the wrong stack identifier.


419-446: Single-identity logic is well-implemented.

The precedence (manifest name > template/pattern > filename) is clearly documented with reference to the PRD. The mapping tracks both explicit names and generated names for error suggestions.


620-631: Excellent error messaging with actionable hints.

The "Did you mean..." suggestion and the atmos list stacks hint guide users toward the correct canonical name. This aligns with the PRD goal of improved error handling.

internal/exec/stack_manifest_name_test.go (8)

3-13: Imports follow project conventions.

The cockroachdb/errors import is needed for GetAllHints to verify the structured error hints. Import grouping follows the stdlib → 3rd-party → atmos pattern.


63-82: Well-designed test helpers.

The describeStacksHelper reduces boilerplate across multiple tests. Proper use of t.Helper() ensures accurate line numbers in failure output.


480-559: Table-driven precedence tests are thorough.

The four test cases cover the complete precedence chain. Using descriptive names like "manifest name takes precedence over all" makes the intent clear.


561-571: Good section documentation.

The header block clearly explains the single-identity rule being tested. References to the PRD help maintainers understand the specification.


796-809: Error hint assertions are appropriately specific.

Testing exact hint content ensures users get the intended guidance. The assertions on hint count and content validate the UX improvement.


811-894: Comprehensive unit tests for the helper.

Good coverage of edge cases: nil input, non-map types, missing field, wrong type, empty string. The table-driven approach for non-map types is clean.


1142-1168: Good distinction between error types.

This test correctly documents that ErrInvalidStack is for "wrong name for existing stack" while ErrInvalidComponent is for "component/stack truly doesn't exist". The inline comment at lines 1164-1167 clarifies this for future maintainers.


15-52: Solid foundation test verifying manifest name in stacks map.

This test establishes that the name field is correctly propagated through FindStacksMap. Good use of logging for debugging context.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Jan 6, 2026

Caution

Review failed

The head commit changed during the review from 425c23d to a6f0c05.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch osterman/fix-import-cycle-1932

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@osterman osterman added minor New features that do not break anything and removed patch A minor, backward compatible change labels Jan 6, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Jan 6, 2026

Warning

Release Documentation Required

This PR is labeled minor or major and requires documentation updates:

  • Changelog entry - Add a blog post in website/blog/YYYY-MM-DD-feature-name.mdx
  • Roadmap update - Update website/src/data/roadmap.js with the new milestone

Alternatively: If this change doesn't require release documentation, remove the minor or major label.

1 similar comment
@github-actions
Copy link
Copy Markdown

github-actions bot commented Jan 6, 2026

Warning

Release Documentation Required

This PR is labeled minor or major and requires documentation updates:

  • Changelog entry - Add a blog post in website/blog/YYYY-MM-DD-feature-name.mdx
  • Roadmap update - Update website/src/data/roadmap.js with the new milestone

Alternatively: If this change doesn't require release documentation, remove the minor or major label.

@osterman osterman changed the title fix: honor stack manifest 'name' field in ProcessStacks feat: stack name identity with zero-config filename fallback Jan 6, 2026
When no name, name_template, or name_pattern is configured, stacks are
now identified by their filename. This enables newcomers to get started
without any naming configuration.

- Add filename fallback in processStackContextPrefix when no naming config
- Add tests for filename-based identity (ProcessStacks and DescribeStacks)
- Add blog post documenting stack name identity rules
- Add "Filename-based stack identity" to DX roadmap (Q1 2026)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@github-actions github-actions bot added size/l Large size PR and removed size/m Medium size PR labels Jan 6, 2026
Reframe the PRD from a bug-fix document to a requirements specification
that defines how stack identity resolution works in Atmos.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When a user provides a filename for a stack that has an explicit name
field set, the error now indicates "invalid stack" and suggests the
correct canonical name, rather than the misleading "invalid component"
message.

Example:
  Stack `legacy-prod` not found. Did you mean `my-legacy-prod-stack`?

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
osterman and others added 2 commits January 6, 2026 20:28
…formatting

- Use error builder pattern with WithHint instead of embedding suggestion
  in the error message
- Update unit test to use errors.GetAllHints() for verification
- Regenerate golden snapshots with new error format showing Hints section
- Update PR description with new error output format

The error now displays as:
# Error
**Error:** invalid stack

## Explanation
Stack legacy-prod not found.

## Hints
💡 Did you mean my-legacy-prod-stack?

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add second hint suggesting 'atmos list stacks' to see available stacks
- Update test expectations to check for both hints
- Update golden snapshots with new hint output

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
internal/exec/utils.go (1)

43-43: Prefer passing atmosConfig to performance tracking.

The function receives atmosConfig as its first parameter, so pass it to perf.Track instead of nil for more accurate performance monitoring.

🔎 Suggested change
-	defer perf.Track(nil, "exec.ProcessComponentConfig")()
+	defer perf.Track(atmosConfig, "exec.ProcessComponentConfig")()

Based on coding guidelines, all public functions should pass atmosConfig when available.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between b7ea588 and b77fe24.

📒 Files selected for processing (15)
  • internal/exec/stack_manifest_name_test.go
  • internal/exec/utils.go
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_legacy-prod_(invalid_-_should_suggest_correct_name).stderr.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_legacy-prod_(invalid_-_should_suggest_correct_name).stdout.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_my-legacy-prod-stack.stderr.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_my-legacy-prod-stack.stdout.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_no-name-prod.stderr.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_no-name-prod.stdout.golden
  • tests/snapshots/TestCLICommands_atmos_describe_stacks_(stack-manifest-name).stderr.golden
  • tests/snapshots/TestCLICommands_atmos_describe_stacks_(stack-manifest-name).stdout.golden
  • tests/snapshots/TestCLICommands_atmos_list_stacks_(stack-manifest-name).stderr.golden
  • tests/snapshots/TestCLICommands_atmos_list_stacks_(stack-manifest-name).stdout.golden
  • tests/snapshots/TestCLICommands_atmos_terraform_plan_vpc_-s_legacy-prod_(invalid).stderr.golden
  • tests/snapshots/TestCLICommands_atmos_terraform_plan_vpc_-s_legacy-prod_(invalid).stdout.golden
  • tests/test-cases/stack-manifest-name.yaml
✅ Files skipped from review due to trivial changes (7)
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_my-legacy-prod-stack.stderr.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_no-name-prod.stderr.golden
  • tests/snapshots/TestCLICommands_atmos_terraform_plan_vpc_-s_legacy-prod_(invalid).stderr.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_legacy-prod_(invalid_-_should_suggest_correct_name).stderr.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_my-legacy-prod-stack.stdout.golden
  • tests/snapshots/TestCLICommands_atmos_list_stacks_(stack-manifest-name).stdout.golden
  • tests/snapshots/TestCLICommands_atmos_list_stacks_(stack-manifest-name).stderr.golden
🧰 Additional context used
📓 Path-based instructions (4)
tests/snapshots/**/*

📄 CodeRabbit inference engine (CLAUDE.md)

Never manually edit golden snapshot files - always use -regenerate-snapshots flag when updating test output

Files:

  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_no-name-prod.stdout.golden
  • tests/snapshots/TestCLICommands_atmos_describe_stacks_(stack-manifest-name).stderr.golden
**/*.go

📄 CodeRabbit inference engine (.cursor/rules/atmos-rules.mdc)

**/*.go: Use Viper for managing configuration, environment variables, and flags in CLI commands
Use interfaces for external dependencies to facilitate mocking and consider using testify/mock for creating mock implementations
All code must pass golangci-lint checks
Follow Go's error handling idioms: use meaningful error messages, wrap errors with context using fmt.Errorf("context: %w", err), and consider using custom error types for domain-specific errors
Follow standard Go coding style: use gofmt and goimports to format code, prefer short descriptive variable names, use kebab-case for command-line flags, and snake_case for environment variables
Document all exported functions, types, and methods following Go's documentation conventions
Document complex logic with inline comments in Go code
Support configuration via files, environment variables, and flags following the precedence order: flags > environment variables > config file > defaults
Provide clear error messages to users, include troubleshooting hints when appropriate, and log detailed errors for debugging

**/*.go: All comments must end with periods (enforced by godot linter) in Go code
Organize imports into three groups separated by blank lines, sorted alphabetically: Go stdlib, 3rd-party (NOT cloudposse/atmos), then Atmos packages with maintained aliases (cfg, log, u, errUtils)
All errors MUST be wrapped using static errors defined in errors/errors.go - use errors.Join for combining errors, fmt.Errorf with %w for context, and errors.Is() for error checking
Never manually create mocks - use go.uber.org/mock/mockgen with //go:generate directives in Go code
Keep files small and focused - under 600 lines with one cmd/impl per file, co-locate tests, never use //revive:disable:file-length-limit
Use colors from pkg/ui/theme/colors.go for all UI theming in Go code
Code must be compatible with Linux, macOS, and Windows - use SDKs over binaries, use filepath.Join() instead of h...

Files:

  • internal/exec/utils.go
  • internal/exec/stack_manifest_name_test.go
**/{pkg,internal,cmd}/**/*.go

📄 CodeRabbit inference engine (CLAUDE.md)

Add defer perf.Track(atmosConfig, "pkg.FuncName")() plus blank line to all public functions, using nil if no atmosConfig param - exceptions: trivial getters/setters, command constructors, simple factories, functions delegating to tracked functions

Files:

  • internal/exec/utils.go
  • internal/exec/stack_manifest_name_test.go
**/*_test.go

📄 CodeRabbit inference engine (.cursor/rules/atmos-rules.mdc)

**/*_test.go: Every new feature must include comprehensive unit tests targeting >80% code coverage for all packages
Use table-driven tests for testing multiple scenarios in Go
Include integration tests for command flows and test CLI end-to-end when possible with test fixtures

Prefer unit tests with mocks over integration tests - use interfaces and dependency injection for testability, generate mocks with go.uber.org/mock/mockgen, use table-driven tests, target >80% coverage

Files:

  • internal/exec/stack_manifest_name_test.go
🧠 Learnings (43)
📓 Common learnings
Learnt from: osterman
Repo: cloudposse/atmos PR: 1686
File: docs/prd/tool-dependencies-integration.md:58-64
Timestamp: 2025-12-13T06:07:37.766Z
Learning: cloudposse/atmos: For PRD docs (docs/prd/*.md), markdownlint issues like MD040/MD010/MD034 can be handled in a separate documentation cleanup commit and should not block the current PR.
Learnt from: osterman
Repo: cloudposse/atmos PR: 1686
File: errors/errors.go:184-203
Timestamp: 2025-12-13T06:10:13.688Z
Learning: cloudposse/atmos: For toolchain work, duplicate/unused error sentinels in errors/errors.go should be cleaned up in a separate refactor PR and not block feature PRs; canonical toolchain sentinels live under toolchain/registry with re-exports in toolchain/errors.go.
Learnt from: Benbentwo
Repo: cloudposse/atmos PR: 1475
File: tests/fixtures/scenarios/atmos-auth/stacks/deploy/nonprod.yaml:3-4
Timestamp: 2025-09-24T20:45:40.401Z
Learning: In Atmos stack files, the correct syntax for importing other stack files is `import:` (singular), not `imports:` (plural). All stack files in the Atmos codebase consistently use `import:` followed by a list of paths to import.
Learnt from: haitham911
Repo: cloudposse/atmos PR: 731
File: internal/exec/validate_stacks.go:93-98
Timestamp: 2024-10-20T00:41:57.135Z
Learning: When downloading schema files in `internal/exec/validate_stacks.go`, use a consistent temporary file name to overwrite the file each time and avoid creating multiple temporary files.
📚 Learning: 2025-03-18T12:26:25.329Z
Learnt from: Listener430
Repo: cloudposse/atmos PR: 1149
File: tests/snapshots/TestCLICommands_atmos_vendor_pull_ssh.stderr.golden:7-7
Timestamp: 2025-03-18T12:26:25.329Z
Learning: In the Atmos project, typos or inconsistencies in test snapshot files (such as "terrafrom" instead of "terraform") may be intentional as they capture the exact output of commands and should not be flagged as issues requiring correction.

Applied to files:

  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_no-name-prod.stdout.golden
  • tests/snapshots/TestCLICommands_atmos_describe_stacks_(stack-manifest-name).stderr.golden
  • tests/test-cases/stack-manifest-name.yaml
  • internal/exec/stack_manifest_name_test.go
📚 Learning: 2025-02-14T23:12:38.030Z
Learnt from: Listener430
Repo: cloudposse/atmos PR: 1061
File: tests/snapshots/TestCLICommands_atmos_vendor_pull_ssh.stderr.golden:8-8
Timestamp: 2025-02-14T23:12:38.030Z
Learning: Test snapshots in the Atmos project, particularly for dry run scenarios, may be updated during the development process, and temporary inconsistencies in their content should not be flagged as issues.

Applied to files:

  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_no-name-prod.stdout.golden
  • tests/snapshots/TestCLICommands_atmos_describe_stacks_(stack-manifest-name).stderr.golden
📚 Learning: 2025-01-19T15:49:15.593Z
Learnt from: samtholiya
Repo: cloudposse/atmos PR: 955
File: tests/snapshots/TestCLICommands_atmos_validate_editorconfig_--help.stdout.golden:0-0
Timestamp: 2025-01-19T15:49:15.593Z
Learning: In future commits, the help text for Atmos CLI commands should be limited to only show component and stack parameters for commands that actually use them. This applies to the example usage section in command help text.

Applied to files:

  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_no-name-prod.stdout.golden
  • tests/snapshots/TestCLICommands_atmos_describe_stacks_(stack-manifest-name).stderr.golden
📚 Learning: 2024-12-01T00:33:20.298Z
Learnt from: aknysh
Repo: cloudposse/atmos PR: 810
File: examples/tests/stacks/catalog/terraform/template-functions-test2/defaults.yaml:28-32
Timestamp: 2024-12-01T00:33:20.298Z
Learning: In `examples/tests/stacks/catalog/terraform/template-functions-test2/defaults.yaml`, `!exec atmos terraform output` is used in examples to demonstrate its usage, even though `!terraform.output` is the recommended approach according to the documentation.

Applied to files:

  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_no-name-prod.stdout.golden
  • tests/snapshots/TestCLICommands_atmos_describe_stacks_(stack-manifest-name).stderr.golden
  • tests/test-cases/stack-manifest-name.yaml
📚 Learning: 2024-11-25T17:17:15.703Z
Learnt from: RoseSecurity
Repo: cloudposse/atmos PR: 797
File: pkg/list/atmos.yaml:213-214
Timestamp: 2024-11-25T17:17:15.703Z
Learning: The file `pkg/list/atmos.yaml` is primarily intended for testing purposes.

Applied to files:

  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_no-name-prod.stdout.golden
  • tests/test-cases/stack-manifest-name.yaml
📚 Learning: 2025-09-13T16:39:20.007Z
Learnt from: samtholiya
Repo: cloudposse/atmos PR: 1466
File: cmd/markdown/atmos_toolchain_aliases.md:2-4
Timestamp: 2025-09-13T16:39:20.007Z
Learning: In the cloudposse/atmos repository, CLI documentation files in cmd/markdown/ follow a specific format that uses " $ atmos command" (with leading space and dollar sign prompt) in code blocks. This is the established project convention and should not be changed to comply with standard markdownlint rules MD040 and MD014.

Applied to files:

  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_no-name-prod.stdout.golden
  • tests/snapshots/TestCLICommands_atmos_describe_stacks_(stack-manifest-name).stderr.golden
📚 Learning: 2025-10-07T00:25:16.333Z
Learnt from: osterman
Repo: cloudposse/atmos PR: 1498
File: website/src/components/Screengrabs/atmos-terraform-metadata--help.html:25-55
Timestamp: 2025-10-07T00:25:16.333Z
Learning: In Atmos CLI, subcommands inherit flags from their parent commands via Cobra's command inheritance. For example, `atmos terraform metadata --help` shows `--affected` and related flags inherited from the parent `terraform` command (defined in cmd/terraform.go), even though the metadata subcommand doesn't explicitly define these flags. This is expected Cobra behavior and auto-generated help screengrabs accurately reflect this inheritance.

Applied to files:

  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_no-name-prod.stdout.golden
📚 Learning: 2025-12-13T03:21:35.786Z
Learnt from: osterman
Repo: cloudposse/atmos PR: 1813
File: cmd/terraform/shell.go:28-73
Timestamp: 2025-12-13T03:21:35.786Z
Learning: In Atmos, when calling cfg.InitCliConfig, you must first populate the schema.ConfigAndStacksInfo struct with global flag values using flags.ParseGlobalFlags(cmd, v) rather than passing an empty struct. The LoadConfig function (pkg/config/load.go) reads config selection fields (AtmosConfigFilesFromArg, AtmosConfigDirsFromArg, BasePath, ProfilesFromArg) directly from the ConfigAndStacksInfo struct, NOT from Viper. Passing an empty struct causes config selection flags (--base-path, --config, --config-path, --profile) to be silently ignored. Correct pattern: parse flags → populate struct → call InitCliConfig. See cmd/terraform/plan_diff.go for reference implementation.

Applied to files:

  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_no-name-prod.stdout.golden
  • tests/snapshots/TestCLICommands_atmos_describe_stacks_(stack-manifest-name).stderr.golden
  • internal/exec/utils.go
  • internal/exec/stack_manifest_name_test.go
📚 Learning: 2024-12-03T05:29:07.718Z
Learnt from: aknysh
Repo: cloudposse/atmos PR: 810
File: internal/exec/terraform_utils.go:145-146
Timestamp: 2024-12-03T05:29:07.718Z
Learning: In the Atmos project, a 5-minute timeout in the `execTerraformOutput` function is acceptable for retrieving `terraform output` for a component in a stack.

Applied to files:

  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_no-name-prod.stdout.golden
📚 Learning: 2025-12-24T04:29:23.938Z
Learnt from: osterman
Repo: cloudposse/atmos PR: 1891
File: pkg/ci/terraform/templates/apply.md:17-17
Timestamp: 2025-12-24T04:29:23.938Z
Learning: In the cloudposse/atmos repository, Terraform CI templates (pkg/ci/terraform/templates/*.md) are rendered using TerraformTemplateContext (defined in pkg/ci/terraform/context.go), not the base ci.TemplateContext. TerraformTemplateContext provides top-level fields: .Resources (ci.ResourceCounts), .HasChanges() method, and .HasDestroy field, which are correctly accessed directly in templates without a .Result prefix.

Applied to files:

  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_no-name-prod.stdout.golden
📚 Learning: 2024-12-03T05:18:49.169Z
Learnt from: aknysh
Repo: cloudposse/atmos PR: 810
File: internal/exec/terraform_utils.go:40-213
Timestamp: 2024-12-03T05:18:49.169Z
Learning: In the context of the Atmos project, it's acceptable for functions like `execTerraformOutput` to remain as single functions if they perform a single purpose, such as retrieving Terraform outputs for a component in a stack, even if the function is lengthy.

Applied to files:

  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_no-name-prod.stdout.golden
📚 Learning: 2024-12-11T18:40:12.808Z
Learnt from: Listener430
Repo: cloudposse/atmos PR: 844
File: cmd/helmfile.go:37-37
Timestamp: 2024-12-11T18:40:12.808Z
Learning: In the atmos project, `cliConfig` is initialized within the `cmd` package in `root.go` and can be used in other command files.

Applied to files:

  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_no-name-prod.stdout.golden
📚 Learning: 2024-11-13T21:37:07.852Z
Learnt from: Cerebrovinny
Repo: cloudposse/atmos PR: 764
File: internal/exec/describe_stacks.go:289-295
Timestamp: 2024-11-13T21:37:07.852Z
Learning: In the `internal/exec/describe_stacks.go` file of the `atmos` project written in Go, avoid extracting the stack name handling logic into a helper function within the `ExecuteDescribeStacks` method, even if the logic appears duplicated.

Applied to files:

  • tests/snapshots/TestCLICommands_atmos_describe_stacks_(stack-manifest-name).stderr.golden
  • internal/exec/utils.go
  • internal/exec/stack_manifest_name_test.go
📚 Learning: 2024-12-07T16:16:13.038Z
Learnt from: Listener430
Repo: cloudposse/atmos PR: 825
File: internal/exec/helmfile_generate_varfile.go:28-31
Timestamp: 2024-12-07T16:16:13.038Z
Learning: In `internal/exec/helmfile_generate_varfile.go`, the `--help` command (`./atmos helmfile generate varfile --help`) works correctly without requiring stack configurations, and the only change needed was to make `ProcessCommandLineArgs` exportable by capitalizing its name.

Applied to files:

  • tests/snapshots/TestCLICommands_atmos_describe_stacks_(stack-manifest-name).stderr.golden
  • internal/exec/utils.go
  • internal/exec/stack_manifest_name_test.go
📚 Learning: 2025-08-15T14:43:41.030Z
Learnt from: aknysh
Repo: cloudposse/atmos PR: 1352
File: pkg/store/artifactory_store_test.go:108-113
Timestamp: 2025-08-15T14:43:41.030Z
Learning: In test files for the atmos project, it's acceptable to ignore errors from os.Setenv/Unsetenv operations during test environment setup and teardown, as these are controlled test scenarios.

Applied to files:

  • tests/snapshots/TestCLICommands_atmos_describe_stacks_(stack-manifest-name).stderr.golden
  • internal/exec/stack_manifest_name_test.go
📚 Learning: 2025-09-24T20:45:40.401Z
Learnt from: Benbentwo
Repo: cloudposse/atmos PR: 1475
File: tests/fixtures/scenarios/atmos-auth/stacks/deploy/nonprod.yaml:3-4
Timestamp: 2025-09-24T20:45:40.401Z
Learning: In Atmos stack files, the correct syntax for importing other stack files is `import:` (singular), not `imports:` (plural). All stack files in the Atmos codebase consistently use `import:` followed by a list of paths to import.

Applied to files:

  • tests/snapshots/TestCLICommands_atmos_describe_stacks_(stack-manifest-name).stderr.golden
📚 Learning: 2025-10-11T19:12:38.832Z
Learnt from: osterman
Repo: cloudposse/atmos PR: 1599
File: tests/snapshots/TestCLICommands_atmos_workflow_invalid_step_type.stderr.golden:0-0
Timestamp: 2025-10-11T19:12:38.832Z
Learning: Usage Examples sections in error output are appropriate for command usage errors (incorrect syntax, missing arguments, invalid flags) but not for configuration validation errors (malformed workflow files, invalid settings in atmos.yaml). Configuration errors should focus on explaining what's wrong with the config, not command usage patterns.

Applied to files:

  • tests/snapshots/TestCLICommands_atmos_describe_stacks_(stack-manifest-name).stderr.golden
📚 Learning: 2025-02-03T05:57:18.407Z
Learnt from: samtholiya
Repo: cloudposse/atmos PR: 959
File: cmd/cmd_utils.go:121-148
Timestamp: 2025-02-03T05:57:18.407Z
Learning: The Atmos CLI should fail fast (exit) when encountering configuration errors, including command alias configuration issues, to prevent undefined behavior. Use LogErrorAndExit instead of returning errors in such cases.

Applied to files:

  • tests/snapshots/TestCLICommands_atmos_describe_stacks_(stack-manifest-name).stderr.golden
📚 Learning: 2025-02-11T08:21:33.143Z
Learnt from: shirkevich
Repo: cloudposse/atmos PR: 1034
File: website/docs/core-concepts/projects/configuration/stores.mdx:173-177
Timestamp: 2025-02-11T08:21:33.143Z
Learning: The parameter for configuring stack path delimiter in store configurations is consistently named `stack_delimiter` (not `stacks_delimiter`) across all store types in Atmos.

Applied to files:

  • tests/snapshots/TestCLICommands_atmos_describe_stacks_(stack-manifest-name).stderr.golden
📚 Learning: 2025-02-06T13:38:07.216Z
Learnt from: Listener430
Repo: cloudposse/atmos PR: 984
File: internal/exec/copy_glob.go:0-0
Timestamp: 2025-02-06T13:38:07.216Z
Learning: The `u.LogTrace` function in the `cloudposse/atmos` repository accepts `atmosConfig` as its first parameter, followed by the message string.

Applied to files:

  • tests/snapshots/TestCLICommands_atmos_describe_stacks_(stack-manifest-name).stderr.golden
📚 Learning: 2025-09-10T17:34:52.568Z
Learnt from: Benbentwo
Repo: cloudposse/atmos PR: 1475
File: pkg/auth/providers/github/oidc.go:96-100
Timestamp: 2025-09-10T17:34:52.568Z
Learning: The ATMOS_ environment variable binding guideline applies to Atmos configuration variables, not external service-required environment variables like GitHub Actions OIDC variables (GITHUB_ACTIONS, ACTIONS_ID_TOKEN_*) which must use their standard names.

Applied to files:

  • tests/snapshots/TestCLICommands_atmos_describe_stacks_(stack-manifest-name).stderr.golden
📚 Learning: 2025-12-16T01:01:16.459Z
Learnt from: aknysh
Repo: cloudposse/atmos PR: 1868
File: tests/test-cases/auth-mock.yaml:243-245
Timestamp: 2025-12-16T01:01:16.459Z
Learning: In Atmos tests, the YAML tag !not has project-specific semantics: it negates the value in a way that affects skip conditions, e.g., os: !not windows means skip on Windows (not non-Windows). This is not standard YAML boolean negation. Treat this as a guideline for review: when a test-case YAML uses !not in skip conditions, verify that the skip logic aligns with the project's interpretation. This pattern applies to all YAML test-case files under tests/test-cases (and similar paths in this repo).

Applied to files:

  • tests/test-cases/stack-manifest-name.yaml
📚 Learning: 2025-10-08T06:48:07.499Z
Learnt from: aknysh
Repo: cloudposse/atmos PR: 1602
File: internal/exec/stack_processor_utils.go:968-1003
Timestamp: 2025-10-08T06:48:07.499Z
Learning: The `FindComponentDependenciesLegacy` function in `internal/exec/stack_processor_utils.go` is legacy code that is not actively used and is kept only for backward compatibility purposes.

Applied to files:

  • internal/exec/utils.go
📚 Learning: 2024-11-19T23:00:45.899Z
Learnt from: osterman
Repo: cloudposse/atmos PR: 795
File: internal/exec/stack_processor_utils.go:378-386
Timestamp: 2024-11-19T23:00:45.899Z
Learning: In the `ProcessYAMLConfigFile` function within `internal/exec/stack_processor_utils.go`, directory traversal in stack imports is acceptable and should not be restricted.

Applied to files:

  • internal/exec/utils.go
  • internal/exec/stack_manifest_name_test.go
📚 Learning: 2025-09-29T02:20:11.636Z
Learnt from: aknysh
Repo: cloudposse/atmos PR: 1540
File: internal/exec/validate_component.go:117-118
Timestamp: 2025-09-29T02:20:11.636Z
Learning: The ValidateComponent function in internal/exec/validate_component.go had its componentSection parameter type refined from `any` to `map[string]any` without adding new parameters. This is a type safety improvement, not a signature change requiring call site updates.

Applied to files:

  • internal/exec/utils.go
  • internal/exec/stack_manifest_name_test.go
📚 Learning: 2024-10-20T00:41:57.135Z
Learnt from: haitham911
Repo: cloudposse/atmos PR: 731
File: internal/exec/validate_stacks.go:93-98
Timestamp: 2024-10-20T00:41:57.135Z
Learning: When downloading schema files in `internal/exec/validate_stacks.go`, use a consistent temporary file name to overwrite the file each time and avoid creating multiple temporary files.

Applied to files:

  • internal/exec/utils.go
  • internal/exec/stack_manifest_name_test.go
📚 Learning: 2024-10-20T00:57:53.500Z
Learnt from: haitham911
Repo: cloudposse/atmos PR: 731
File: internal/exec/validate_stacks.go:0-0
Timestamp: 2024-10-20T00:57:53.500Z
Learning: In `internal/exec/validate_stacks.go`, when downloading the Atmos JSON Schema file to the temp directory, the temporary file is overwritten each time, so explicit removal is not necessary.

Applied to files:

  • internal/exec/utils.go
  • internal/exec/stack_manifest_name_test.go
📚 Learning: 2024-10-23T21:36:40.262Z
Learnt from: osterman
Repo: cloudposse/atmos PR: 740
File: cmd/cmd_utils.go:340-359
Timestamp: 2024-10-23T21:36:40.262Z
Learning: In the Go codebase for Atmos, when reviewing functions like `checkAtmosConfig` in `cmd/cmd_utils.go`, avoid suggesting refactoring to return errors instead of calling `os.Exit` if such changes would significantly increase the scope due to the need to update multiple call sites.

Applied to files:

  • internal/exec/utils.go
  • internal/exec/stack_manifest_name_test.go
📚 Learning: 2026-01-04T00:55:21.720Z
Learnt from: CR
Repo: cloudposse/atmos PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-04T00:55:21.720Z
Learning: Applies to **/{pkg,internal,cmd}/**/*.go : Add `defer perf.Track(atmosConfig, "pkg.FuncName")()` plus blank line to all public functions, using `nil` if no atmosConfig param - exceptions: trivial getters/setters, command constructors, simple factories, functions delegating to tracked functions

Applied to files:

  • internal/exec/utils.go
📚 Learning: 2025-12-21T04:10:29.030Z
Learnt from: osterman
Repo: cloudposse/atmos PR: 1891
File: internal/exec/describe_affected.go:468-468
Timestamp: 2025-12-21T04:10:29.030Z
Learning: In Go, package-level declarations (constants, variables, types, and functions) are visible to all files in the same package without imports. During reviews in cloudposse/atmos (and similar Go codebases), before suggesting to declare a new identifier, first check if it already exists in another file of the same package. If it exists, you can avoid adding a new declaration; if not, proceed with a proper package-level declaration. 

Applied to files:

  • internal/exec/utils.go
  • internal/exec/stack_manifest_name_test.go
📚 Learning: 2025-11-24T17:35:37.209Z
Learnt from: CR
Repo: cloudposse/atmos PR: 0
File: .cursor/rules/atmos-rules.mdc:0-0
Timestamp: 2025-11-24T17:35:37.209Z
Learning: Applies to **/*_test.go : Include integration tests for command flows and test CLI end-to-end when possible with test fixtures

Applied to files:

  • internal/exec/stack_manifest_name_test.go
📚 Learning: 2025-11-24T17:35:37.209Z
Learnt from: CR
Repo: cloudposse/atmos PR: 0
File: .cursor/rules/atmos-rules.mdc:0-0
Timestamp: 2025-11-24T17:35:37.209Z
Learning: Applies to **/*_test.go : Use table-driven tests for testing multiple scenarios in Go

Applied to files:

  • internal/exec/stack_manifest_name_test.go
📚 Learning: 2025-10-22T14:55:44.014Z
Learnt from: osterman
Repo: cloudposse/atmos PR: 1695
File: pkg/auth/manager.go:169-171
Timestamp: 2025-10-22T14:55:44.014Z
Learning: Go 1.20+ supports multiple %w verbs in fmt.Errorf, which returns an error implementing Unwrap() []error. This is valid and does not panic. Atmos uses Go 1.24.8 and configures errorlint with errorf-multi: true to validate this pattern.

Applied to files:

  • internal/exec/stack_manifest_name_test.go
📚 Learning: 2025-11-11T03:47:59.576Z
Learnt from: osterman
Repo: cloudposse/atmos PR: 1686
File: toolchain/which_test.go:166-223
Timestamp: 2025-11-11T03:47:59.576Z
Learning: In the cloudposse/atmos repo, tests that manipulate environment variables should use testing.T.Setenv for automatic setup/teardown instead of os.Setenv/Unsetenv.

Applied to files:

  • internal/exec/stack_manifest_name_test.go
📚 Learning: 2025-04-11T22:06:46.999Z
Learnt from: samtholiya
Repo: cloudposse/atmos PR: 1147
File: internal/exec/validate_schema.go:42-57
Timestamp: 2025-04-11T22:06:46.999Z
Learning: The "ExecuteAtmosValidateSchemaCmd" function in internal/exec/validate_schema.go has been reviewed and confirmed to have acceptable cognitive complexity despite static analysis warnings. The function uses a clean structure with only three if statements for error handling and delegates complex operations to helper methods.

Applied to files:

  • internal/exec/stack_manifest_name_test.go
📚 Learning: 2025-11-08T19:56:18.660Z
Learnt from: osterman
Repo: cloudposse/atmos PR: 1697
File: internal/exec/oci_utils.go:0-0
Timestamp: 2025-11-08T19:56:18.660Z
Learning: In the Atmos codebase, when a function receives an `*schema.AtmosConfiguration` parameter, it should read configuration values from `atmosConfig.Settings` fields rather than using direct `os.Getenv()` or `viper.GetString()` calls. The Atmos pattern is: viper.BindEnv in cmd/root.go binds environment variables → Viper unmarshals into atmosConfig.Settings via mapstructure → business logic reads from the Settings struct. This provides centralized config management, respects precedence, and enables testability. Example: `atmosConfig.Settings.AtmosGithubToken` instead of `os.Getenv("ATMOS_GITHUB_TOKEN")` in functions like `getGHCRAuth` in internal/exec/oci_utils.go.

Applied to files:

  • internal/exec/stack_manifest_name_test.go
📚 Learning: 2025-12-13T06:10:13.688Z
Learnt from: osterman
Repo: cloudposse/atmos PR: 1686
File: errors/errors.go:184-203
Timestamp: 2025-12-13T06:10:13.688Z
Learning: cloudposse/atmos: For toolchain work, duplicate/unused error sentinels in errors/errors.go should be cleaned up in a separate refactor PR and not block feature PRs; canonical toolchain sentinels live under toolchain/registry with re-exports in toolchain/errors.go.

Applied to files:

  • internal/exec/stack_manifest_name_test.go
📚 Learning: 2025-09-13T18:06:07.674Z
Learnt from: samtholiya
Repo: cloudposse/atmos PR: 1466
File: toolchain/list.go:39-42
Timestamp: 2025-09-13T18:06:07.674Z
Learning: In the cloudposse/atmos repository, for UI messages in the toolchain package, use utils.PrintfMessageToTUI instead of log.Error or fmt.Fprintln(os.Stderr, ...). Import pkg/utils with alias "u" to follow the established pattern.

Applied to files:

  • internal/exec/stack_manifest_name_test.go
📚 Learning: 2024-11-12T03:16:02.910Z
Learnt from: aknysh
Repo: cloudposse/atmos PR: 775
File: internal/exec/template_funcs_component.go:157-159
Timestamp: 2024-11-12T03:16:02.910Z
Learning: In the Go code for `componentFunc` in `internal/exec/template_funcs_component.go`, the function `cleanTerraformWorkspace` does not return errors, and it's acceptable if the file does not exist. Therefore, error handling for `cleanTerraformWorkspace` is not needed.

Applied to files:

  • internal/exec/stack_manifest_name_test.go
📚 Learning: 2025-01-09T22:27:25.538Z
Learnt from: samtholiya
Repo: cloudposse/atmos PR: 914
File: cmd/validate_stacks.go:20-23
Timestamp: 2025-01-09T22:27:25.538Z
Learning: The validate commands in Atmos can have different help handling implementations. Specifically, validate_component.go and validate_stacks.go are designed to handle help requests differently, with validate_stacks.go including positional argument checks while validate_component.go does not.

Applied to files:

  • internal/exec/stack_manifest_name_test.go
📚 Learning: 2024-12-12T15:17:45.245Z
Learnt from: osterman
Repo: cloudposse/atmos PR: 808
File: examples/demo-atmos.d/atmos.d/tools/helmfile.yml:10-10
Timestamp: 2024-12-12T15:17:45.245Z
Learning: In `examples/demo-atmos.d/atmos.d/tools/helmfile.yml`, when suggesting changes to `kubeconfig_path`, ensure that the values use valid Go template syntax.

Applied to files:

  • internal/exec/stack_manifest_name_test.go
📚 Learning: 2024-12-07T16:19:01.683Z
Learnt from: aknysh
Repo: cloudposse/atmos PR: 825
File: internal/exec/terraform.go:30-30
Timestamp: 2024-12-07T16:19:01.683Z
Learning: In `internal/exec/terraform.go`, skipping stack validation when help flags are present is not necessary.

Applied to files:

  • internal/exec/stack_manifest_name_test.go
🧬 Code graph analysis (1)
internal/exec/utils.go (2)
pkg/schema/schema.go (2)
  • AtmosConfiguration (54-100)
  • ConfigAndStacksInfo (727-824)
pkg/config/const.go (1)
  • NameSectionName (65-65)
⏰ Context from checks skipped due to timeout of 900000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Acceptance Tests (macos)
  • GitHub Check: Acceptance Tests (linux)
  • GitHub Check: Acceptance Tests (windows)
  • GitHub Check: Summary
🔇 Additional comments (6)
internal/exec/utils.go (3)

354-356: Nice zero-config naming fallback.

This enables newcomers to use Atmos without configuring name_template or name_pattern upfront. The filename becomes the canonical stack identity when nothing else is configured, which is intuitive and aligns with the single-identity precedence documented in the PRD.


379-437: Canonical name resolution logic is sound.

The precedence hierarchy (manifest name → template/pattern → filename) is implemented correctly:

  • Early extraction of manifest names enables suggestions even when components aren't found.
  • The condition ContextPrefix != stackName correctly identifies when a template/pattern was applied versus when the filename fallback was used.
  • Both explicit names and template-derived names are tracked in stackNameMappings for helpful error suggestions.

618-625: Helpful error with canonical name suggestion.

The error handling correctly detects when a user provides a filename that maps to a different canonical name and suggests the correct identifier. The dual hints (suggesting the canonical name + pointing to atmos list stacks) provide clear next steps for users.

internal/exec/stack_manifest_name_test.go (3)

407-449: Excellent test coverage for manifest name precedence.

This test validates that the manifest-level name field works correctly with ProcessStacks, which was the core issue from #1932. The test setup, execution, and assertions are all well-structured.


480-559: Nice table-driven test for precedence rules.

This test comprehensively validates all four levels of the naming precedence hierarchy (manifest name → name_template → name_pattern → filename). The test cases are clear and cover edge cases effectively.


776-809: Solid error validation with hint inspection.

The test correctly verifies that ErrInvalidStack is returned and inspects the hints using errors.GetAllHints. This ensures the error builder's WithHint calls produce the expected user-facing guidance.

coderabbitai[bot]
coderabbitai bot previously approved these changes Jan 7, 2026
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
internal/exec/utils.go (1)

376-393: Consider extracting manifest name retrieval.

The nested type assertions (lines 383-386) appear in both findComponentInStacks and later in ExecuteDescribeStacks. A small helper like getStackManifestName(stackSection map[string]any) string could reduce duplication, though this is optional given the limited scope.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between b7ea588 and b77fe24.

📒 Files selected for processing (15)
  • internal/exec/stack_manifest_name_test.go
  • internal/exec/utils.go
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_legacy-prod_(invalid_-_should_suggest_correct_name).stderr.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_legacy-prod_(invalid_-_should_suggest_correct_name).stdout.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_my-legacy-prod-stack.stderr.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_my-legacy-prod-stack.stdout.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_no-name-prod.stderr.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_no-name-prod.stdout.golden
  • tests/snapshots/TestCLICommands_atmos_describe_stacks_(stack-manifest-name).stderr.golden
  • tests/snapshots/TestCLICommands_atmos_describe_stacks_(stack-manifest-name).stdout.golden
  • tests/snapshots/TestCLICommands_atmos_list_stacks_(stack-manifest-name).stderr.golden
  • tests/snapshots/TestCLICommands_atmos_list_stacks_(stack-manifest-name).stdout.golden
  • tests/snapshots/TestCLICommands_atmos_terraform_plan_vpc_-s_legacy-prod_(invalid).stderr.golden
  • tests/snapshots/TestCLICommands_atmos_terraform_plan_vpc_-s_legacy-prod_(invalid).stdout.golden
  • tests/test-cases/stack-manifest-name.yaml
✅ Files skipped from review due to trivial changes (6)
  • tests/snapshots/TestCLICommands_atmos_list_stacks_(stack-manifest-name).stderr.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_no-name-prod.stderr.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_my-legacy-prod-stack.stderr.golden
  • tests/snapshots/TestCLICommands_atmos_terraform_plan_vpc_-s_legacy-prod_(invalid).stderr.golden
  • tests/snapshots/TestCLICommands_atmos_list_stacks_(stack-manifest-name).stdout.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_my-legacy-prod-stack.stdout.golden
🧰 Additional context used
📓 Path-based instructions (4)
tests/snapshots/**/*

📄 CodeRabbit inference engine (CLAUDE.md)

Never manually edit golden snapshot files - always use -regenerate-snapshots flag when updating test output

Files:

  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_no-name-prod.stdout.golden
  • tests/snapshots/TestCLICommands_atmos_describe_stacks_(stack-manifest-name).stderr.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_legacy-prod_(invalid_-_should_suggest_correct_name).stderr.golden
**/*.go

📄 CodeRabbit inference engine (.cursor/rules/atmos-rules.mdc)

**/*.go: Use Viper for managing configuration, environment variables, and flags in CLI commands
Use interfaces for external dependencies to facilitate mocking and consider using testify/mock for creating mock implementations
All code must pass golangci-lint checks
Follow Go's error handling idioms: use meaningful error messages, wrap errors with context using fmt.Errorf("context: %w", err), and consider using custom error types for domain-specific errors
Follow standard Go coding style: use gofmt and goimports to format code, prefer short descriptive variable names, use kebab-case for command-line flags, and snake_case for environment variables
Document all exported functions, types, and methods following Go's documentation conventions
Document complex logic with inline comments in Go code
Support configuration via files, environment variables, and flags following the precedence order: flags > environment variables > config file > defaults
Provide clear error messages to users, include troubleshooting hints when appropriate, and log detailed errors for debugging

**/*.go: All comments must end with periods (enforced by godot linter) in Go code
Organize imports into three groups separated by blank lines, sorted alphabetically: Go stdlib, 3rd-party (NOT cloudposse/atmos), then Atmos packages with maintained aliases (cfg, log, u, errUtils)
All errors MUST be wrapped using static errors defined in errors/errors.go - use errors.Join for combining errors, fmt.Errorf with %w for context, and errors.Is() for error checking
Never manually create mocks - use go.uber.org/mock/mockgen with //go:generate directives in Go code
Keep files small and focused - under 600 lines with one cmd/impl per file, co-locate tests, never use //revive:disable:file-length-limit
Use colors from pkg/ui/theme/colors.go for all UI theming in Go code
Code must be compatible with Linux, macOS, and Windows - use SDKs over binaries, use filepath.Join() instead of h...

Files:

  • internal/exec/utils.go
  • internal/exec/stack_manifest_name_test.go
**/{pkg,internal,cmd}/**/*.go

📄 CodeRabbit inference engine (CLAUDE.md)

Add defer perf.Track(atmosConfig, "pkg.FuncName")() plus blank line to all public functions, using nil if no atmosConfig param - exceptions: trivial getters/setters, command constructors, simple factories, functions delegating to tracked functions

Files:

  • internal/exec/utils.go
  • internal/exec/stack_manifest_name_test.go
**/*_test.go

📄 CodeRabbit inference engine (.cursor/rules/atmos-rules.mdc)

**/*_test.go: Every new feature must include comprehensive unit tests targeting >80% code coverage for all packages
Use table-driven tests for testing multiple scenarios in Go
Include integration tests for command flows and test CLI end-to-end when possible with test fixtures

Prefer unit tests with mocks over integration tests - use interfaces and dependency injection for testability, generate mocks with go.uber.org/mock/mockgen, use table-driven tests, target >80% coverage

Files:

  • internal/exec/stack_manifest_name_test.go
🧠 Learnings (45)
📓 Common learnings
Learnt from: osterman
Repo: cloudposse/atmos PR: 1686
File: docs/prd/tool-dependencies-integration.md:58-64
Timestamp: 2025-12-13T06:07:37.766Z
Learning: cloudposse/atmos: For PRD docs (docs/prd/*.md), markdownlint issues like MD040/MD010/MD034 can be handled in a separate documentation cleanup commit and should not block the current PR.
Learnt from: osterman
Repo: cloudposse/atmos PR: 1686
File: errors/errors.go:184-203
Timestamp: 2025-12-13T06:10:13.688Z
Learning: cloudposse/atmos: For toolchain work, duplicate/unused error sentinels in errors/errors.go should be cleaned up in a separate refactor PR and not block feature PRs; canonical toolchain sentinels live under toolchain/registry with re-exports in toolchain/errors.go.
📚 Learning: 2025-03-18T12:26:25.329Z
Learnt from: Listener430
Repo: cloudposse/atmos PR: 1149
File: tests/snapshots/TestCLICommands_atmos_vendor_pull_ssh.stderr.golden:7-7
Timestamp: 2025-03-18T12:26:25.329Z
Learning: In the Atmos project, typos or inconsistencies in test snapshot files (such as "terrafrom" instead of "terraform") may be intentional as they capture the exact output of commands and should not be flagged as issues requiring correction.

Applied to files:

  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_no-name-prod.stdout.golden
  • tests/snapshots/TestCLICommands_atmos_describe_stacks_(stack-manifest-name).stderr.golden
  • tests/test-cases/stack-manifest-name.yaml
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_legacy-prod_(invalid_-_should_suggest_correct_name).stderr.golden
  • internal/exec/stack_manifest_name_test.go
📚 Learning: 2025-02-14T23:12:38.030Z
Learnt from: Listener430
Repo: cloudposse/atmos PR: 1061
File: tests/snapshots/TestCLICommands_atmos_vendor_pull_ssh.stderr.golden:8-8
Timestamp: 2025-02-14T23:12:38.030Z
Learning: Test snapshots in the Atmos project, particularly for dry run scenarios, may be updated during the development process, and temporary inconsistencies in their content should not be flagged as issues.

Applied to files:

  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_no-name-prod.stdout.golden
  • tests/snapshots/TestCLICommands_atmos_describe_stacks_(stack-manifest-name).stderr.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_legacy-prod_(invalid_-_should_suggest_correct_name).stderr.golden
📚 Learning: 2025-01-19T15:49:15.593Z
Learnt from: samtholiya
Repo: cloudposse/atmos PR: 955
File: tests/snapshots/TestCLICommands_atmos_validate_editorconfig_--help.stdout.golden:0-0
Timestamp: 2025-01-19T15:49:15.593Z
Learning: In future commits, the help text for Atmos CLI commands should be limited to only show component and stack parameters for commands that actually use them. This applies to the example usage section in command help text.

Applied to files:

  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_no-name-prod.stdout.golden
  • tests/snapshots/TestCLICommands_atmos_describe_stacks_(stack-manifest-name).stderr.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_legacy-prod_(invalid_-_should_suggest_correct_name).stderr.golden
📚 Learning: 2024-11-25T17:17:15.703Z
Learnt from: RoseSecurity
Repo: cloudposse/atmos PR: 797
File: pkg/list/atmos.yaml:213-214
Timestamp: 2024-11-25T17:17:15.703Z
Learning: The file `pkg/list/atmos.yaml` is primarily intended for testing purposes.

Applied to files:

  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_no-name-prod.stdout.golden
  • tests/test-cases/stack-manifest-name.yaml
📚 Learning: 2025-09-10T21:17:55.273Z
Learnt from: samtholiya
Repo: cloudposse/atmos PR: 1466
File: toolchain/http_client_test.go:3-10
Timestamp: 2025-09-10T21:17:55.273Z
Learning: In the cloudposse/atmos repository, imports should never be changed as per samtholiya's coding guidelines.

Applied to files:

  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_no-name-prod.stdout.golden
📚 Learning: 2025-09-13T16:39:20.007Z
Learnt from: samtholiya
Repo: cloudposse/atmos PR: 1466
File: cmd/markdown/atmos_toolchain_aliases.md:2-4
Timestamp: 2025-09-13T16:39:20.007Z
Learning: In the cloudposse/atmos repository, CLI documentation files in cmd/markdown/ follow a specific format that uses " $ atmos command" (with leading space and dollar sign prompt) in code blocks. This is the established project convention and should not be changed to comply with standard markdownlint rules MD040 and MD014.

Applied to files:

  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_no-name-prod.stdout.golden
  • tests/snapshots/TestCLICommands_atmos_describe_stacks_(stack-manifest-name).stderr.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_legacy-prod_(invalid_-_should_suggest_correct_name).stderr.golden
📚 Learning: 2026-01-04T00:55:21.720Z
Learnt from: CR
Repo: cloudposse/atmos PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-04T00:55:21.720Z
Learning: Applies to tests/snapshots/**/* : Never manually edit golden snapshot files - always use `-regenerate-snapshots` flag when updating test output

Applied to files:

  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_no-name-prod.stdout.golden
📚 Learning: 2025-10-07T00:25:16.333Z
Learnt from: osterman
Repo: cloudposse/atmos PR: 1498
File: website/src/components/Screengrabs/atmos-terraform-metadata--help.html:25-55
Timestamp: 2025-10-07T00:25:16.333Z
Learning: In Atmos CLI, subcommands inherit flags from their parent commands via Cobra's command inheritance. For example, `atmos terraform metadata --help` shows `--affected` and related flags inherited from the parent `terraform` command (defined in cmd/terraform.go), even though the metadata subcommand doesn't explicitly define these flags. This is expected Cobra behavior and auto-generated help screengrabs accurately reflect this inheritance.

Applied to files:

  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_no-name-prod.stdout.golden
📚 Learning: 2024-12-03T05:29:07.718Z
Learnt from: aknysh
Repo: cloudposse/atmos PR: 810
File: internal/exec/terraform_utils.go:145-146
Timestamp: 2024-12-03T05:29:07.718Z
Learning: In the Atmos project, a 5-minute timeout in the `execTerraformOutput` function is acceptable for retrieving `terraform output` for a component in a stack.

Applied to files:

  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_no-name-prod.stdout.golden
📚 Learning: 2024-12-01T00:33:20.298Z
Learnt from: aknysh
Repo: cloudposse/atmos PR: 810
File: examples/tests/stacks/catalog/terraform/template-functions-test2/defaults.yaml:28-32
Timestamp: 2024-12-01T00:33:20.298Z
Learning: In `examples/tests/stacks/catalog/terraform/template-functions-test2/defaults.yaml`, `!exec atmos terraform output` is used in examples to demonstrate its usage, even though `!terraform.output` is the recommended approach according to the documentation.

Applied to files:

  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_no-name-prod.stdout.golden
  • tests/snapshots/TestCLICommands_atmos_describe_stacks_(stack-manifest-name).stderr.golden
  • tests/test-cases/stack-manifest-name.yaml
📚 Learning: 2025-12-13T03:21:35.786Z
Learnt from: osterman
Repo: cloudposse/atmos PR: 1813
File: cmd/terraform/shell.go:28-73
Timestamp: 2025-12-13T03:21:35.786Z
Learning: In Atmos, when calling cfg.InitCliConfig, you must first populate the schema.ConfigAndStacksInfo struct with global flag values using flags.ParseGlobalFlags(cmd, v) rather than passing an empty struct. The LoadConfig function (pkg/config/load.go) reads config selection fields (AtmosConfigFilesFromArg, AtmosConfigDirsFromArg, BasePath, ProfilesFromArg) directly from the ConfigAndStacksInfo struct, NOT from Viper. Passing an empty struct causes config selection flags (--base-path, --config, --config-path, --profile) to be silently ignored. Correct pattern: parse flags → populate struct → call InitCliConfig. See cmd/terraform/plan_diff.go for reference implementation.

Applied to files:

  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_no-name-prod.stdout.golden
  • tests/snapshots/TestCLICommands_atmos_describe_stacks_(stack-manifest-name).stderr.golden
  • internal/exec/utils.go
  • internal/exec/stack_manifest_name_test.go
📚 Learning: 2025-12-24T04:29:23.938Z
Learnt from: osterman
Repo: cloudposse/atmos PR: 1891
File: pkg/ci/terraform/templates/apply.md:17-17
Timestamp: 2025-12-24T04:29:23.938Z
Learning: In the cloudposse/atmos repository, Terraform CI templates (pkg/ci/terraform/templates/*.md) are rendered using TerraformTemplateContext (defined in pkg/ci/terraform/context.go), not the base ci.TemplateContext. TerraformTemplateContext provides top-level fields: .Resources (ci.ResourceCounts), .HasChanges() method, and .HasDestroy field, which are correctly accessed directly in templates without a .Result prefix.

Applied to files:

  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_no-name-prod.stdout.golden
📚 Learning: 2024-12-03T05:18:49.169Z
Learnt from: aknysh
Repo: cloudposse/atmos PR: 810
File: internal/exec/terraform_utils.go:40-213
Timestamp: 2024-12-03T05:18:49.169Z
Learning: In the context of the Atmos project, it's acceptable for functions like `execTerraformOutput` to remain as single functions if they perform a single purpose, such as retrieving Terraform outputs for a component in a stack, even if the function is lengthy.

Applied to files:

  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_no-name-prod.stdout.golden
📚 Learning: 2024-12-07T16:16:13.038Z
Learnt from: Listener430
Repo: cloudposse/atmos PR: 825
File: internal/exec/helmfile_generate_varfile.go:28-31
Timestamp: 2024-12-07T16:16:13.038Z
Learning: In `internal/exec/helmfile_generate_varfile.go`, the `--help` command (`./atmos helmfile generate varfile --help`) works correctly without requiring stack configurations, and the only change needed was to make `ProcessCommandLineArgs` exportable by capitalizing its name.

Applied to files:

  • tests/snapshots/TestCLICommands_atmos_describe_stacks_(stack-manifest-name).stderr.golden
  • internal/exec/utils.go
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_legacy-prod_(invalid_-_should_suggest_correct_name).stderr.golden
  • internal/exec/stack_manifest_name_test.go
📚 Learning: 2024-11-13T21:37:07.852Z
Learnt from: Cerebrovinny
Repo: cloudposse/atmos PR: 764
File: internal/exec/describe_stacks.go:289-295
Timestamp: 2024-11-13T21:37:07.852Z
Learning: In the `internal/exec/describe_stacks.go` file of the `atmos` project written in Go, avoid extracting the stack name handling logic into a helper function within the `ExecuteDescribeStacks` method, even if the logic appears duplicated.

Applied to files:

  • tests/snapshots/TestCLICommands_atmos_describe_stacks_(stack-manifest-name).stderr.golden
  • internal/exec/utils.go
  • internal/exec/stack_manifest_name_test.go
📚 Learning: 2025-09-24T20:45:40.401Z
Learnt from: Benbentwo
Repo: cloudposse/atmos PR: 1475
File: tests/fixtures/scenarios/atmos-auth/stacks/deploy/nonprod.yaml:3-4
Timestamp: 2025-09-24T20:45:40.401Z
Learning: In Atmos stack files, the correct syntax for importing other stack files is `import:` (singular), not `imports:` (plural). All stack files in the Atmos codebase consistently use `import:` followed by a list of paths to import.

Applied to files:

  • tests/snapshots/TestCLICommands_atmos_describe_stacks_(stack-manifest-name).stderr.golden
  • tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_legacy-prod_(invalid_-_should_suggest_correct_name).stderr.golden
📚 Learning: 2025-02-03T05:57:18.407Z
Learnt from: samtholiya
Repo: cloudposse/atmos PR: 959
File: cmd/cmd_utils.go:121-148
Timestamp: 2025-02-03T05:57:18.407Z
Learning: The Atmos CLI should fail fast (exit) when encountering configuration errors, including command alias configuration issues, to prevent undefined behavior. Use LogErrorAndExit instead of returning errors in such cases.

Applied to files:

  • tests/snapshots/TestCLICommands_atmos_describe_stacks_(stack-manifest-name).stderr.golden
📚 Learning: 2025-10-11T19:12:38.832Z
Learnt from: osterman
Repo: cloudposse/atmos PR: 1599
File: tests/snapshots/TestCLICommands_atmos_workflow_invalid_step_type.stderr.golden:0-0
Timestamp: 2025-10-11T19:12:38.832Z
Learning: Usage Examples sections in error output are appropriate for command usage errors (incorrect syntax, missing arguments, invalid flags) but not for configuration validation errors (malformed workflow files, invalid settings in atmos.yaml). Configuration errors should focus on explaining what's wrong with the config, not command usage patterns.

Applied to files:

  • tests/snapshots/TestCLICommands_atmos_describe_stacks_(stack-manifest-name).stderr.golden
📚 Learning: 2025-02-11T08:21:33.143Z
Learnt from: shirkevich
Repo: cloudposse/atmos PR: 1034
File: website/docs/core-concepts/projects/configuration/stores.mdx:173-177
Timestamp: 2025-02-11T08:21:33.143Z
Learning: The parameter for configuring stack path delimiter in store configurations is consistently named `stack_delimiter` (not `stacks_delimiter`) across all store types in Atmos.

Applied to files:

  • tests/snapshots/TestCLICommands_atmos_describe_stacks_(stack-manifest-name).stderr.golden
📚 Learning: 2025-02-06T13:38:07.216Z
Learnt from: Listener430
Repo: cloudposse/atmos PR: 984
File: internal/exec/copy_glob.go:0-0
Timestamp: 2025-02-06T13:38:07.216Z
Learning: The `u.LogTrace` function in the `cloudposse/atmos` repository accepts `atmosConfig` as its first parameter, followed by the message string.

Applied to files:

  • tests/snapshots/TestCLICommands_atmos_describe_stacks_(stack-manifest-name).stderr.golden
📚 Learning: 2025-09-10T17:34:52.568Z
Learnt from: Benbentwo
Repo: cloudposse/atmos PR: 1475
File: pkg/auth/providers/github/oidc.go:96-100
Timestamp: 2025-09-10T17:34:52.568Z
Learning: The ATMOS_ environment variable binding guideline applies to Atmos configuration variables, not external service-required environment variables like GitHub Actions OIDC variables (GITHUB_ACTIONS, ACTIONS_ID_TOKEN_*) which must use their standard names.

Applied to files:

  • tests/snapshots/TestCLICommands_atmos_describe_stacks_(stack-manifest-name).stderr.golden
📚 Learning: 2025-10-08T06:48:07.499Z
Learnt from: aknysh
Repo: cloudposse/atmos PR: 1602
File: internal/exec/stack_processor_utils.go:968-1003
Timestamp: 2025-10-08T06:48:07.499Z
Learning: The `FindComponentDependenciesLegacy` function in `internal/exec/stack_processor_utils.go` is legacy code that is not actively used and is kept only for backward compatibility purposes.

Applied to files:

  • internal/exec/utils.go
📚 Learning: 2024-11-19T23:00:45.899Z
Learnt from: osterman
Repo: cloudposse/atmos PR: 795
File: internal/exec/stack_processor_utils.go:378-386
Timestamp: 2024-11-19T23:00:45.899Z
Learning: In the `ProcessYAMLConfigFile` function within `internal/exec/stack_processor_utils.go`, directory traversal in stack imports is acceptable and should not be restricted.

Applied to files:

  • internal/exec/utils.go
  • internal/exec/stack_manifest_name_test.go
📚 Learning: 2025-09-29T02:20:11.636Z
Learnt from: aknysh
Repo: cloudposse/atmos PR: 1540
File: internal/exec/validate_component.go:117-118
Timestamp: 2025-09-29T02:20:11.636Z
Learning: The ValidateComponent function in internal/exec/validate_component.go had its componentSection parameter type refined from `any` to `map[string]any` without adding new parameters. This is a type safety improvement, not a signature change requiring call site updates.

Applied to files:

  • internal/exec/utils.go
📚 Learning: 2025-10-13T18:13:54.020Z
Learnt from: aknysh
Repo: cloudposse/atmos PR: 1622
File: pkg/perf/perf.go:140-184
Timestamp: 2025-10-13T18:13:54.020Z
Learning: In pkg/perf/perf.go, the `trackWithSimpleStack` function intentionally skips ownership checks at call stack depth > 1 to avoid expensive `getGoroutineID()` calls on every nested function. This is a performance optimization for the common single-goroutine execution case (most Atmos commands), accepting the rare edge case of potential metric corruption if multi-goroutine execution occurs at depth > 1. The ~19× performance improvement justifies this trade-off.

Applied to files:

  • internal/exec/utils.go
📚 Learning: 2024-10-20T00:41:57.135Z
Learnt from: haitham911
Repo: cloudposse/atmos PR: 731
File: internal/exec/validate_stacks.go:93-98
Timestamp: 2024-10-20T00:41:57.135Z
Learning: When downloading schema files in `internal/exec/validate_stacks.go`, use a consistent temporary file name to overwrite the file each time and avoid creating multiple temporary files.

Applied to files:

  • internal/exec/utils.go
  • internal/exec/stack_manifest_name_test.go
📚 Learning: 2025-12-21T04:10:29.030Z
Learnt from: osterman
Repo: cloudposse/atmos PR: 1891
File: internal/exec/describe_affected.go:468-468
Timestamp: 2025-12-21T04:10:29.030Z
Learning: In Go, package-level declarations (constants, variables, types, and functions) are visible to all files in the same package without imports. During reviews in cloudposse/atmos (and similar Go codebases), before suggesting to declare a new identifier, first check if it already exists in another file of the same package. If it exists, you can avoid adding a new declaration; if not, proceed with a proper package-level declaration. 

Applied to files:

  • internal/exec/utils.go
  • internal/exec/stack_manifest_name_test.go
📚 Learning: 2025-12-16T01:01:16.459Z
Learnt from: aknysh
Repo: cloudposse/atmos PR: 1868
File: tests/test-cases/auth-mock.yaml:243-245
Timestamp: 2025-12-16T01:01:16.459Z
Learning: In Atmos tests, the YAML tag !not has project-specific semantics: it negates the value in a way that affects skip conditions, e.g., os: !not windows means skip on Windows (not non-Windows). This is not standard YAML boolean negation. Treat this as a guideline for review: when a test-case YAML uses !not in skip conditions, verify that the skip logic aligns with the project's interpretation. This pattern applies to all YAML test-case files under tests/test-cases (and similar paths in this repo).

Applied to files:

  • tests/test-cases/stack-manifest-name.yaml
📚 Learning: 2025-11-24T17:35:37.209Z
Learnt from: CR
Repo: cloudposse/atmos PR: 0
File: .cursor/rules/atmos-rules.mdc:0-0
Timestamp: 2025-11-24T17:35:37.209Z
Learning: Applies to **/*_test.go : Include integration tests for command flows and test CLI end-to-end when possible with test fixtures

Applied to files:

  • internal/exec/stack_manifest_name_test.go
📚 Learning: 2025-11-24T17:35:37.209Z
Learnt from: CR
Repo: cloudposse/atmos PR: 0
File: .cursor/rules/atmos-rules.mdc:0-0
Timestamp: 2025-11-24T17:35:37.209Z
Learning: Applies to **/*_test.go : Every new feature must include comprehensive unit tests targeting >80% code coverage for all packages

Applied to files:

  • internal/exec/stack_manifest_name_test.go
📚 Learning: 2024-10-23T21:36:40.262Z
Learnt from: osterman
Repo: cloudposse/atmos PR: 740
File: cmd/cmd_utils.go:340-359
Timestamp: 2024-10-23T21:36:40.262Z
Learning: In the Go codebase for Atmos, when reviewing functions like `checkAtmosConfig` in `cmd/cmd_utils.go`, avoid suggesting refactoring to return errors instead of calling `os.Exit` if such changes would significantly increase the scope due to the need to update multiple call sites.

Applied to files:

  • internal/exec/stack_manifest_name_test.go
📚 Learning: 2025-11-24T17:35:37.209Z
Learnt from: CR
Repo: cloudposse/atmos PR: 0
File: .cursor/rules/atmos-rules.mdc:0-0
Timestamp: 2025-11-24T17:35:37.209Z
Learning: Applies to **/*_test.go : Use table-driven tests for testing multiple scenarios in Go

Applied to files:

  • internal/exec/stack_manifest_name_test.go
📚 Learning: 2025-10-22T14:55:44.014Z
Learnt from: osterman
Repo: cloudposse/atmos PR: 1695
File: pkg/auth/manager.go:169-171
Timestamp: 2025-10-22T14:55:44.014Z
Learning: Go 1.20+ supports multiple %w verbs in fmt.Errorf, which returns an error implementing Unwrap() []error. This is valid and does not panic. Atmos uses Go 1.24.8 and configures errorlint with errorf-multi: true to validate this pattern.

Applied to files:

  • internal/exec/stack_manifest_name_test.go
📚 Learning: 2025-11-11T03:47:59.576Z
Learnt from: osterman
Repo: cloudposse/atmos PR: 1686
File: toolchain/which_test.go:166-223
Timestamp: 2025-11-11T03:47:59.576Z
Learning: In the cloudposse/atmos repo, tests that manipulate environment variables should use testing.T.Setenv for automatic setup/teardown instead of os.Setenv/Unsetenv.

Applied to files:

  • internal/exec/stack_manifest_name_test.go
📚 Learning: 2025-04-11T22:06:46.999Z
Learnt from: samtholiya
Repo: cloudposse/atmos PR: 1147
File: internal/exec/validate_schema.go:42-57
Timestamp: 2025-04-11T22:06:46.999Z
Learning: The "ExecuteAtmosValidateSchemaCmd" function in internal/exec/validate_schema.go has been reviewed and confirmed to have acceptable cognitive complexity despite static analysis warnings. The function uses a clean structure with only three if statements for error handling and delegates complex operations to helper methods.

Applied to files:

  • internal/exec/stack_manifest_name_test.go
📚 Learning: 2025-08-15T14:43:41.030Z
Learnt from: aknysh
Repo: cloudposse/atmos PR: 1352
File: pkg/store/artifactory_store_test.go:108-113
Timestamp: 2025-08-15T14:43:41.030Z
Learning: In test files for the atmos project, it's acceptable to ignore errors from os.Setenv/Unsetenv operations during test environment setup and teardown, as these are controlled test scenarios.

Applied to files:

  • internal/exec/stack_manifest_name_test.go
📚 Learning: 2025-11-08T19:56:18.660Z
Learnt from: osterman
Repo: cloudposse/atmos PR: 1697
File: internal/exec/oci_utils.go:0-0
Timestamp: 2025-11-08T19:56:18.660Z
Learning: In the Atmos codebase, when a function receives an `*schema.AtmosConfiguration` parameter, it should read configuration values from `atmosConfig.Settings` fields rather than using direct `os.Getenv()` or `viper.GetString()` calls. The Atmos pattern is: viper.BindEnv in cmd/root.go binds environment variables → Viper unmarshals into atmosConfig.Settings via mapstructure → business logic reads from the Settings struct. This provides centralized config management, respects precedence, and enables testability. Example: `atmosConfig.Settings.AtmosGithubToken` instead of `os.Getenv("ATMOS_GITHUB_TOKEN")` in functions like `getGHCRAuth` in internal/exec/oci_utils.go.

Applied to files:

  • internal/exec/stack_manifest_name_test.go
📚 Learning: 2025-12-13T06:10:13.688Z
Learnt from: osterman
Repo: cloudposse/atmos PR: 1686
File: errors/errors.go:184-203
Timestamp: 2025-12-13T06:10:13.688Z
Learning: cloudposse/atmos: For toolchain work, duplicate/unused error sentinels in errors/errors.go should be cleaned up in a separate refactor PR and not block feature PRs; canonical toolchain sentinels live under toolchain/registry with re-exports in toolchain/errors.go.

Applied to files:

  • internal/exec/stack_manifest_name_test.go
📚 Learning: 2025-09-13T18:06:07.674Z
Learnt from: samtholiya
Repo: cloudposse/atmos PR: 1466
File: toolchain/list.go:39-42
Timestamp: 2025-09-13T18:06:07.674Z
Learning: In the cloudposse/atmos repository, for UI messages in the toolchain package, use utils.PrintfMessageToTUI instead of log.Error or fmt.Fprintln(os.Stderr, ...). Import pkg/utils with alias "u" to follow the established pattern.

Applied to files:

  • internal/exec/stack_manifest_name_test.go
📚 Learning: 2024-11-12T03:16:02.910Z
Learnt from: aknysh
Repo: cloudposse/atmos PR: 775
File: internal/exec/template_funcs_component.go:157-159
Timestamp: 2024-11-12T03:16:02.910Z
Learning: In the Go code for `componentFunc` in `internal/exec/template_funcs_component.go`, the function `cleanTerraformWorkspace` does not return errors, and it's acceptable if the file does not exist. Therefore, error handling for `cleanTerraformWorkspace` is not needed.

Applied to files:

  • internal/exec/stack_manifest_name_test.go
📚 Learning: 2025-01-09T22:27:25.538Z
Learnt from: samtholiya
Repo: cloudposse/atmos PR: 914
File: cmd/validate_stacks.go:20-23
Timestamp: 2025-01-09T22:27:25.538Z
Learning: The validate commands in Atmos can have different help handling implementations. Specifically, validate_component.go and validate_stacks.go are designed to handle help requests differently, with validate_stacks.go including positional argument checks while validate_component.go does not.

Applied to files:

  • internal/exec/stack_manifest_name_test.go
📚 Learning: 2024-10-20T00:57:53.500Z
Learnt from: haitham911
Repo: cloudposse/atmos PR: 731
File: internal/exec/validate_stacks.go:0-0
Timestamp: 2024-10-20T00:57:53.500Z
Learning: In `internal/exec/validate_stacks.go`, when downloading the Atmos JSON Schema file to the temp directory, the temporary file is overwritten each time, so explicit removal is not necessary.

Applied to files:

  • internal/exec/stack_manifest_name_test.go
📚 Learning: 2024-12-12T15:17:45.245Z
Learnt from: osterman
Repo: cloudposse/atmos PR: 808
File: examples/demo-atmos.d/atmos.d/tools/helmfile.yml:10-10
Timestamp: 2024-12-12T15:17:45.245Z
Learning: In `examples/demo-atmos.d/atmos.d/tools/helmfile.yml`, when suggesting changes to `kubeconfig_path`, ensure that the values use valid Go template syntax.

Applied to files:

  • internal/exec/stack_manifest_name_test.go
📚 Learning: 2024-12-07T16:19:01.683Z
Learnt from: aknysh
Repo: cloudposse/atmos PR: 825
File: internal/exec/terraform.go:30-30
Timestamp: 2024-12-07T16:19:01.683Z
Learning: In `internal/exec/terraform.go`, skipping stack validation when help flags are present is not necessary.

Applied to files:

  • internal/exec/stack_manifest_name_test.go
🧬 Code graph analysis (1)
internal/exec/utils.go (2)
pkg/schema/schema.go (1)
  • ConfigAndStacksInfo (727-824)
pkg/config/const.go (1)
  • NameSectionName (65-65)
⏰ Context from checks skipped due to timeout of 900000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Summary
🔇 Additional comments (9)
tests/snapshots/TestCLICommands_atmos_describe_stacks_(stack-manifest-name).stderr.golden (1)

1-5: Snapshot looks correct.

This captures the expected error when describe stacks runs without name_pattern configured. Aligns with the disabled Test 5 in stack-manifest-name.yaml that documents this requirement.

tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_legacy-prod_(invalid_-_should_suggest_correct_name).stderr.golden (1)

1-14: Good error UX.

The snapshot captures helpful guidance: identifies the invalid stack, suggests the canonical name, and points to atmos list stacks. This directly addresses the PR objective of actionable hints.

tests/snapshots/TestCLICommands_atmos_describe_component_vpc_-s_no-name-prod.stdout.golden (1)

1-186: Validates zero-config filename fallback.

The snapshot confirms that when no name, name_template, or name_pattern is configured, the filename (no-name-prod) becomes the canonical stack identity. This is core to the PR's zero-config goal.

tests/test-cases/stack-manifest-name.yaml (1)

1-137: Solid test coverage for stack identity rules.

The test suite covers the key scenarios:

  • Canonical name visibility in list stacks
  • Component discovery by explicit name and filename
  • Rejection paths with helpful error messages

Test 5 being disabled with documentation is appropriate given the name_pattern requirement for describe stacks.

internal/exec/stack_manifest_name_test.go (2)

407-449: Key test for issue #1932.

This test validates that ProcessStacks correctly finds components when the manifest-level name is used. Direct coverage for the linked issue's requirement.


766-809: Good error hint validation.

The test verifies both hints are present with exact content. Using errors.GetAllHints from cockroachdb/errors properly exercises the error chain.

internal/exec/utils.go (3)

354-356: Enables zero-config naming.

Setting ContextPrefix = stackName when no naming config exists lets the filename serve as the canonical identity. Clean implementation of the fallback.


420-432: Clear precedence implementation.

The switch statement directly mirrors the documented precedence: manifest name → template/pattern → filename. The condition ContextPrefix != stackName correctly distinguishes template-generated names from fallback.


616-625: Helpful error path.

When a user provides a filename that maps to a different canonical name, they get a specific suggestion rather than a generic "not found" error. Good UX.

@aknysh
Copy link
Copy Markdown
Member

aknysh commented Jan 10, 2026

@coderabbitai full review please

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Jan 10, 2026

@aknysh: I'll conduct a full review of the PR now.

✅ Actions performed

Full review triggered.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Jan 10, 2026

@aknysh: I'll conduct a full review of the PR now.


🧠 Learnings used
Learnt from: aknysh
Repo: cloudposse/atmos PR: 1327
File: internal/exec/describe_affected_utils_2.go:248-248
Timestamp: 2025-06-23T18:50:33.614Z
Learning: When aknysh mentions that a suggestion is not related to the current PR and needs separate tests to be reviewed in a separate PR, this indicates their preference for maintaining focused PR scope and proper test coverage for each change.
✅ Actions performed

Full review triggered.

@aknysh aknysh merged commit 1527ee8 into main Jan 10, 2026
57 checks passed
@aknysh aknysh deleted the osterman/fix-import-cycle-1932 branch January 10, 2026 18:25
@github-actions
Copy link
Copy Markdown

These changes were released in v1.204.0-rc.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

minor New features that do not break anything size/xl Extra large size PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stack name override not taken into account by atmos tf plan

2 participants