Repository navigation
fix: name the offending component/stack in backend_type mismatch errors - #2965
Conversation
checkTerraformBackendTypeMatch and checkRemoteStateBackendTypeMatch (added alongside the manifest-schema fix in #2953) attach component/stack only via WithContext, which the CLI's default (non---verbose) error renderer drops entirely. Since these checks run during whole-repo stack processing, a mismatch anywhere blocks describe stacks/terraform plan for every other stack too -- with no way to tell which of potentially hundreds of components is actually at fault. Thread the stack-file name through terraformBackendConfig and remoteStateBackendConfig, and put both component and stack directly in the hint text so they always render, matching a real repro found live in cloudposse/infra-live: a plat/sandbox component overriding backend_type: local without a matching remote_state_backend_type broke describe stacks for a completely unrelated stack, with the printed error giving zero clue which component was the actual cause. Co-Authored-By: Claude Sonnet 5 <[email protected]>
|
Tip Atmos Pro
No affected stacks workflow was detected for this pull request. |
Dependency Review✅ No vulnerabilities or license issues found.Scanned FilesNone |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 4 included reviews per hour; 2 remain after this review. 📝 WalkthroughWalkthroughTerraform backend and remote-state processing now carries stack names into mismatch validation. Errors identify the affected component and stack. Unit tests and an end-to-end fixture cover backend-type conflicts, including inherited S3 remote state with a local backend. The parallel redirect test now uses an isolated HTTP transport. ChangesBackend mismatch diagnostics
HTTP test isolation
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to This change improves mismatch error messages and adds unit and CLI coverage; no actionable merge-blocking risk remains beyond normal checks and review. Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
…ctions race httptest.Server.Close() unconditionally calls CloseIdleConnections() on the shared http.DefaultTransport. TestGitHubAuthenticatedTransport_AllRedirectStatusCodes runs 5 parallel subtests that all wrapped that same default transport, so one subtest's server teardown could kill another's in-flight connection with "http: CloseIdleConnections called" (seen in CI shard 2/10). Give each subtest its own *http.Transport so they no longer share that global state. Co-Authored-By: Claude Sonnet 5 <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2965 +/- ##
==========================================
- Coverage 83.44% 83.44% -0.01%
==========================================
Files 1923 1923
Lines 188014 188025 +11
==========================================
- Hits 156895 156890 -5
- Misses 23207 23219 +12
- Partials 7912 7916 +4
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
Tip Atmos Pro
No affected stacks workflow was detected for this pull request. |
|
Tip Atmos Pro
No affected stacks workflow was detected for this pull request. |
|
Tip Atmos Pro
No affected stacks workflow was detected for this pull request. |
|
These changes were released in v1.226.1. |
|
These changes were released in v1.227.0-test.9. |
|
These changes were released in v1.227.0-test.10. |
what
checkTerraformBackendTypeMatch/checkRemoteStateBackendTypeMatchnow name the offending component and stack directly in the error's hint text, e.g.:TestProcessTerraformRemoteStateBackend_InheritedLocalTypeMismatch) reproducing the exact real-world shape that surfaced this, plus hint-text assertions on the existing mismatch tests.tests/fixtures/scenarios/remote-state-backend-type-mismatch/,tests/test-cases/remote-state-backend-type-mismatch.yaml) proving the fix end-to-end through the real binary.why
describe stacks/terraform planfor every other stack too, including ones totally unrelated to the misconfigured component.WithContext, which the CLI's default (non--verbose) error renderer drops entirely. The printed error gave zero indication of which of potentially hundreds of components across a repo was actually at fault.atmos describe stacks --stack core-gbl-marketplacefailed with only "remote_state_backend_type is local but remote_state_backend: only configures s3" — no component, no stack. It took manually instrumenting the binary with debug prints to discover the real cause was an unrelatedplat/sandboxcomponent (vpc-no-provider) that overridesbackend_type: localwithout a matchingremote_state_backend_type. With this fix, that same failure now reads:references
None — found and reported internally, no existing issue.
Summary by CodeRabbit