Skip to content

fix: Describe Affected Detects Component File Changes. fix: Vendored components with source - #2003

Merged
Andriy Knysh (aknysh) merged 12 commits into
mainfrom
aknysh/fix-describe-affected-1
Jan 22, 2026
Merged

Andriy Knysh (aknysh) merged 12 commits into
mainfrom
aknysh/fix-describe-affected-1

Conversation

@aknysh

@aknysh Andriy Knysh (aknysh) commented Jan 21, 2026 •

Copy link
Copy Markdown
Member

what

  • Fixed atmos describe affected to correctly detect component file changes (Terraform, Helmfile, Packer)
  • Added gitRepoRoot parameter to path resolution logic to properly resolve relative paths from git diff
  • Fixed detection of components using source for vendoring (components without explicit component field)
  • A regression in previous Atmos releases caused changes to component files to not be detected in certain scenarios

why

Issue 1: Git repo root path resolution

  • Git diff returns file paths relative to the git repository root
  • The previous implementation used filepath.Abs() which resolves paths against the current working directory
  • When Atmos was run from a subdirectory (e.g., atmos -C examples/demo-stacks), paths would not match, causing component changes to go undetected

Issue 2: Vendored components with source

  • Components using source for just-in-time vendoring were not being detected
  • The affected detection required an explicit component field to determine which folder to monitor
  • Now defaults to using the component name (YAML key) when no explicit component field is specified

changes

Path resolution fix

  • newChangedFilesIndex() now accepts gitRepoRoot parameter
  • Relative paths from git diff are resolved against the git repo root, not the current working directory

Source component detection fix

  • Added GetComponentFolder() helper in stack_utils.go to consolidate component folder resolution logic
  • Modified BuildComponentPath() to accept optional fallback parameter
  • processTerraformComponentsIndexed(), processHelmfileComponentsIndexed(), processPackerComponentsIndexed() now use GetComponentFolder() which defaults to component name when component field is missing
  • This ensures components with source vendoring are properly tracked

test coverage

All three scenarios are covered by unit tests:

Scenario Test Coverage
metadata.component specified TestFindAffectedComponentFolderChanges/explicit_component_field ✓
TestFindAffectedComponentFolderChanges/inherited_base_component ✓
TestGetComponentFolder/returns_explicit_component_field_when_set ✓
source specified (JIT vendoring) TestFindAffectedComponentFolderChanges/JIT_vendored_component_with_source_-_simple_config ✓
TestFindAffectedComponentFolderChanges/JIT_vendored_component_with_source_-_full_config ✓
TestFindAffectedHelmfileAndPackerComponents/Helmfile_JIT_vendored_with_source ✓
TestFindAffectedHelmfileAndPackerComponents/Packer_JIT_vendored_with_source ✓
source + workdir specified TestFindAffectedHelmfileAndPackerComponents/Terraform_with_source_and_workdir ✓
TestFindAffectedHelmfileAndPackerComponents/Helmfile_with_source_and_workdir ✓
TestFindAffectedHelmfileAndPackerComponents/Packer_with_source_and_workdir ✓

Resolution flow

  1. metadata.component: mock → Stack processing sets componentSection["component"] = "mock" → GetComponentFolder uses that value
  2. source only → No component field → GetComponentFolder falls back to componentName (YAML key)
  3. source + workdir → Same as 2 (see note below)

Why provision.workdir doesn't affect folder resolution

For describe affected, the workdir configuration doesn't change how component folders are resolved because:

  1. Workdir is runtime-only: The .workdir/ directory is created at runtime when you run atmos terraform plan/apply. It's a temporary copy of the component files.

  2. Workdir is not tracked in git: The .workdir/ directory is in .gitignore. Changes to files in .workdir/ don't appear in git diff.

  3. describe affected compares git branches: It looks at what files changed between commits/branches. Since workdir files aren't tracked, the detection happens on the source files:

    • For local components: components/terraform/<component>/
    • For vendored components with source: components/terraform/<component-name>/ (where files are vendored)
Source of truth (tracked in git)     →    Workdir (runtime, not tracked)
components/terraform/vpc-remote/     →    .workdir/terraform/dev-vpc-remote/
         ↑                                           ↑
   describe affected                          terraform runs here
   detects changes HERE

