Update stack after parsing name template in describe_stacks#1226
Update stack after parsing name template in describe_stacks#1226aknysh merged 3 commits intocloudposse:mainfrom
stack after parsing name template in describe_stacks#1226Conversation
📝 WalkthroughWalkthroughThe update introduces explicit assignments to the Changes
Suggested labels
Suggested reviewers
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. 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
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1226 +/- ##
=======================================
Coverage 32.89% 32.89%
=======================================
Files 223 223
Lines 23789 23791 +2
=======================================
+ Hits 7826 7827 +1
- Misses 14797 14798 +1
Partials 1166 1166
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
pkg/describe/describe_stacks_test.go (1)
179-194: Good addition of test for helmfile filtering.The new test case follows the established pattern and ensures that filtering helmfile components with "none" sections doesn't cause errors. This complements the fix in
internal/exec/describe_stacks.gowhere the Stack field is now properly updated.For improved robustness, consider adding specific assertions about the returned stacks structure beyond just error checking.
stacks, err := ExecuteDescribeStacks(atmosConfig, "", nil, componentTypes, sections, false, false) assert.Nil(t, err) + + // Verify at least some stacks were returned + assert.NotEmpty(t, stacks, "Should return some stacks when filtering for helmfile components") + + // Verify each stack contains only helmfile components + for stackName, stackContent := range stacks { + stack := stackContent.(map[string]any) + components := stack["components"].(map[string]any) + assert.Contains(t, components, "helmfile", "Stack %s should contain helmfile components", stackName) + }
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
pkg/describe/describe_stacks_test.go(1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
pkg/describe/describe_stacks_test.go (5)
pkg/schema/schema.go (1)
ConfigAndStacksInfo(372-442)pkg/config/config.go (1)
InitCliConfig(25-62)internal/exec/describe_stacks.go (1)
ExecuteDescribeStacks(148-691)pkg/describe/describe_stacks.go (1)
ExecuteDescribeStacks(9-19)pkg/utils/yaml_utils.go (1)
ConvertToYAML(85-91)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Summary
|
These changes were released in v1.174.0. |
what
!terraform.outputwhy
Given
!terraform.outputwill fail indescribe_stacks.gowith the following message:Note that the stack manifest referenced comes from the file name which is set when looping over stacks. As components are iterated we parse the stack
name_templateand assign it tostackName.This causes a race condition where
configAndStacksInfo.Stackwill differ betweenstackFileNameon the first iteration and the parsed stack on the second iteration.We use
configAndStacksInfo.Stackwhen processing YAML functions. An alternative change would be to use the stack from the component section, but we still probably want to fix this odd state.references
--
I've got no clue how to approach testing this in the Atmos repo, open to any guidance there!
Summary by CodeRabbit
Summary by CodeRabbit
Bug Fixes
Tests