Skip to content

fix: resolve JIT workdir path for !terraform.state, !terraform.output, and atmos.Component - #2328

Merged
Andriy Knysh (aknysh) merged 50 commits into
cloudposse:mainfrom
zack-is-cool:feat/fix-terraform-state-jit-path-resolution
Apr 20, 2026
Merged

Andriy Knysh (aknysh) merged 50 commits into
cloudposse:mainfrom
zack-is-cool:feat/fix-terraform-state-jit-path-resolution

Conversation

@zack-is-cool

@zack-is-cool zack-is-cool commented Apr 14, 2026 •

Copy link
Copy Markdown
Contributor

What

Bug fix PR. Makes !terraform.state, !terraform.output, and atmos.Component work correctly for JIT workdir components (provision.workdir.enabled: true). All three were silently broken in ways that only surfaced at runtime.

Four fixes:

  1. !terraform.state path resolution — resolves state path from .workdir/terraform/<stack>-<component>/ instead of the static source directory JIT components never write state to.
  2. !terraform.output / atmos.Component auto-provision — provisions the JIT workdir before terraform init so output references work on any machine, not just ones with a pre-existing workdir from a prior apply.
  3. Source-provisioned JIT workdir support — Fix 2 only handled local-copy provisioning. For source.uri components, !terraform.output now hydrates from the source URI before init. Also fixes extractComponentName fallback and a go-getter FileGetter dst-must-not-exist invariant.
  4. Provisioner output interleaving — ui.ClearLine() before status writes prevents the bubbletea spinner from leaving leading whitespace on provisioner messages.

Correctness & security fixes:

  • TOCTOU race — sync.Map.Load+Store replaced with LoadOrStore inside the singleflight closure, eliminating the window where two goroutines could both enter Provision.
  • Context cancellation — switched to singleflight.DoChan + select so waiters with cancelled contexts exit immediately. Added context.WithoutCancel so leader cancellation doesn't abort shared provisioning work.
  • Path traversal guard — extractComponentPath verifies the derived workdir path stays within filepath.Abs(basePath) before returning it; escaping paths fall back to componentPath. Mirrors the existing guard in terraform_backend_local.go.
  • Actionable error hint — ErrWorkdirProvision now includes the full YAML path and env var to disable auto-provisioning.
  • loadConfigFromCLIArgs env var bug — setEnv(v) was missing on the --config/--config-path code path, silently ignoring all ATMOS_* overrides when config was loaded from CLI args.
  • Documentation — auto_provision_workdir_for_outputs and ATMOS_COMPONENTS_TERRAFORM_AUTO_PROVISION_WORKDIR_FOR_OUTPUTS added to the config/env var reference docs.

Why

JIT workdir components write their Terraform files to .workdir/terraform/<stack>-<component>/ via a before.terraform.init hook — but that hook only fires during direct atmos terraform commands, not YAML function evaluation. Three distinct silent failures resulted:

  • !terraform.state looked in the source directory where JIT components have no state — unconditional failure.
  • !terraform.output computed the correct workdir path but never populated the directory before calling terraform init — fails with "no such file or directory" on any cold machine.
  • !terraform.output + source.uri — even with Fix 2, ProvisionWorkdir only copies local files. Source-provisioned components need AutoProvisionSource first, which only fires in the hook system the output executor never reaches.

Note on Fix 3 (source.uri components)

!terraform.output against a source-provisioned component with a cold workdir will fetch from source.uri — the same credentials already needed for atmos terraform apply. The fetch is cached per (stack, component) pair per process.

Set auto_provision_workdir_for_outputs: false (or ATMOS_COMPONENTS_TERRAFORM_AUTO_PROVISION_WORKDIR_FOR_OUTPUTS=false) to disable Fixes 2 and 3.

For state-only reads, prefer !terraform.state — no init, no source fetch, no terraform binary required.


Migration

No breaking changes. Previously-failing commands now work.

# Before (runs terraform init + output on every eval):
vpc_id: '{{ (atmos.Component "vpc" .stack).outputs.vpc_id }}'

# After (reads state file directly, no init):
vpc_id: !terraform.state vpc {{ .stack }} vpc_id

Resolves #2167

Summary by CodeRabbit

  • New Features

    • Auto-provision JIT working directories before Terraform output evaluation (configurable, enabled by default).
    • Template/YAML functions can resolve state/outputs from JIT-provisioned and source-backed components.
  • Security / Bug Fixes

    • Containment checks to prevent path traversal outside configured base path.
    • Safer fallbacks and debug logging when workdir/state resolution fails.
  • Documentation

    • Docs and env var added for the new auto-provision setting.
  • Tests

    • Extensive unit/integration tests covering JIT provisioning, resolution, caching, concurrency, and inheritance.

ReadTerraformBackendLocal always used the static formula
TerraformDirAbsolutePath + component_name to find state files.
JIT workdir components provision to .workdir/terraform/<stack>-<component>/
so !terraform.state always returned 'not provisioned' for them.

Add resolveLocalBackendComponentPath helper with three-step resolution:
1. _workdir_path fast path (set by provisioner during apply)
2. BuildPath derivation when provision.workdir.enabled: true
3. Static fallback for non-JIT components (unchanged behavior)

Fixes cloudposse#2167
Regression test for cloudposse#2167.
Pre-populated state file at .workdir/terraform/test-producer/
terraform.tfstate.d/test-producer/terraform.tfstate so the test
requires no network access or terraform run.
…test

The .workdir/terraform.tfstate.d path matches *.tfstate.* in .gitignore.
Force-add so the integration test fixture is available in CI.

Related to cloudposse#2167
@zack-is-cool
zack-is-cool requested review from a team as code owners April 14, 2026 22:54
@atmos-pro

atmos-pro Bot commented Apr 14, 2026 •

Copy link
Copy Markdown
Contributor

Tip

Atmos Pro  