When you modify vendored component files in components/terraform/vpc-remote-workdir/, describe affected detects that change. The fact that at runtime those files get copied to .workdir/ doesn't matter for change detection.

references

Summary by CodeRabbit

  • Bug Fixes
    • Corrected affected-component detection when running from a repo root or subdirectory (e.g., using -C), improving path resolution.
    • Properly detect vendored (source-based) components and component folder/file changes across Terraform, Helmfile, and Packer.
  • Documentation
    • Added blog posts explaining the improved detection, vendoring behavior, and cross-platform path-handling guidance.

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

@aknysh
Andriy Knysh (aknysh) requested a review from a team as a code owner January 21, 2026 19:18
@aknysh Andriy Knysh (aknysh) added the patch A minor, backward compatible change label Jan 21, 2026
@github-actions github-actions Bot added the size/m Medium size PR label Jan 21, 2026
@aknysh Andriy Knysh (aknysh) self-assigned this Jan 21, 2026
@github-actions

github-actions Bot commented Jan 21, 2026 •

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues found.

Scanned Files

None

@coderabbitai

coderabbitai Bot commented Jan 21, 2026 •

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

Threaded a gitRepoRoot/basePath parameter through describe-affected code paths and updated component-folder resolution to use a fallback when component field is missing, plus extensive tests and docs to validate repo-root-relative path resolution and vendored-component detection. Changes are limited to parameter passing, path resolution, and tests.

Changes

Cohort / File(s) Summary
Changed files index
internal/exec/describe_affected_changed_files_index.go
newChangedFilesIndex(..., gitRepoRoot string) added: resolve relative git-diff paths against repo root, fall back to filepath.Abs when empty, normalize to absolute paths for indexing.
Parameter threading
internal/exec/describe_affected_utils.go, internal/exec/describe_affected_utils_parallel.go, internal/exec/describe_affected_benchmark_test.go
Threaded localRepoFileSystemPathAbs/gitRepoRoot through executeDescribeAffected → findAffected → findAffectedParallel → newChangedFilesIndex; adjusted call sites and argument ordering.
Component path helpers
internal/exec/stack_utils.go, internal/exec/stack_utils_test.go
Added GetComponentFolder(...) and changed BuildComponentPath(..., componentNameFallback ...string) to allow fallback to YAML key when explicit component field missing; added tests for fallback behavior.
Component detection logic
internal/exec/describe_affected_components.go, internal/exec/describe_affected_utils_2.go
Replaced inline component extraction with GetComponentFolder usage, removed duplicate change blocks, and propagate errors from indexed change checks; pass fallback component name into BuildComponentPath.
Tests — affected detection
internal/exec/describe_affected_utils_test.go, internal/exec/describe_affected_optimizations_test.go, internal/exec/describe_affected_benchmark_test.go
Large expansion of tests to cover gitRepoRoot path resolution, absolute vs relative paths, vendored components, env/vars scenarios, and overall index behavior; updated many call sites to pass new parameter.
Docs / guidance / blog
CLAUDE.md, website/blog/2026-01-21-describe-affected-component-detection.mdx, website/blog/2026-01-21-describe-affected-source-vendoring.mdx
Added cross-platform path-handling guidance for tests and two blog posts describing repo-root-relative diff resolution and vendored component detection fixes.

Sequence Diagram(s)

(omitted)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • osterman
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly addresses the two main fixes: detecting component file changes and handling vendored components with source.
Linked Issues check ✅ Passed All core requirements from issue #1978 are met: component file changes are detected, git-diff paths are resolved against repo root, and vendored components with source are supported.
Out of Scope Changes check ✅ Passed All changes directly support the fix objectives: path resolution logic, component folder detection, function signature updates, tests, and documentation are all in scope.

