fix: Use atmos_component for source provisioner workdir paths#2137
fix: Use atmos_component for source provisioner workdir paths#2137
Conversation
Follow-up to PR #2093 - the source provisioner (JIT vendoring) was not updated to use atmos_component (instance name) for workdir paths. This caused workdir mismatch when metadata.component differs from the component instance name. When both source and workdir are enabled, the workdir provisioner defers to the source provisioner, which was still using extractComponentName() (base component). Changes: - determineSourceTargetDirectory(): Use atmos_component for workdir path - buildWorkdirPath(): Use atmos_component for workdir path - Add tests for atmos_component workdir path isolation This ensures JIT vendoring uses the same workdir path as terraform plan/init. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Dependency Review✅ No vulnerabilities or license issues found.Scanned FilesNone |
Extract the duplicated workdir path logic into a single exported function workdir.BuildPath() that handles atmos_component resolution. Both source provisioner code paths now call this instead of reimplementing the logic. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (6)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthroughThis PR centralizes workdir path construction by introducing a new Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~15 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
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. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2137 +/- ##
=======================================
Coverage 76.57% 76.58%
=======================================
Files 832 832
Lines 79502 79507 +5
=======================================
+ Hits 60879 60889 +10
+ Misses 14824 14821 -3
+ Partials 3799 3797 -2
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
These changes were released in v1.208.1-test.0. |
…raform-plan * osterman/native-ci-terraform: (28 commits) feat: Add source cache TTL for JIT-vendored components (#2138) feat: Per-target version overrides in vendor manifests (#2141) docs: Add PRD for browser-based auth in aws/user identity (#1887) docs: Add EKS kubeconfig authentication integration PRD (#1884) fix: correct marketplace.json schema and update docs with install/uninstall commands (#2142) fix: propagate auth to all YAML functions in multi-component execution (#2140) fix: Use atmos_component for source provisioner workdir paths (#2137) Fix identity prompts to respect --interactive flag (#2130) Increase PR size thresholds to accommodate AI-assisted development (#2136) docs: Add Azure authentication provider documentation (#2132) fix: propagate component-type level dependencies through stack processor (#2127) fix: Add retry and missing workflow step properties to all schema copies (#2113) Exclude unsupported windows/arm from goreleaser build matrix (#2133) Add AI Agent Skills for LLM-Powered Infrastructure Development (#2121) Fix: Convert toolchain paths to absolute in PATH to resolve exec.LookPath failures (#2095) Fix workdir collision for component instances sharing base component (#2093) fix(auth): propagate TTY state to subprocesses for SSO device flow in workflows (#2126) fix(security): prevent SSRF in GitHub OIDC token URL handling (CWE-918) (#2106) Fix #2112: add workflow_retry definition and retry property to workflow step schema (#2114) fix(auth): auto-detect GitHub Actions WIF with proper audience, host validation, and lazy GSM init (#2109) ...
|
These changes were released in v1.208.1-test.9. |
what
atmos_component(instance name) for workdir paths, matching the fix from PR Fix workdir collision for component instances sharing base component #2093metadata.componentdiffers from the component instance name (e.g., instancedemo-cluster-codepipeline-iacinheriting from basedemo-cluster-codepipeline), bothsource pullandterraform plan/initnow create the same workdir directorydetermineSourceTargetDirectory()andbuildWorkdirPath()to check foratmos_componentbefore falling back to the passed component nameatmos_componentworkdir isolation casewhy
This is a follow-up to PR #2093 which fixed workdir collision for parallel component instances. However, that PR only updated the workdir provisioner. When both source and workdir are enabled, the workdir provisioner defers to the source provisioner (
AutoProvisionSource), which was still usingextractComponentName()that returns the base component name. This caused JIT vendoring to write source code to a different workdir path than terraform plan/init expects, breaking the fix.references
Closes #2134
Follows PR #2093 (fix for issue #2091)
Summary by CodeRabbit
Refactor
Tests