No affected stacks workflow was detected for this pull request.
If this is expected, no action is needed.
Learn More.

View pull request changes on Atmos Pro

@github-actions github-actions Bot added the size/m Medium size PR label Apr 14, 2026
@zack-is-cool
zack-is-cool marked this pull request as draft April 14, 2026 22:57
@coderabbitai

coderabbitai Bot commented Apr 14, 2026 •

Copy link
Copy Markdown
Contributor

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds JIT workdir resolution and coordinated provisioning for Terraform outputs/state. Resolver prefers explicit _workdir_path, then provWorkdir-derived JIT workdir (with BasePath containment guard), then static component path. Integrates a WorkdirProvisioner into the output executor with singleflight coordination, caching, tests, fixtures, config and docs.

Changes

Cohort / File(s) Summary
Local backend resolution
internal/terraform_backend/terraform_backend_local.go, internal/terraform_backend/terraform_backend_local_test.go
Replaced static component-dir lookup with resolveLocalBackendComponentPath(...). Honors _workdir_path, derives workdir via provWorkdir.BuildPath, absolutizes and enforces containment within BasePath, logs failures, falls back to static path. Added tests for fast-path, JIT-derived paths, containment, relative BasePath, and missing-state behavior.
Terraform output executor core
pkg/terraform/output/executor.go, pkg/terraform/output/executor_runner.go, pkg/terraform/output/executor_output.go, pkg/terraform/output/executor_utils.go, pkg/terraform/output/mock_executor_test.go
Refactored executor: added runner/init/output helpers, output extraction and conversion, caching/quiet-mode utilities, WithWorkdirProvisioner option, go:generate for mocks, and mock for WorkdirProvisioner. Removed older helper implementations moved elsewhere.
Workdir provisioning & coordination
pkg/terraform/output/executor_workdir.go, pkg/provisioner/workdir/workdir.go
Introduced WorkdirProvisioner and default implementation; ensureWorkdirProvisioned uses singleflight.Group to deduplicate provisioning, caches success/failure and reprovision flag, uses non-cancel leader context for provisioning, clears UI line, and exports ResetWorkdirProvisionCache.
Component config & extraction
pkg/terraform/output/config.go, pkg/terraform/output/config_test.go
Added AutoProvisionWorkdirForOutputs to ComponentConfig; extractComponentPath validates workdir containment within basePath and falls back to static component path with debug logging; tests added for containment and config propagation.
Provisioner/source & vendor
pkg/provisioner/source/provision_hook.go, pkg/provisioner/source/vendor.go
extractComponentName now considers atmos_component metadata; VendorSource stages downloads via os.MkdirTemp then removes the empty dir before fetch with added error handling.
Executor output helpers & runner
pkg/terraform/output/executor_output.go, pkg/terraform/output/executor_runner.go
Added output processing, yq extraction, JSON conversion helpers, GetStaticRemoteStateOutput, defaultRunnerFactory, and runInit / runOutput helpers.
Caches, concurrency & tests
pkg/terraform/output/executor_utils.go, pkg/terraform/output/executor_test.go, various test files
Added outputs cache with ResetOutputsCache, quietModeWriter, stderr wrapping, spinner helpers; extensive tests for ensureWorkdirProvisioned concurrency, caching, reprovision signaling and related mock updates.
Integration tests & fixtures
tests/fixtures/scenarios/terraform-state-jit-workdir/*, tests/fixtures/scenarios/terraform-output-jit-workdir/*, tests/*.go
New fixtures and many regression/integration tests validating !terraform.state and !terraform.output behavior with JIT workdirs (including source-based provisioning), seeding state, and precondition helpers; added .gitignore for generated .workdir.
Config, schema, docs & snapshots
pkg/config/*, pkg/schema/schema.go, website/docs/*, go.mod, various snapshots
Added components.terraform.auto_provision_workdir_for_outputs (default true) with env binding ATMOS_COMPONENTS_TERRAFORM_AUTO_PROVISION_WORKDIR_FOR_OUTPUTS, tests, docs updates, and promoted golang.org/x/sync to direct dependency. Updated snapshots to reflect new setting and some masked tokens.
Errors
errors/errors.go
Added sentinel ErrEvaluateOutput.

Sequence Diagram(s)

sequenceDiagram
    participant Caller as Caller (describe / executor)
    participant Exec as Output.Executor
    participant SF as singleflight.Group
    participant Prov as WorkdirProvisioner
    participant Src as SourceAutoProvision
    participant WD as ProvWorkdir
    participant TF as Terraform Runner

    Caller->>Exec: request outputs/state for component
    Exec->>SF: Do(key = stack\0component)
    alt leader
        SF->>Prov: Provision(ctx, atmosConfig, componentConfig, authCtx)
        Prov->>Src: AutoProvisionSource (if component has source)
        Src-->>Prov: hydrated source files
        Prov->>WD: ProvisionWorkdir (copy/sync to .workdir)
        WD-->>Prov: workdir path (or error)
        Prov-->>SF: result (success + reprovision flag) or error
    else waiter
        SF-->>Exec: wait for leader result (or return ctx.Err())
    end
    Exec->>TF: terraform init / terraform output (using selected workdir)
    TF-->>Exec: outputs/state (or error)
    Exec-->>Caller: resolved outputs/state (or propagated error)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested labels

minor

Suggested reviewers

  • aknysh
  • osterman
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 60.29% 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 main changes: resolving JIT workdir paths for terraform.state, terraform.output, and atmos.Component functions.
Linked Issues check ✅ Passed The PR fully addresses #2167 by resolving JIT workdir paths for cross-component output resolution, supporting both !terraform.state and !terraform.output with auto-provisioning, and ensuring workdir paths remain within BasePath.
Out of Scope Changes check ✅ Passed All changes align with fixing JIT workdir path resolution. Minor scope additions include UI spinner clearing, go.mod dependency promotion, and snapshot updates—all supporting the core objective.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@internal/terraform_backend/terraform_backend_local_test.go`:
- Around line 236-237: The inline comments near the BuildPath example and the
workspace example (the lines showing "BuildPath(\"tempDir\", \"terraform\",
\"null-label\", \"demo\", sections) →
tempDir/.workdir/terraform/demo-null-label" and "workspace \"demo\" →
terraform.tfstate.d/demo/terraform.tfstate") are missing trailing periods;
update those comment lines (and the other flagged comment lines around the same
block: the ones at the same examples referenced in the diff and at lines flagged
252, 282, 284) to end with a period so they satisfy the godot linter requirement
for comments ending with a period.

In `@internal/terraform_backend/terraform_backend_local.go`:
- Line 33: The code currently takes only the stamped _workdir_path
(componentPath from resolveLocalBackendComponentPath) and returns early if the
state is missing, but per the documented fallback order
ReadTerraformBackendLocal should try three candidates: 1) stamped _workdir_path,
2) derived workdir (from deriveWorkdir or similar logic that uses atmosConfig
and componentSections), and 3) the static fallback path; update the logic in
ReadTerraformBackendLocal to build a candidate list with componentPath first,
then the derived workdir, then the static fallback, and iterate over candidates:
for each candidate check for the state file and return the found backend; only
return nil after all candidates are tried. Make sure to keep
resolveLocalBackendComponentPath/componentPath as the first candidate and
reference the existing derive/construct functions used for the other two paths
so no new path-building logic is duplicated.

In `@tests/fixtures/scenarios/terraform-state-jit-workdir/atmos.yaml`:
- Around line 19-20: The fixture hardcodes a Unix-only log sink by setting
logs.file: "/dev/stderr" in atmos.yaml; remove the logs.file entry (leave just
the logs block or omit logs entirely) so the scenario uses the default portable
logger instead of a platform-specific path. Update the atmos.yaml fixture to
drop the logs.file key (or replace it with a platform-agnostic setting) so tests
run on Windows, macOS, and Linux.

In `@tests/yaml_func_terraform_state_jit_test.go`:
- Around line 29-30: The two inline comment lines "// consumer has: vars.foo:
!terraform.state producer test foo" and "// This resolves producer's state file
from .workdir/terraform/test-producer/" must be terminated with periods to
satisfy the godot linter; update those comment strings so each ends with a
period (e.g., add a trailing "." to the first comment and ensure the second
already ends with one).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: c5200d3f-0a88-45cc-abd0-3256a9e77b2d

📥 Commits

Reviewing files that changed from the base of the PR and between 3c0e748 and 900d0a9.

⛔ Files ignored due to path filters (1)
  • tests/fixtures/scenarios/terraform-state-jit-workdir/.workdir/terraform/test-producer/terraform.tfstate.d/test-producer/terraform.tfstate is excluded by !**/*.tfstate
