Skip to content

Fix sample stacks/deploy/dev.yaml in add-another-component.mdx so atmos terraform apply works#1434

Merged
aknysh merged 1 commit intocloudposse:mainfrom
canuck3141:patch-1
Sep 2, 2025
Merged

Fix sample stacks/deploy/dev.yaml in add-another-component.mdx so atmos terraform apply works#1434
aknysh merged 1 commit intocloudposse:mainfrom
canuck3141:patch-1

Conversation

@canuck3141
Copy link
Contributor

@canuck3141 canuck3141 commented Aug 30, 2025

Fixed errors in sample stacks/deploy/dev.yaml listed in Atmos Quick Start, Extra Credit - Deploy Another App so that atmos terraform apply station/1 -s dev works without error.

what

  • Altered sample stacks/deploy/dev.yaml to correct three errors:
    • Fixed indentation of station/1: and station/2: under parent terraform:.
    • Fixed indentation of component: and inherits: under their respective metadata: parents.
    • Added vars: stage: dev at top

The 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.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' (e.g. 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.

references

Atmos Quick Start, Extra Credit - Deploy Another App

Summary by CodeRabbit

  • Documentation
    • Updated quick-start example to include a top-level stage variable (stage: dev) for clarity.
    • Clarified Terraform component structure by nesting components explicitly and separating vars, improving readability.
    • Demonstrated station/1 and station/2 configurations with shared inheritance and distinct names, preserving existing behavior.
    • Normalized YAML formatting for consistency while keeping semantics unchanged.
    • Retained notes explaining station/1 and station/2 naming to aid understanding.

…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.
@canuck3141 canuck3141 requested a review from a team as a code owner August 30, 2025 00:35
@mergify mergify bot added the triage Needs triage label Aug 30, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 30, 2025

📝 Walkthrough

Walkthrough

Updates 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

Cohort / File(s) Summary of Changes
Docs: quick-start extra-credit
website/docs/quick-start/simple/extra-credit/add-another-component.mdx
Revised YAML snippet: added top-level vars: { stage: dev }; restructured components: terraform entries so station/1 and station/2 use metadata: { component: weather, inherits: [station] } with separate vars containing distinct names; preserved surrounding explanatory text.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

Suggested labels

no-release

Suggested reviewers

  • hans-d
  • kevcube
  • aknysh

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
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary or @auto-summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai or @auto-title anywhere in the PR title to generate the title automatically.

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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)
website/docs/quick-start/simple/extra-credit/add-another-component.mdx (1)

34-47: Optional: quote slash-keys for editor/linter friendliness

YAML 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.

📥 Commits

Reviewing files that changed from the base of the PR and between 6f99b9e and d445753.

📒 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 discovery

Adding vars.stage: dev at the stack root matches the CLI -s dev/--stack dev usage and resolves the “Could not find the component 'station/1' in the stack 'dev'” lookup.


33-55: LGTM: Valid nesting under components.terraform

I couldn’t run the atmos CLI 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

@mergify mergify bot removed the triage Needs triage label Aug 30, 2025
@codecov
Copy link

codecov bot commented Aug 30, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 55.66%. Comparing base (6f99b9e) to head (d445753).
⚠️ Report is 1 commits behind head on main.

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     
Flag Coverage Δ
unittests 55.66% <ø> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@osterman osterman added the patch A minor, backward compatible change label Aug 30, 2025
@aknysh aknysh added no-release Do not create a new release (wait for additional code changes) and removed patch A minor, backward compatible change labels Sep 2, 2025
Copy link
Member

@aknysh aknysh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @canuck3141

@aknysh aknysh merged commit c5c97fb into cloudposse:main Sep 2, 2025
179 of 186 checks passed
@github-actions
Copy link

github-actions bot commented Sep 2, 2025

These changes were released in v1.189.0-test.0.

osterman added a commit that referenced this pull request Sep 2, 2025
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)
osterman pushed a commit that referenced this pull request Sep 23, 2025
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-release Do not create a new release (wait for additional code changes)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants