Enable Go templates in metadata.terraform_workspace section#823
Conversation
📝 WalkthroughWalkthroughThe pull request includes several updates across various files. The Dockerfile has been updated to change the Atmos tool version from Changes
Possibly related PRs
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (1)
internal/exec/utils.go (1)
566-569: LGTM! Consider adding error handling for workspace validation.The workspace override implementation looks good and aligns with the PR objectives. However, consider adding validation to ensure the workspace name follows Terraform's naming conventions.
if i, ok := configAndStacksInfo.ComponentSection[cfg.WorkspaceSectionName].(string); ok { + if !isValidWorkspaceName(i) { + return configAndStacksInfo, fmt.Errorf("invalid workspace name: %s", i) + } configAndStacksInfo.TerraformWorkspace = i }
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
⛔ Files ignored due to path filters (1)
go.sumis excluded by!**/*.sum
📒 Files selected for processing (7)
examples/quick-start-advanced/Dockerfile(1 hunks)examples/tests/stacks/catalog/terraform/template-functions-test2/defaults.yaml(1 hunks)go.mod(2 hunks)internal/exec/terraform.go(1 hunks)internal/exec/utils.go(1 hunks)website/docs/core-concepts/stacks/templates/templates.mdx(1 hunks)website/docs/integrations/atlantis.mdx(1 hunks)
🧰 Additional context used
📓 Learnings (1)
examples/quick-start-advanced/Dockerfile (2)
Learnt from: aknysh
PR: cloudposse/atmos#775
File: examples/quick-start-advanced/Dockerfile:9-9
Timestamp: 2024-11-12T05:52:05.088Z
Learning: It is acceptable to set `ARG ATMOS_VERSION` to a future version like `1.105.0` in `examples/quick-start-advanced/Dockerfile` if that will be the next release.
Learnt from: osterman
PR: cloudposse/atmos#801
File: examples/quick-start-advanced/Dockerfile:9-9
Timestamp: 2024-11-23T00:13:22.004Z
Learning: When updating the `ATMOS_VERSION` in Dockerfiles, the team prefers to pin to the next future version when the PR merges, even if the version is not yet released.
🔇 Additional comments (6)
internal/exec/terraform.go (1)
124-127: Variable assignments are correctly implemented
The variables varFile and planFile are appropriately assigned using helper functions.
examples/quick-start-advanced/Dockerfile (1)
9-9: ATMOS_VERSION updated in line with team practices
Updating ATMOS_VERSION to the future release 1.118.0 aligns with team preferences noted in previous learnings.
examples/tests/stacks/catalog/terraform/template-functions-test2/defaults.yaml (1)
9-9: Dynamic terraform_workspace variable is correctly defined
The use of Go templates for terraform_workspace enhances configurability.
go.mod (1)
46-46: Dependencies updated to latest versions
Updating golang.org/x/term and golang.org/x/sys ensures the module uses the latest improvements.
Also applies to: 250-250
website/docs/core-concepts/stacks/templates/templates.mdx (1)
247-247: Documentation accurately reflects new metadata support
Adding metadata to the list of sections supporting Go templates is appropriate.
website/docs/integrations/atlantis.mdx (1)
676-676: LGTM! Version update is consistent.
The Atmos version update to 1.118.0 aligns with the codebase changes.
|
These changes were released in v1.118.0. |
* updates * updates * updates * updates
what
Gotemplates inmetadata.terraform_workspaceandmetadata.terraform_workspace_templatesectionswhy
Gotemplates to dynamically construct Terraform workspaces for Atmos componentsSummary by CodeRabbit
Release Notes
New Features
metadatasection.Bug Fixes
Documentation
Chores