📒 Files selected for processing (6)
  • internal/terraform_backend/terraform_backend_local.go
  • internal/terraform_backend/terraform_backend_local_test.go
  • tests/fixtures/scenarios/terraform-state-jit-workdir/atmos.yaml
  • tests/fixtures/scenarios/terraform-state-jit-workdir/components/terraform/mock/main.tf
  • tests/fixtures/scenarios/terraform-state-jit-workdir/stacks/deploy/test.yaml
  • tests/yaml_func_terraform_state_jit_test.go

@zack-is-cool zack-is-cool changed the title fix: resolve JIT workdir path in !terraform.state local backend WIP: fix: describe/list affected and workdirs!terraform.state backend.tf.json: ... no such file or directory Apr 15, 2026
@mergify mergify Bot added the wip Work in Progress: Not ready for final review or merge label Apr 15, 2026
Extract workdir provisioning, output processing, utility helpers, and runner
methods from executor.go into dedicated files; executor.go now sits at 563 lines.
…lt in local backend

Adds a path-traversal guard that rejects _workdir_path values escaping
BasePath (falling through to the BuildPath-derived path), and absolutizes
the BuildPath result so CWD-relative BasePath values work correctly.
Replace the LoadOrStore-sentinel-before-provision pattern with
singleflight.Group so concurrent goroutines block until the single
in-flight Provision call completes, eliminating the window where a
racing goroutine could proceed to terraform init on an incomplete
workdir during parallel atmos describe stacks runs.
…concurrent test

Replace time.Sleep-based goroutine synchronization in TestEnsureWorkdirProvisioned_ConcurrentCallsBlockUntilComplete with an atomic entered counter so the gate releases only after the leader is confirmed inside Provision. Add comment at the config.InitRunReconfigure mutation site explaining that only the leading goroutine's config is updated by design.
@github-actions github-actions Bot added size/l Large size PR and removed size/m Medium size PR labels Apr 15, 2026
@zack-is-cool
zack-is-cool marked this pull request as ready for review April 16, 2026 18:29
@zack-is-cool

Copy link
Copy Markdown
Contributor Author

CodeRabbit (@coderabbitai)

Review pls

@coderabbitai

coderabbitai Bot commented Apr 16, 2026

Copy link
Copy Markdown
Contributor

@zack-is-cool On it — triggering a review of PR #2328 now.


🧠 Learnings used
Learnt from: aknysh
Repo: cloudposse/atmos PR: 2215
File: pkg/config/config.go:250-252
Timestamp: 2026-03-18T14:35:09.584Z
Learning: In cloudposse/atmos `pkg/config/config.go`, bare relative paths (e.g., "stacks", "foo/bar") are source-independent per PRD FR4: they always go through git root search regardless of whether the source is config-file, env var (ATMOS_BASE_PATH), or CLI flag (--base-path). Git root takes priority when both <git-root>/<path> and <cwd>/<path> exist. This is intentional — the same bare value should resolve to the same location regardless of where it was specified. The `os.Stat` fallback in `tryResolveWithGitRoot` handles cases where the git-root path doesn't exist. Users who want explicit CWD-relative behavior must use a dot-prefix (e.g., `./stacks` instead of `stacks`). Do not flag this as a bug in code reviews.
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@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: 5

