Skip to content

Fix atmos terraform output JSON flag for 1.210.0+#81

Merged
goruha merged 3 commits intomainfrom
fix/atmos-json-flag
Apr 1, 2026
Merged

Fix atmos terraform output JSON flag for 1.210.0+#81
goruha merged 3 commits intomainfrom
fix/atmos-json-flag

Conversation

@Benbentwo
Copy link
Copy Markdown
Member

@Benbentwo Benbentwo commented Mar 20, 2026

Summary

  • Change --json to -json in OutputJsonE() so the flag is passed through to Terraform correctly
  • Atmos 1.210.0+ no longer recognizes --json as an atmos-level flag; -json is the native Terraform flag
  • Add compatibility note to README.yaml

Test plan

  • go build ./... passes
  • go vet ./... passes
  • Verify atmos terraform output <component> --skip-init -s <stack> -- -json <key> works with atmos 1.210.0+

🤖 Generated with Claude Code

Change `--json` to `-json` in OutputJsonE() so the flag is passed
through to Terraform correctly. Atmos 1.210.0+ no longer recognizes
`--json` as an atmos-level flag; `-json` is the native Terraform flag.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Benbentwo Benbentwo requested review from a team as code owners March 20, 2026 03:05
@Benbentwo Benbentwo requested review from Gowiem and nitrocode March 20, 2026 03:05
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 20, 2026

Walkthrough

Adds a Compatibility note to README requiring Atmos 1.210.0+ for Terraform output JSON support; updates OutputJsonE to pass the JSON flag to Terraform after a -- separator (-- --json); replaces a dedicated codeowners validation job with a reusable workflow invocation.

Changes

Cohort / File(s) Summary
Documentation
README.yaml
Added a Compatibility section requiring Atmos 1.210.0+ for Terraform output JSON support and clarified that the -json flag is passed through via atmos.
Terraform Output Handler
pkg/atmos/terraform_output.go
Adjusted Terraform CLI arguments in OutputJsonE to pass the JSON flag after a -- separator (i.e., -- --json) so Terraform receives the flag correctly.
CI Workflow
.github/workflows/validate-codeowners.yml
Replaced the in-repo validate-codeowners job with a reusable workflow call cloudposse/.../shared-codeowners.yml@main, condensed fork detection into is_fork, and switched to secrets: inherit.

Sequence Diagram(s)

mermaid
sequenceDiagram
participant Dev as Developer
participant Atmos as Atmos CLI
participant Terraform as Terraform CLI
participant Runner as Process Runner
Dev->>Atmos: run atmos terraform output -json (via atmos)
Atmos->>Runner: construct args including -- --json and target key
Runner->>Terraform: exec terraform output -- --json [key]
Terraform-->>Runner: stdout (JSON)
Runner-->>Atmos: capture stdout
Atmos-->>Dev: return cleaned JSON output

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐇 I nibbled a flag and made it roam,
Pushed -- --json to find its home,
README sings the version to keep,
Terraform answers in tidy JSON sheep,
Hooray! A hop, a patch, and back to my loam. 🥕

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: fixing the Terraform output JSON flag for Atmos 1.210.0+ compatibility.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Description check ✅ Passed The pull request description accurately summarizes the changes: replacing --json with -json in OutputJsonE(), explaining the Atmos 1.210.0+ compatibility rationale, and noting the README.yaml addition.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/atmos-json-flag

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

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
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.

🧹 Nitpick comments (1)
.github/workflows/validate-codeowners.yml (1)

8-12: Refactoring to shared workflow is sound.

The consolidation of fork detection logic into a single is_fork input is clean, and delegating to the shared workflow reduces maintenance burden. The secrets: inherit pattern is appropriate.

Minor suggestion: The reusable workflow is pinned to @main. For better reproducibility and protection against breaking changes, consider pinning to a specific SHA or release tag (though this is common practice within cloudposse).

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/validate-codeowners.yml around lines 8 - 12, The workflow
currently depends on the reusable workflow reference pinned to `@main` (uses:
cloudposse/.github/.github/workflows/shared-codeowners.yml@main); change that to
a fixed immutable ref (a release tag or commit SHA) to avoid accidental breaking
changes—update the uses value for the ci-codeowners step to
cloudposse/.github/.github/workflows/shared-codeowners.yml@<release-tag-or-sha>
while keeping the is_fork input and secrets: inherit unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In @.github/workflows/validate-codeowners.yml:
- Around line 8-12: The workflow currently depends on the reusable workflow
reference pinned to `@main` (uses:
cloudposse/.github/.github/workflows/shared-codeowners.yml@main); change that to
a fixed immutable ref (a release tag or commit SHA) to avoid accidental breaking
changes—update the uses value for the ci-codeowners step to
cloudposse/.github/.github/workflows/shared-codeowners.yml@<release-tag-or-sha>
while keeping the is_fork input and secrets: inherit unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: edebce33-fafb-4f63-823d-95c3481738e2

📥 Commits

Reviewing files that changed from the base of the PR and between 61ebda8 and 7e29bf0.

📒 Files selected for processing (1)
  • .github/workflows/validate-codeowners.yml

@goruha goruha added major Breaking changes (or first stable release) labels Apr 1, 2026
@goruha goruha merged commit e679bb8 into main Apr 1, 2026
6 checks passed
@goruha goruha deleted the fix/atmos-json-flag branch April 1, 2026 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

major Breaking changes (or first stable release)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants