-
-
Notifications
You must be signed in to change notification settings - Fork 5
feat(engines): add suga properties for platform properties. #137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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