🧹 Nitpick comments (1)
pkg/provisioner/source/vendor.go (1)

57-81: Harden temp staging path handling.

Removing the reserved temp directory before reuse weakens path ownership guarantees. Prefer creating a private temp root and passing a non-existent child path to the downloader.

♻️ Safer staging-path pattern
- tempDir, err := os.MkdirTemp("", "atmos-source-*")
+ tempRoot, err := os.MkdirTemp("", "atmos-source-*")
  if err != nil {
    return errUtils.Build(errUtils.ErrCreateTempDir).
      WithCause(err).
      WithExplanation("Failed to create temporary directory for download").
      Err()
  }
- // Remove the empty directory so go-getter can create it as a symlink (for
- // file:// URIs) or recreate it as a real directory (for remote URIs).
- if removeErr := os.Remove(tempDir); removeErr != nil && !os.IsNotExist(removeErr) {
-   return errUtils.Build(errUtils.ErrCreateTempDir).
-     WithCause(removeErr).
-     WithExplanation("Failed to prepare temporary directory for download").
-     Err()
- }
- defer os.RemoveAll(tempDir)
+ defer os.RemoveAll(tempRoot)
+ tempDir := filepath.Join(tempRoot, "fetch-dst") // must not exist for file:// symlink behavior.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pkg/provisioner/source/vendor.go` around lines 57 - 81, The current code
calls os.MkdirTemp to reserve tempDir then immediately removes it (using
os.Remove) which loses ownership guarantees; instead create a private temp root
(e.g., tmpRoot := os.MkdirTemp("", "atmos-source-root-*") ), keep that
directory, and pass a non-existent child path inside it (e.g., stagingPath :=
filepath.Join(tmpRoot, "staging-"+uuid) or similar) to the downloader so
go-getter can create the child (symlink or directory) without deleting the
reserved root; ensure error handling cleans up tmpRoot on failures and replace
references to tempDir and the os.Remove/removeErr logic with this tmpRoot +
non-existent child pattern, updating any subsequent cleanup and
vendor.CopyToTarget usage to operate from the child path.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@internal/terraform_backend/terraform_backend_local_test.go`:
- Around line 484-495: The test currently allows a nil fallback read which masks
a broken fallback; update the subtest using tb.ReadTerraformBackendLocal(config,
&sections, nil) to require that content is non-nil (use require.NotNil(t,
content) or equivalent) before calling tb.ProcessTerraformStateFile, then parse
and assert the resulting map contains id == "eg-test-demo" (use require.NoError
on ProcessTerraformStateFile and assert.Equal on result["id"]). Reference
ReadTerraformBackendLocal, tb.ProcessTerraformStateFile, config and sections
when locating where to tighten the assertion.

In `@internal/terraform_backend/terraform_backend_local.go`:
- Around line 118-127: The code currently returns workdirPath when
filepath.Abs(atmosConfig.BasePath) fails, allowing an unvalidated derived path
to be used; instead, modify the block around filepath.Abs(atmosConfig.BasePath)
so that on errBase != nil you do NOT return workdirPath but fall through to the
static path logic (i.e., remove the early return), and log the absolutization
error (including errBase) with context (e.g., using log.Debug or log.Error) so
ReadTerraformBackendLocal does not trust an unverifiable workdirPath derived
from atmosConfig.BasePath.

In `@pkg/terraform/output/config_test.go`:
- Around line 439-440: The tests in pkg/terraform/output/config_test.go compare
OS paths against hardcoded POSIX-style literals (e.g., the variable path vs
"components/terraform" and the POSIX absolute path around lines 448-449); update
the assertions to be platform-safe by normalizing both sides with filepath.Clean
and converting separators (use filepath.ToSlash or filepath.FromSlash
consistently) or construct expected paths with filepath.Join/filepath.Abs so
comparisons don't depend on '/' separators; specifically change the
assert.NotContains(t, path, "components/terraform", ...) to compare
filepath.ToSlash(filepath.Clean(path)) against "components/terraform" (or build
expected via filepath.Join("components","terraform")), and replace the hardcoded
POSIX absolute path fixture with one built via filepath.Join and filepath.Abs
(or filepath.FromSlash) so the test passes on Windows, macOS, and Linux.

In `@pkg/terraform/output/executor_output.go`:
- Line 75: Replace the dynamic fmt.Errorf(...) return with the repository's
static sentinel error from errors/errors.go: wrap that sentinel (e.g.,
errors.ErrEvaluateOutput or the appropriate sentinel defined in
errors/errors.go) and attach the errContext as structured context/hint (using
the project's error helper such as errors.WithHint/WithContext/Wrap*). Locate
the return that currently does "return nil, false, fmt.Errorf(\"failed to
evaluate %s: %w\", errContext, err)" in executor_output.go and change it to
return the sentinel wrapped with the original err (as the cause) and include
errContext via the project's structured hint API so the error uses the static
sentinel while preserving the underlying error and context.
- Around line 33-35: The current debug log in executor_output.go includes a
summarized output value via summarizeValue(s) which can leak secrets; remove the
value_summary argument from the log.Debug call and instead log only structural
metadata (e.g., the output key, its data type from reflect.TypeOf(s) or a helper
like inferType(s), and the size/length of the payload via len/size helper).
Update the log invocation near summarizeValue(s) and any related variable
(summarizeValue) usage so logs contain only key, type, and size, not the value
or its summary.

---

Nitpick comments:
In `@pkg/provisioner/source/vendor.go`:
- Around line 57-81: The current code calls os.MkdirTemp to reserve tempDir then
immediately removes it (using os.Remove) which loses ownership guarantees;
instead create a private temp root (e.g., tmpRoot := os.MkdirTemp("",
"atmos-source-root-*") ), keep that directory, and pass a non-existent child
path inside it (e.g., stagingPath := filepath.Join(tmpRoot, "staging-"+uuid) or
similar) to the downloader so go-getter can create the child (symlink or
directory) without deleting the reserved root; ensure error handling cleans up
tmpRoot on failures and replace references to tempDir and the
os.Remove/removeErr logic with this tmpRoot + non-existent child pattern,
updating any subsequent cleanup and vendor.CopyToTarget usage to operate from
the child path.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: ef4c69b3-e830-4c4e-97c0-6781ac1fd306

📥 Commits

Reviewing files that changed from the base of the PR and between 900d0a9 and a5e01dd.

📒 Files selected for processing (32)
  • go.mod
  • internal/terraform_backend/terraform_backend_local.go
  • internal/terraform_backend/terraform_backend_local_test.go
  • pkg/config/load.go
  • pkg/config/load_config_args.go
  • pkg/config/load_test.go
  • pkg/provisioner/source/provision_hook.go
  • pkg/provisioner/source/vendor.go
  • pkg/provisioner/workdir/workdir.go
  • pkg/schema/schema.go
  • pkg/terraform/output/config.go
  • pkg/terraform/output/config_test.go
  • pkg/terraform/output/executor.go
  • pkg/terraform/output/executor_output.go
  • pkg/terraform/output/executor_runner.go
  • pkg/terraform/output/executor_test.go
  • pkg/terraform/output/executor_utils.go
  • pkg/terraform/output/executor_workdir.go
  • pkg/terraform/output/mock_executor_test.go
  • tests/fixtures/scenarios/terraform-output-jit-workdir/.gitignore
  • tests/fixtures/scenarios/terraform-output-jit-workdir/atmos.yaml
  • tests/fixtures/scenarios/terraform-output-jit-workdir/components/terraform/mock/main.tf
  • tests/fixtures/scenarios/terraform-output-jit-workdir/source-modules/mock-alt/main.tf
  • tests/fixtures/scenarios/terraform-output-jit-workdir/stacks/deploy/test.yaml
  • tests/fixtures/scenarios/terraform-state-jit-workdir/atmos.yaml
  • tests/fixtures/scenarios/terraform-state-jit-workdir/stacks/deploy/test.yaml
  • tests/preconditions.go
  • tests/yaml_func_terraform_output_jit_test.go
  • tests/yaml_func_terraform_source_jit_test.go
  • tests/yaml_func_terraform_state_jit_test.go
  • website/docs/cli/configuration/components/terraform.mdx
  • website/docs/cli/environment-variables.mdx
✅ Files skipped from review due to trivial changes (9)
  • tests/fixtures/scenarios/terraform-output-jit-workdir/.gitignore
  • tests/fixtures/scenarios/terraform-output-jit-workdir/components/terraform/mock/main.tf
  • go.mod
  • tests/fixtures/scenarios/terraform-state-jit-workdir/atmos.yaml
  • tests/fixtures/scenarios/terraform-output-jit-workdir/stacks/deploy/test.yaml
  • tests/fixtures/scenarios/terraform-output-jit-workdir/atmos.yaml
  • tests/fixtures/scenarios/terraform-state-jit-workdir/stacks/deploy/test.yaml
  • website/docs/cli/environment-variables.mdx
  • tests/fixtures/scenarios/terraform-output-jit-workdir/source-modules/mock-alt/main.tf

Comment thread pkg/terraform/output/config_test.go Resolved
Comment thread pkg/terraform/output/executor_output.go Resolved
Comment thread pkg/terraform/output/executor_output.go Resolved
- Drop value_summary from debug log in processOutputs; outputs can
  contain secrets and summarizeValue truncates at 100 chars which
  still leaks short single-line secrets. Log only value_size_bytes.
- Wrap dynamic fmt.Errorf in extractYqValue with new static sentinel
  ErrEvaluateOutput per project error handling policy.
- Fix unverified derived workdir path returned when filepath.Abs on
  BasePath fails; fall through to static path instead.
- Make config_test path assertion cross-platform via filepath.ToSlash
  and replace hardcoded /tmp/mock with t.TempDir() for Windows.
- Clarify traversal-test comment explaining why nil is a valid result
  when the workspace prefix consumes a .. level.
@zack-is-cool

Copy link
Copy Markdown
Contributor Author

CodeRabbit (@coderabbitai) again plz

@coderabbitai

coderabbitai Bot commented Apr 16, 2026

Copy link
Copy Markdown
Contributor

@zack-is-cool: On it — triggering another review of PR #2328 now.


🧠 Learnings used
Learnt from: aknysh
Repo: cloudposse/atmos PR: 2215
File: pkg/config/config.go:250-252
Timestamp: 2026-03-18T14:35:09.584Z
Learning: In cloudposse/atmos `pkg/config/config.go`, bare relative paths (e.g., "stacks", "foo/bar") are source-independent per PRD FR4: they always go through git root search regardless of whether the source is config-file, env var (ATMOS_BASE_PATH), or CLI flag (--base-path). Git root takes priority when both <git-root>/<path> and <cwd>/<path> exist. This is intentional — the same bare value should resolve to the same location regardless of where it was specified. The `os.Stat` fallback in `tryResolveWithGitRoot` handles cases where the git-root path doesn't exist. Users who want explicit CWD-relative behavior must use a dot-prefix (e.g., `./stacks` instead of `stacks`). Do not flag this as a bug in code reviews.

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

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@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

🧹 Nitpick comments (3)
internal/terraform_backend/terraform_backend_local_test.go (1)

423-426: Prefer t.Chdir over os.Chdir + deferred restore.

Atmos's extended *testing.T provides t.Chdir(), which handles restoration automatically and is used consistently across the repo. Safer against panic paths and a bit tidier.

🔧 Proposed refactor
-		// Change CWD to tempDir so relative BasePath "." resolves there.
-		origDir, err := os.Getwd()
-		require.NoError(t, err)
-		require.NoError(t, os.Chdir(tempDir))
-		defer func() { _ = os.Chdir(origDir) }()
+		// Change CWD to tempDir so relative BasePath "." resolves there.
+		t.Chdir(tempDir)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@internal/terraform_backend/terraform_backend_local_test.go` around lines 423
- 426, Replace the manual working-directory swap using os.Getwd(),
os.Chdir(tempDir), and the deferred restore with the testing helper
t.Chdir(tempDir); specifically remove the origDir variable, the
require.NoError(t, os.Chdir(tempDir)) call and the deferred func that restores
the directory, and call t.Chdir(tempDir) instead so the extended *testing.T
implementation handles restoration and panic-safe cleanup for this test.
internal/terraform_backend/terraform_backend_local.go (2)

