feat(engines): add suga properties for platform properties.#137
feat(engines): add suga properties for platform properties.#137
Conversation
📝 WalkthroughWalkthroughThis PR extends the Terraform deployment engine with a new "suga" token source. It introduces a Possibly related PRs
Suggested reviewers
Pre-merge checks❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
engines/terraform/resolve.go (1)
127-145: Clean implementation of suga property resolution.The implementation correctly validates path components, provides helpful error messages listing available properties, and explicitly disallows nested access. The pattern is consistent with other token sources.
Consider adding a brief comment above the case explaining what suga properties are and their intended use (e.g., "platform-provided properties like stack_id for resource naming"). This would help future maintainers understand the purpose.
+ // suga properties are platform-provided values (e.g., stack_id) used for resource naming and configuration case "suga": if len(specRef.Path) < 1 {
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
engines/terraform/deployment.go(2 hunks)engines/terraform/resolve.go(1 hunks)engines/terraform/token.go(1 hunks)
🔇 Additional comments (2)
engines/terraform/token.go (1)
48-49: LGTM - regex patterns updated correctly.Both patterns consistently include "suga" in the alternation group, enabling token recognition for suga.* references.
engines/terraform/deployment.go (1)
31-31: Good foundation for suga properties.The field and initialization are implemented correctly. The map is properly initialized in the constructor with
stack_id, preventing nil access issues. The use ofstackId.Result()provides a token reference that will resolve during Terraform synthesis.Also applies to: 64-66
A proposal for exposing additional suga properties to the platform editor.
e.g.
"name": "${suga.stack_id}-vpc"using the stack id for unique naming