✏️ 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 aknysh/fix-describe-affected-1

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 coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@internal/exec/describe_affected_utils_test.go`:
- Around line 263-264: The inline comment "gitRepoRoot - empty for unit tests
with absolute paths" is missing a trailing period and fails golangci-lint godot;
update that inline comment (adjacent to the gitRepoRoot argument in the test for
describe_affected_utils_test) to end with a period so it reads e.g. "gitRepoRoot
- empty for unit tests with absolute paths." and similarly ensure any other
inline comments in the same test follow the same rule.
- Around line 483-484: Add a unit test case in describe_affected_utils_test.go
that passes a non-empty gitRepoRoot (e.g., "/repo/root" or use filepath.Join to
build a platform-safe path) and uses relative changedFiles (e.g.,
"pkg/foo/file.go", "./pkg/bar.go") to exercise the path-resolution branch; call
the same test helper that currently gets "" for gitRepoRoot and assert the
returned/processed file paths are resolved to absolute/combined paths (use
filepath.Join/gitRepoRoot + changedFile and filepath.Clean in the expected
values) so the test verifies the resolution logic for functions that accept
gitRepoRoot and changedFiles. Ensure the new case is added to the existing test
table (or a new test function) and uses filepath utilities for cross-platform
assertions.

@codecov

codecov Bot commented Jan 21, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 78.68852% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 75.26%. Comparing base (b9df5d7) to head (b4aa9f1).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
internal/exec/describe_affected_components.go 59.25% 6 Missing and 5 partials ⚠️
...rnal/exec/describe_affected_changed_files_index.go 81.81% 1 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2003      +/-   ##
==========================================
+ Coverage   75.21%   75.26%   +0.04%     
==========================================
  Files         785      785              
  Lines       72460    72479      +19     
==========================================
+ Hits        54501    54551      +50     
+ Misses      14473    14443      -30     
+ Partials     3486     3485       -1     
Flag Coverage Δ
unittests 75.26% <78.68%> (+0.04%) ⬆️

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

Files with missing lines Coverage Δ
internal/exec/describe_affected_utils.go 80.88% <100.00%> (+4.01%) ⬆️
internal/exec/describe_affected_utils_2.go 75.71% <100.00%> (ø)
internal/exec/describe_affected_utils_parallel.go 91.66% <100.00%> (ø)
internal/exec/stack_utils.go 69.23% <100.00%> (+2.28%) ⬆️
...rnal/exec/describe_affected_changed_files_index.go 89.87% <81.81%> (+1.14%) ⬆️
internal/exec/describe_affected_components.go 61.50% <59.25%> (+5.30%) ⬆️

... and 1 file with indirect coverage changes

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

@aknysh Andriy Knysh (aknysh) changed the title fix: Describe Affected Now Detects Component File Changes fix: Describe Affected Detects Component File Changes and Vendored components with source Jan 21, 2026
@github-actions github-actions Bot added size/l Large size PR and removed size/m Medium size PR labels Jan 21, 2026
@aknysh Andriy Knysh (aknysh) changed the title fix: Describe Affected Detects Component File Changes and Vendored components with source fix: Describe Affected Detects Component File Changes. fix: Vendored components with source Jan 21, 2026
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jan 21, 2026
Replace forward slash path concatenation with filepath.Join to fix
Windows CI test failures due to path separator differences.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Document best practices for using filepath.Join in tests to prevent
Windows CI failures due to path separator differences.

Co-Authored-By: Claude Opus 4.5 <[email protected]>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@CLAUDE.md`:
- Line 361: The general compatibility guideline currently reads
"Linux/macOS/Windows compatible. Use SDKs over binaries." but dropped the
earlier advice to prefer filepath.Join(); restore it by editing that sentence to
read something like "Linux/macOS/Windows compatible — use SDKs over binaries and
use filepath.Join() instead of hardcoded path separators." Update the same
paragraph that contains the exact string "Linux/macOS/Windows compatible. Use
SDKs over binaries." so the general guidance matches the more specific test
section and references filepath.Join() explicitly.

Comment thread CLAUDE.md Resolved
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jan 21, 2026
@aknysh

Copy link
Copy Markdown
Member Author

CodeRabbit (@coderabbitai) full review please

@coderabbitai

coderabbitai Bot commented Jan 22, 2026

Copy link
Copy Markdown
Contributor

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


🧠 Learnings used
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: 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.

Learnt from: aknysh
Repo: cloudposse/atmos PR: 944
File: go.mod:206-206
Timestamp: 2025-01-17T00:18:57.769Z
Learning: For indirect dependencies with license compliance issues in the cloudposse/atmos repository, the team prefers to handle them in follow-up PRs rather than blocking the current changes, as these issues often require deeper investigation of the dependency tree.
✅ Actions performed