101-112: Nit: atmos_component is resolved twice.

getAtmosComponentInstanceFromSections extracts atmos_component (falling back to GetTerraformComponent), then provWorkdir.BuildPath independently re-reads atmos_component from the same map and overrides the passed component when present. The net behavior is correct but the double-lookup is a little confusing — a future refactor to BuildPath could silently change semantics here. Optional: pass the base component name and let BuildPath own the atmos_component override entirely, or skip the local helper and let BuildPath do the resolution.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@internal/terraform_backend/terraform_backend_local.go` around lines 101 -
112, The code resolves atmos_component twice: once via
getAtmosComponentInstanceFromSections(sections) and again inside
provWorkdir.BuildPath, which can lead to confusing/fragile semantics; fix by
choosing one source of truth — either pass the base component name through and
let BuildPath perform any atmos_component override (change the call to
provWorkdir.BuildPath to pass the original base component instead of a resolved
one), or remove the secondary lookup in BuildPath and trust the component
returned by getAtmosComponentInstanceFromSections; update the implementation of
either getAtmosComponentInstanceFromSections or provWorkdir.BuildPath (and any
callers) so only a single lookup (using the atmos_component key or
GetTerraformComponent fallback) determines the component.

91-92: Windows path containment check is case-sensitive; consider using filepath.Rel for case-insensitive comparison.

Lines 92 and 121 use strings.HasPrefix(absPath, absBase+sep) which is case-sensitive. On Windows, if absBase and absPath differ in drive letter or directory casing (e.g., C:\Project vs c:\project\...), the check fails despite the paths being equivalent. Although filepath.Abs is used to resolve paths, it doesn't normalize case on Windows.

Use filepath.Rel(absBase, absPath) and check that the result doesn't start with ".." or "..\"—filepath.Rel internally uses case-insensitive comparison on Windows via filepath.sameWord.

Note: Existing tests verify path traversal rejection but don't cover Windows case-sensitivity scenarios.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@internal/terraform_backend/terraform_backend_local.go` around lines 91 - 92,
The current containment check using strings.HasPrefix(absP, absBase+sep) (and
the absP == absBase special-case) is case-sensitive and can fail on Windows;
replace these checks with filepath.Rel(absBase, absP) and ensure the returned
relative path does not start with ".." (or is exactly "..") to determine
containment, treating equality when Rel returns "." as inside; do the same
replacement for the second occurrence around line 121 so both uses of
absP/absBase use filepath.Rel instead of strings.HasPrefix/sep.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@internal/terraform_backend/terraform_backend_local_test.go`:
- Line 347: The inline comment for the map entry keyed by "_workdir_path" in
terraform_backend_local_test.go is missing a trailing period; update the comment
after workdirPath (the comment currently reads "explicit path set by
provisioner") to end with a period ("explicit path set by provisioner.") so it
complies with the godot linter; locate the map literal containing
"_workdir_path" and adjust that comment accordingly.

---

Nitpick comments:
In `@internal/terraform_backend/terraform_backend_local_test.go`:
- Around line 423-426: Replace the manual working-directory swap using
os.Getwd(), os.Chdir(tempDir), and the deferred restore with the testing helper
t.Chdir(tempDir); specifically remove the origDir variable, the
require.NoError(t, os.Chdir(tempDir)) call and the deferred func that restores
the directory, and call t.Chdir(tempDir) instead so the extended *testing.T
implementation handles restoration and panic-safe cleanup for this test.

In `@internal/terraform_backend/terraform_backend_local.go`:
- Around line 101-112: The code resolves atmos_component twice: once via
getAtmosComponentInstanceFromSections(sections) and again inside
provWorkdir.BuildPath, which can lead to confusing/fragile semantics; fix by
choosing one source of truth — either pass the base component name through and
let BuildPath perform any atmos_component override (change the call to
provWorkdir.BuildPath to pass the original base component instead of a resolved
one), or remove the secondary lookup in BuildPath and trust the component
returned by getAtmosComponentInstanceFromSections; update the implementation of
either getAtmosComponentInstanceFromSections or provWorkdir.BuildPath (and any
callers) so only a single lookup (using the atmos_component key or
GetTerraformComponent fallback) determines the component.
- Around line 91-92: The current containment check using strings.HasPrefix(absP,
absBase+sep) (and the absP == absBase special-case) is case-sensitive and can
fail on Windows; replace these checks with filepath.Rel(absBase, absP) and
ensure the returned relative path does not start with ".." (or is exactly "..")
to determine containment, treating equality when Rel returns "." as inside; do
the same replacement for the second occurrence around line 121 so both uses of
absP/absBase use filepath.Rel instead of strings.HasPrefix/sep.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 2b2e8a93-b7cb-4558-a87e-a102fa9fa24e

📥 Commits

Reviewing files that changed from the base of the PR and between a5e01dd and d368c2d.

📒 Files selected for processing (5)
  • errors/errors.go
  • internal/terraform_backend/terraform_backend_local.go
  • internal/terraform_backend/terraform_backend_local_test.go
  • pkg/terraform/output/config_test.go
  • pkg/terraform/output/executor_output.go
✅ Files skipped from review due to trivial changes (2)
  • errors/errors.go
  • pkg/terraform/output/config_test.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • pkg/terraform/output/executor_output.go

Address CodeRabbit review feedback at line 347.
coderabbitai[bot]
coderabbitai Bot previously approved these changes Apr 16, 2026
@osterman Erik Osterman (Cloud Posse) (osterman) added the patch A minor, backward compatible change label Apr 16, 2026
The new auto_provision_workdir_for_outputs config field (added in
previous commits on this branch) is surfaced by describe config and
describe component commands. Regenerate affected snapshots so CI
acceptance tests pass.

Environmental noise (pager, github_token, OS/arch) in the regenerated
output is normalized by existing sanitize/diff rules in the test cases.
coderabbitai[bot]
coderabbitai Bot previously approved these changes Apr 16, 2026
Two related CI fixes:

1. Golden snapshots regenerated without GITLAB_TOKEN in environment.
   The previous regeneration (084daca) was run with GITLAB_TOKEN set,
   which baked "<MASKED>" into the committed snapshots. CI does not set
   GITLAB_TOKEN, so its output contained empty strings — mismatching the
   committed golden. Regenerating with GITLAB_TOKEN unset aligns the
   snapshots with the CI environment. The secrets-masking snapshot is
   also updated to include the new auto_provision_workdir_for_outputs
   field.

2. tests/yaml_func_terraform_source_jit_test.go built file:// URIs as
   "file://" + slashified-abs-path. On Unix this produced three-slash
   URIs (file:///tmp/...), which go-getter accepts. On Windows the
   slashified drive path starts with "D:/" so the result was
   "file://D:/..." — two slashes with "D:" parsed as host, breaking
   the FileGetter on Windows CI. Introduce a toFileURI helper that
   always prefixes a leading slash before the path, yielding the
   RFC 8089 form (file:///D:/... on Windows, file:///tmp/... on Unix).
@codecov

codecov Bot commented Apr 17, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 87.80488% with 30 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.29%. Comparing base (3b36553) to head (4621211).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...ernal/terraform_backend/terraform_backend_local.go 76.74% 8 Missing and 2 partials ⚠️
pkg/provisioner/source/vendor.go 0.00% 4 Missing and 1 partial ⚠️
tests/preconditions.go 50.00% 2 Missing and 2 partials ⚠️
pkg/terraform/output/executor_utils.go 92.30% 2 Missing and 1 partial ⚠️
pkg/provisioner/source/provision_hook.go 0.00% 1 Missing and 1 partial ⚠️
pkg/terraform/output/config.go 83.33% 2 Missing ⚠️
pkg/terraform/output/executor_output.go 96.00% 1 Missing and 1 partial ⚠️
pkg/terraform/output/executor_workdir.go 95.34% 1 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##             main    #2328    +/-   ##
========================================
  Coverage   77.28%   77.29%            
========================================
  Files        1080     1084     +4     
  Lines      102239   102358   +119     
========================================
+ Hits        79019    79119   +100     
- Misses      18868    18879    +11     
- Partials     4352     4360     +8     
Flag Coverage Δ
unittests 77.29% <87.80%> (+<0.01%) ⬆️

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% <ø> (ø)
pkg/config/load.go 81.55% <100.00%> (+0.05%) ⬆️
pkg/config/load_config_args.go 91.91% <100.00%> (+0.08%) ⬆️
pkg/provisioner/workdir/workdir.go 97.32% <100.00%> (+0.05%) ⬆️
pkg/schema/schema.go 87.70% <ø> (ø)
pkg/terraform/output/executor.go 86.69% <100.00%> (-2.91%) ⬇️
pkg/terraform/output/executor_runner.go 100.00% <100.00%> (ø)
pkg/provisioner/source/provision_hook.go 85.51% <0.00%> (-0.81%) ⬇️
pkg/terraform/output/config.go 92.43% <83.33%> (+1.52%) ⬆️
pkg/terraform/output/executor_output.go 96.00% <96.00%> (ø)
... and 5 more

... and 6 files with indirect coverage changes

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

@aknysh

Copy link
Copy Markdown
Member

zack-is-cool please check the Windows tests.
Ask the AI to follow CLAUDE.md

**Path handling in tests:**
- **NEVER use forward slash concatenation** like `tempDir + "/components/terraform/vpc"`
- **ALWAYS use `filepath.Join()`** with separate arguments: `filepath.Join(tempDir, "components", "terraform", "vpc")`
- **NEVER use forward slashes in `filepath.Join()`** like `filepath.Join(dir, "a/b/c")` - use `filepath.Join(dir, "a", "b", "c")`
- **NEVER hardcode Unix paths in expected values** like `assert.Equal(t, "/project/components/vpc", path)` - build expected paths with `filepath.Join()`
- **For path suffix checks**, use `filepath.ToSlash()` to normalize: `strings.HasSuffix(filepath.ToSlash(path), "expected/suffix")`
- **NEVER use bash/shell commands in tests** - use Go stdlib (`os`, `filepath`, `io`) for file operations

**Why:** Windows uses backslash (`\`) as path separator, Unix uses forward slash (`/`). Hardcoded paths fail on Windows CI.

go-getter's FileGetter creates a symlink at the destination when fetching
file:// URIs. Windows CI runners lack SeCreateSymbolicLinkPrivilege, so
the fetch fails silently (spinner suppresses non-TTY error output),
leaving the workdir directory created but unhydrated. Linux and macOS
continue to cover the underlying JIT-workdir-from-source behavior.
Real-world source URIs are remote (github.com, s3://) where go-getter
copies rather than symlinks, so production Windows usage is unaffected.

Pattern matches pkg/downloader/git_getter_test.go which already skips
symlink tests on unsupported platforms.
@zack-is-cool

Copy link
Copy Markdown
Contributor Author

zack-is-cool please check the Windows tests. Ask the AI to follow CLAUDE.md

**Path handling in tests:**
- **NEVER use forward slash concatenation** like ``tempDir + "/components/terraform/vpc"``
- **ALWAYS use ``filepath.Join()``** with separate arguments: ``filepath.Join(tempDir, "components", "terraform", "vpc")``
- **NEVER use forward slashes in ``filepath.Join()``** like ``filepath.Join(dir, "a/b/c")`` - use ``filepath.Join(dir, "a", "b", "c")``
- **NEVER hardcode Unix paths in expected values** like ``assert.Equal(t, "/project/components/vpc", path)`` - build expected paths with ``filepath.Join()``
- **For path suffix checks**, use ``filepath.ToSlash()`` to normalize: ``strings.HasSuffix(filepath.ToSlash(path), "expected/suffix")``
- **NEVER use bash/shell commands in tests** - use Go stdlib (``os``, ``filepath``, ``io``) for file operations

**Why:** Windows uses backslash (``\``) as path separator, Unix uses forward slash (``/``). Hardcoded paths fail on Windows CI.

