Fix sample stacks/deploy/dev.yaml in add-another-component.mdx so atmos terraform apply works#1434
Conversation
…os terraform apply works Without these changes, copying and pasting the sample contents of `stacks/deploy/dev.yaml` then running the command `atmos terraform apply station/1 -s dev` fails with errors like the following: 1. `Error: invalid 'components.terraform' section in the file 'deploy/dev'` (due to invalid indentation of `station/1:` under `terraform:` and invalid indentation of `component:` and `inherits:` under `metadata:`), then if these are fixed, 2. `Error: Could not find the component 'station/1' in the stack 'dev'.` (due to the missing `vars: stage: dev`) Fixing this makes the `atmos terraform apply` work.
📝 WalkthroughWalkthroughUpdates a quick-start doc example: adds a top-level YAML vars.stage: dev and restructures Terraform component entries for station/1 and station/2 to use a metadata block and separate vars blocks. Content intent and semantics remain the same. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. ✨ Finishing Touches🧪 Generate unit tests
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. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
Status, Documentation and Community
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
website/docs/quick-start/simple/extra-credit/add-another-component.mdx (1)
34-47: Optional: quote slash-keys for editor/linter friendlinessYAML allows
/in unquoted keys, but some highlighters/linters mis-tokenize them. Quoting is harmless and can reduce reader friction in docs.- station/1: + "station/1": @@ - station/2: + "station/2":Also applies to: 46-55
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
website/docs/quick-start/simple/extra-credit/add-another-component.mdx(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
website/**
📄 CodeRabbit inference engine (.cursor/rules/atmos-rules.mdc)
website/**: Update website documentation in the website/ directory when adding new features
Follow the website's documentation structure and style
Keep website code in the website/ directory
Follow the existing website architecture and style
Document new features on the website
Include examples and use cases in website documentation
Files:
website/docs/quick-start/simple/extra-credit/add-another-component.mdx
🧠 Learnings (2)
📓 Common learnings
Learnt from: Listener430
PR: cloudposse/atmos#934
File: tests/fixtures/scenarios/docs-generate/README.md.gotmpl:99-118
Timestamp: 2025-01-25T03:51:57.689Z
Learning: For the cloudposse/atmos repository, changes to template contents should be handled in dedicated PRs and are typically considered out of scope for PRs focused on other objectives.
📚 Learning: 2024-12-01T00:33:20.298Z
Learnt from: aknysh
PR: cloudposse/atmos#810
File: examples/tests/stacks/catalog/terraform/template-functions-test2/defaults.yaml:28-32
Timestamp: 2024-12-01T00:33:20.298Z
Learning: In `examples/tests/stacks/catalog/terraform/template-functions-test2/defaults.yaml`, `!exec atmos terraform output` is used in examples to demonstrate its usage, even though `!terraform.output` is the recommended approach according to the documentation.
Applied to files:
website/docs/quick-start/simple/extra-credit/add-another-component.mdx
🪛 LanguageTool
website/docs/quick-start/simple/extra-credit/add-another-component.mdx
[grammar] ~27-~27: There might be a mistake here.
Context: ...ml"> ```yaml vars: stage: dev import: # Import the baseline for all station comp...
(QB_NEW_EN)
[grammar] ~31-~31: There might be a mistake here.
Context: ...ponents - catalog/station components: terraform: # Atmos component `statio...
(QB_NEW_EN)
[grammar] ~32-~32: There might be a mistake here.
Context: ...atalog/station components: terraform: # Atmos component station/1 statio...
(QB_NEW_EN)
[grammar] ~33-~33: There might be a mistake here.
Context: ...aform: # Atmos component station/1 station/1: metadata: # Poi...
(QB_NEW_EN)
[grammar] ~34-~34: There might be a mistake here.
Context: ...mos component station/1 station/1: metadata: # Point to the Terrafo...
(QB_NEW_EN)
[grammar] ~35-~35: There might be a mistake here.
Context: ...tation/1 station/1: metadata: # Point to the Terraform component inc...
(QB_NEW_EN)
[grammar] ~36-~36: There might be a mistake here.
Context: ...ponent in components/terraform/weather component: weather # Inherit the...
(QB_NEW_EN)
[grammar] ~37-~37: There might be a mistake here.
Context: ...form/weather` component: weather # Inherit the defaults for all station c...
(QB_NEW_EN)
[grammar] ~38-~38: There might be a mistake here.
Context: ... the defaults for all station components inherits: - station # De...
(QB_NEW_EN)
[grammar] ~39-~39: There might be a mistake here.
Context: ...all station components inherits: - station # Define/override variab...
(QB_NEW_EN)
[grammar] ~40-~40: There might be a mistake here.
Context: ...ts inherits: - station # Define/override variables specific to ...
(QB_NEW_EN)
[grammar] ~41-~41: There might be a mistake here.
Context: ...s specific to this station/1 component vars: name: station-1 # A...
(QB_NEW_EN)
[grammar] ~42-~42: There might be a mistake here.
Context: ...o this station/1 component vars: name: station-1 # Atmos component...
(QB_NEW_EN)
⏰ 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). (1)
- GitHub Check: Summary
🔇 Additional comments (2)
website/docs/quick-start/simple/extra-credit/add-another-component.mdx (2)
24-26: LGTM: stage scoping unblocks component discoveryAdding
vars.stage: devat the stack root matches the CLI-s dev/--stack devusage and resolves the “Could not find the component 'station/1' in the stack 'dev'” lookup.
33-55: LGTM: Valid nesting under components.terraformI couldn’t run the
atmosCLI here—please verify locally that the stack parses and plans succeed:atmos validate stack dev atmos describe component station/1 -s dev | sed -n '1,120p' atmos describe component station/2 -s dev | sed -n '1,120p' atmos terraform plan station/1 -s dev atmos terraform plan station/2 -s dev
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1434 +/- ##
==========================================
+ Coverage 55.61% 55.66% +0.04%
==========================================
Files 273 273
Lines 28620 28620
==========================================
+ Hits 15918 15930 +12
+ Misses 10919 10904 -15
- Partials 1783 1786 +3
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:
|
|
These changes were released in v1.189.0-test.0. |
Resolve merge conflicts and integrate latest main branch changes: ✅ **errors/errors.go**: Added ErrMerge error for improved error handling ✅ **pkg/merge/merge.go**: Updated merge logic with better error wrapping and strategy handling ✅ **pkg/merge/merge_test.go**: Enhanced tests with proper error verification ✅ **cmd/describe_stacks.go**: Updated component types handling to support multi-values ✅ **cmd/describe_stacks_test.go**: Updated tests for new describe stacks functionality ✅ **website/docs/**: Fixed sample stack configuration All conflicts resolved in favor of main branch improvements while preserving our gotcha tool implementation and documentation changes. Merged commits from main: - 5e2f1c3 fix: improve error handling and code quality in merge package (#1440) - fd1399a [describe-stacks] Fix: switch --component-types to StringSlice (#1432) - c5c97fb Fix sample stacks/deploy/dev.yaml in documentation (#1434)
…os terraform apply works (#1434) Without these changes, copying and pasting the sample contents of `stacks/deploy/dev.yaml` then running the command `atmos terraform apply station/1 -s dev` fails with errors like the following: 1. `Error: invalid 'components.terraform' section in the file 'deploy/dev'` (due to invalid indentation of `station/1:` under `terraform:` and invalid indentation of `component:` and `inherits:` under `metadata:`), then if these are fixed, 2. `Error: Could not find the component 'station/1' in the stack 'dev'.` (due to the missing `vars: stage: dev`) Fixing this makes the `atmos terraform apply` work.
Fixed errors in sample
stacks/deploy/dev.yamllisted in Atmos Quick Start, Extra Credit - Deploy Another App so thatatmos terraform apply station/1 -s devworks without error.what
stacks/deploy/dev.yamlto correct three errors:station/1:andstation/2:under parentterraform:.component:andinherits:under their respectivemetadata:parents.vars: stage: devat topThe first two changes are just indentation increases by one level to create proper nesting under their parents as YAML is indentation-sensitive for structure.
why
Without these changes, copying and pasting the sample contents of
stacks/deploy/dev.yamlthen running the commandatmos terraform apply station/1 -s devfails with errors like the following:Error: invalid 'components.terraform' section in the file 'deploy/dev'(e.g. due to invalid indentation ofstation/1:underterraform:and invalid indentation ofcomponent:andinherits:undermetadata:), then if these are fixed,Error: Could not find the component 'station/1' in the stack 'dev'.(due to the missingvars: stage: dev)Fixing this makes the
atmos terraform applywork.references
Atmos Quick Start, Extra Credit - Deploy Another App
Summary by CodeRabbit