chore(cli): improves error message for missing infra resources#94
chore(cli): improves error message for missing infra resources#94
Conversation
📝 WalkthroughWalkthroughThe change updates engines/terraform/deployment.go so that when resolveInfraResource fails to find an infra resource, it builds a list of available InfraSpecs keys (using maps.Keys and slices.Collect) and returns an error that includes the missing resource name and the list of available resources. Control flow and exported/public declarations remain unchanged. Possibly related PRs
Suggested reviewers
Pre-merge checks❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
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 |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
engines/terraform/deployment.go (1)
64-68: Consider sorting available resources for consistent output.The error message improvement is excellent and actionable. However, since Go map iteration order is non-deterministic, the available resources list will vary between runs. Sorting would provide a better developer experience.
Apply this diff:
availableResources := make([]string, 0, len(td.engine.platform.InfraSpecs)) for name := range td.engine.platform.InfraSpecs { availableResources = append(availableResources, name) } + slices.Sort(availableResources) return nil, fmt.Errorf("infra resource '%s' not found in depends_on. Available resources: %v. Update the depends_on references in your platform definition", infraName, availableResources)Note:
slices.Sortis already imported at line 7.
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
engines/terraform/deployment.go(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: Build (windows-latest, amd64)
- GitHub Check: Build (macos-latest, amd64)
- GitHub Check: Test
- GitHub Check: Security Scan
|
🎉 This PR is included in version 0.1.15 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
No description provided.