Claude is telling me

 The product functionality works on Windows — what fails is only the test's specific setup (using a file:// URI to a local directory).       
                                                                                          
  Here's why:                                                                                                                                 
                                                                               
  - go-getter + file:// URIs → creates a symlink from the destination to the source. Windows requires SeCreateSymbolicLinkPrivilege to create 
  symlinks, which GitHub Actions Windows runners often don't grant.                       
  - go-getter + remote URIs (github.com/..., s3://..., git::...) → downloads and copies files. No symlink needed. Works fine on Windows.      
                                                                                                                                              
  Real Atmos users point source.uri at remote repos, so JIT-workdir-from-source works on Windows in production. The test happened to use      
  file:// to a fixture directory purely for hermeticity (no network), and that's what trips the symlink requirement.                          
                                                                                                                                              
  If you want Windows coverage too, the fix would be to switch the test fixture to a source type that doesn't symlink — e.g., a local .zip    
  archive via file://...zip (go-getter extracts archives instead of symlinking), or a git-bundle. Happy to do that if you'd rather have real
  Windows coverage than a skip.        

Will try what you said to see if it picks something else up

go-getter's FileGetter creates a symlink at the destination when the
source URI points to a directory. Windows CI runners typically lack
SeCreateSymbolicLinkPrivilege, so the symlink creation fails silently
and the workdir ends up empty.

Replace the direct directory URI with a .tar.gz archive built at test
time from mock-alt/. go-getter extracts archives to real files on every
platform, restoring Windows coverage without the symlink requirement.

This also removes the runtime-based skip added in 17f20f9.
@zack-is-cool

Copy link
Copy Markdown
Contributor Author

Logic behind creating the tarball in the test

 At test time, the test reads this directory:                                                                                                
                                                                               
  tests/fixtures/scenarios/terraform-output-jit-workdir/source-modules/mock-alt/                                                              
                                                                                          
  It contains one file: main.tf (a tiny Terraform module with an extra output "source" block used as a fingerprint).                          
                                                                                          
  The test walks that directory and writes a gzipped tarball to a temp location like:                                                         
                                                                                          
  /tmp/TestTerraformOutputJITWorkdirFromSource.../source.tar.gz                                                                               
                                                                                          
  The tarball contains just main.tf. The temp dir is auto-cleaned when the test ends.                                                         
                                                                                          
  How it's used                                                                                                                               
                                                                                          
  1. The test sets env var ATMOS_SOURCE_DIR=file:///tmp/.../source.tar.gz.                                                                    
  2. The stack file tests/fixtures/scenarios/terraform-output-jit-workdir/stacks/deploy/test.yaml has:
  producer-from-source:                                                                                                                       
    source:                                                                               
      uri: '{{ env "ATMOS_SOURCE_DIR" }}'                                                                                                     
    provision:                                                                                                                                
      workdir:                                  
        enabled: true                                                                                                                         
  2. That template resolves to the tarball URI at runtime.                                                                                    
  3. The test wipes any prior workdir at tests/fixtures/scenarios/terraform-output-jit-workdir/.workdir/terraform/test-producer-from-source/. 
  4. It calls ExecuteDescribeComponent for consumer-from-source, which has vars.foo: !terraform.output producer-from-source test foo.         
  5. Resolving that output triggers Atmos's auto-provision: it fetches producer-from-source's source (the tarball), extracts it into the      
  workdir, then runs terraform init/output.                                                                                                   
                                                                                                                                              
  What's asserted                                                                                                                             
                                                                                          
  - The workdir directory now exists at .workdir/terraform/test-producer-from-source/.                                                        
  - .workdir/terraform/test-producer-from-source/main.tf exists and contains the string output "source" — proving the content came from
  source-modules/mock-alt/ (the fingerprint), not from the regular components/terraform/ directory.                                           
                                                                                          
  Why tarball vs. pointing directly at the directory                                                                                          
                                                                                          
  go-getter has two code paths for file:// sources: directories get symlinked (fast, but needs symlink privilege), archives get extracted as  
  real files. Windows CI runners don't have symlink privilege, so the directory path failed silently there. The tarball forces the extract
  path, which works everywhere.                                                               

@aknysh

Copy link
Copy Markdown
Member

zack-is-cool please resolve the conflicts

@aknysh
Andriy Knysh (aknysh) merged commit df4beff into cloudposse:main Apr 20, 2026
58 of 59 checks passed
@atmos-pro

atmos-pro Bot commented Apr 20, 2026

Copy link
Copy Markdown
Contributor

Note

Atmos Pro  

Waiting for your GitHub Actions workflow to upload affected stacks.
Learn More.

@github-actions

Copy link
Copy Markdown

These changes were released in v1.216.0-rc.2.

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/l Large size PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Describe/list affected fails for vendored components in temp repo

3 participants