Full review triggered.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@internal/exec/describe_affected_utils_test.go`:
- Around line 419-421: Update the outdated test comment: clarify why
ComponentPath is expected empty despite BuildComponentPath now accepting a
componentNameFallback (refer to BuildComponentPath and the test's usage where
affected[0].ComponentPath is asserted empty). Either document that this code
path intentionally does not pass a componentNameFallback (so fallback isn't
applied) or adjust the test to pass an explicit fallback; make the comment state
the exact reason (e.g., "no fallback passed in this code path, so ComponentPath
remains empty") and reference BuildComponentPath and affected[0].ComponentPath
for context.

@coderabbitai

coderabbitai Bot commented Jan 22, 2026

Copy link
Copy Markdown
Contributor

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


🧠 Learnings used
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: aknysh
Repo: cloudposse/atmos PR: 944
File: go.mod:206-206
Timestamp: 2025-01-17T00:18:57.769Z
Learning: For indirect dependencies with license compliance issues in the cloudposse/atmos repository, the team prefers to handle them in follow-up PRs rather than blocking the current changes, as these issues often require deeper investigation of the dependency tree.

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.

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.

Learnt from: osterman
Repo: cloudposse/atmos PR: 808
File: pkg/config/config.go:478-483
Timestamp: 2024-12-02T21:26:32.337Z
Learning: In the 'atmos' project, when reviewing Go code like `pkg/config/config.go`, avoid suggesting file size checks after downloading remote configs if such checks aren't implemented elsewhere in the codebase.
✅ Actions performed

Full review triggered.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@internal/exec/describe_affected_utils_test.go`:
- Around line 342-543: The vendored-component path is left empty because
BuildComponentPath is called without the component name fallback; in the code
that sets affected.ComponentPath (call site in describe_affected_utils_2.go
around the findAffected logic), pass the componentName as the third/fallback
argument: BuildComponentPath(atmosConfig, componentSection,
affected.ComponentType, componentName) so BuildComponentPath can resolve a
fallback folder name for JIT-vendored components; then update the test in
internal/exec/describe_affected_utils_test.go (the "Should detect changes for
JIT vendored component with source - simple config" case) to assert the resolved
ComponentPath (the expected path under components/terraform/<componentName>)
instead of expecting it to be empty and adjust the comment accordingly.
🧹 Nitpick comments (1)
website/blog/2025-01-21-describe-affected-component-detection.mdx (1)

51-64: Consider mentioning vendored components with source.

The PR also fixes detection for vendored components using source without an explicit component field. Might be worth a bullet point under "The command now correctly detects" for completeness, though optional.

📝 Optional addition
 The command now correctly detects:
 - Changes to component folders (Terraform, Helmfile, Packer)
 - Changes to individual files within components
 - Stack configuration changes (as before)
+- Vendored components configured with `source` (even without an explicit `component` field)

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Fix all issues with AI agents
In `@internal/exec/describe_affected_optimizations_test.go`:
- Around line 1263-1267: The scenario comment block in the test (the lines
describing the simulated repo root, Atmos base path, and changed file) violates
golangci-lint’s godot rule because the lines don't end with periods; update
those comment lines in describe_affected_optimizations_test.go so each sentence
ends with a trailing period (e.g., add periods to the lines that start with "-
Git repo root is", "- Atmos base path is", and "- Changed file from git diff
is") to satisfy the lint rule.

In `@website/blog/2025-01-21-describe-affected-component-detection.mdx`:
- Around line 1-8: Update the post's filename and its frontmatter date from 2025
to 2026: rename
website/blog/2025-01-21-describe-affected-component-detection.mdx to
website/blog/2026-01-21-describe-affected-component-detection.mdx and change the
frontmatter date value (the "date:" field) from 2025-01-21T00:00:00.000Z to
2026-01-21T00:00:00.000Z so the file ordering matches the intended release
timeline.

In `@website/blog/2025-01-21-describe-affected-source-vendoring.mdx`:
- Around line 1-8: The frontmatter date and the filename are set to 2025-01-21
but the post is for the 2026 fix; update the frontmatter "date" value to
2026-01-21T00:00:00.000Z (or the correct 2026 timestamp) and rename the file
from 2025-01-21-describe-affected-source-vendoring.mdx to
2026-01-21-describe-affected-source-vendoring.mdx so the filename and the "date"
frontmatter remain consistent with the release timeline; verify the slug/title
remain unchanged.
♻️ Duplicate comments (1)
internal/exec/describe_affected_utils_test.go (1)

419-420: Update the ComponentPath comment to reflect current fallback behavior. The note says BuildComponentPath lacks fallback, but fallback exists; it’s this code path that doesn’t pass it.

📝 Suggested fix
-		// ComponentPath is empty because BuildComponentPath doesn't have component name fallback.
+		// ComponentPath is empty because this code path doesn't pass a component name fallback to BuildComponentPath.
🧹 Nitpick comments (1)
internal/exec/stack_utils_test.go (1)

189-226: Prefer a table‑driven test for these fallback scenarios.

This trims duplication and matches the repo’s test style for multi‑case coverage.

♻️ Proposed refactor
 func TestBuildComponentPathWithFallback(t *testing.T) {
 	atmosConfig := schema.AtmosConfiguration{
 		BasePath: "/base",
 		Components: schema.Components{
 			Terraform: schema.Terraform{
 				BasePath: "terraform",
 			},
 		},
 	}
 
-	t.Run("uses fallback when component field is missing", func(t *testing.T) {
-		// Component with source (JIT vendoring) but no explicit component field.
-		componentSection := map[string]any{
-			"source": map[string]any{"uri": "github.com/example/vpc"},
-			"vars":   map[string]any{"name": "test"},
-		}
-		result := BuildComponentPath(&atmosConfig, &componentSection, cfg.TerraformComponentType, "vpc-sourced")
-		expected := string(filepath.Separator) + filepath.Join("base", "terraform", "vpc-sourced")
-		assert.Equal(t, expected, result)
-	})
-
-	t.Run("explicit component field takes precedence over fallback", func(t *testing.T) {
-		componentSection := map[string]any{
-			"component": "vpc",
-			"vars":      map[string]any{"name": "test"},
-		}
-		result := BuildComponentPath(&atmosConfig, &componentSection, cfg.TerraformComponentType, "vpc-production")
-		expected := string(filepath.Separator) + filepath.Join("base", "terraform", "vpc")
-		assert.Equal(t, expected, result)
-	})
-
-	t.Run("returns empty when no component field and no fallback", func(t *testing.T) {
-		componentSection := map[string]any{
-			"vars": map[string]any{"name": "test"},
-		}
-		result := BuildComponentPath(&atmosConfig, &componentSection, cfg.TerraformComponentType)
-		assert.Equal(t, "", result)
-	})
+	tests := []struct {
+		name             string
+		componentSection map[string]any
+		fallback         []string
+		expected         string
+	}{
+		{
+			name: "uses fallback when component field is missing",
+			componentSection: map[string]any{
+				"source": map[string]any{"uri": "github.com/example/vpc"},
+				"vars":   map[string]any{"name": "test"},
+			},
+			fallback: []string{"vpc-sourced"},
+			expected: filepath.Join("/base", "terraform", "vpc-sourced"),
+		},
+		{
+			name: "explicit component field takes precedence over fallback",
+			componentSection: map[string]any{
+				"component": "vpc",
+				"vars":      map[string]any{"name": "test"},
+			},
+			fallback: []string{"vpc-production"},
+			expected: filepath.Join("/base", "terraform", "vpc"),
+		},
+		{
+			name: "returns empty when no component field and no fallback",
+			componentSection: map[string]any{
+				"vars": map[string]any{"name": "test"},
+			},
+			expected: "",
+		},
+	}
+
+	for _, tt := range tests {
+		t.Run(tt.name, func(t *testing.T) {
+			result := BuildComponentPath(&atmosConfig, &tt.componentSection, cfg.TerraformComponentType, tt.fallback...)
+			assert.Equal(t, tt.expected, result)
+		})
+	}
 }

As per coding guidelines.

coderabbitai[bot]
coderabbitai Bot previously approved these changes Jan 22, 2026
@aknysh
Andriy Knysh (aknysh) merged commit 7cf11a3 into main Jan 22, 2026
59 checks passed
@aknysh
Andriy Knysh (aknysh) deleted the aknysh/fix-describe-affected-1 branch January 22, 2026 14:24
@github-actions

Copy link
Copy Markdown

These changes were released in v1.204.1-rc.4.

This branch was successfully deployed

1 active deployment
preview — b4aa9f15 Deployed Jan 22, 2026 by github-actions[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

patch A minor, backward compatible change size/xl Extra large size PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

atmos describe affected: does not consider component changes

2 participants