Skip to content

feat(config): auto type inference + provenance/merge bug fixes - #2897

Merged
Andriy Knysh (aknysh) merged 22 commits into
mainfrom
osterman/field-test-config-commands
Aug 12, 2026
Merged

Andriy Knysh (aknysh) merged 22 commits into
mainfrom
osterman/field-test-config-commands

Conversation

@osterman

@osterman Erik Osterman (Cloud Posse) (osterman) commented Aug 6, 2026 •

Copy link
Copy Markdown
Member

what

  • atmos config set and atmos stack set now default --type to auto: infer from the Atmos config schema, then from the type of the value already at the path, falling back to a string (with a warning) only when neither source has an answer. atmos stack set previously never inferred at all — every value was stored as a string unless --type was passed explicitly.
  • Fixed PickProvenanceFile (shared by atmos stack set/get/delete/list and the AI/MCP tools layer) always picking the last provenance entry, which for any value defined only in an imported catalog file was a phantom Line:0 entry pointing at the wrong (importing) manifest instead of the file that actually defines the value.
  • Fixed MCPSettings.Enabled (a bool tagged omitempty) silently disappearing from the merged config when atmos.yaml and an atmos.d/ fragment both set it to different values, instead of the explicit value winning.
  • Fixed error hints containing a raw <placeholder> (e.g. pass --config <file>.) being silently stripped by the terminal markdown renderer, which parses unescaped angle brackets as inline HTML.
  • --config a.yaml,b.yaml on atmos config get/set/delete/format now warns that only the first file is targeted, instead of silently dropping the rest.
  • atmos config get on a key defined only in an atmos.d/ fragment now hints to check atmos describe config instead of just reporting "not found".
  • The unset alias (for config/stack delete) now shows up in --help output, alongside del.
  • Adds a blog post and roadmap entry for the type-inference change, and fixes a stale doc example that cited a non-existent config field.

why

  • A hands-on DX field-test pass of atmos config and atmos stack/atmos stack config surfaced these as real, reproducible bugs and gaps — silent type corruption, a provenance-resolution bug that broke edits for the standard catalog-import stack pattern, and a config value that could vanish entirely on merge.
  • These commands had effectively zero CLI-level test coverage before this PR; the fixes are backed by new regression tests reproducing each bug (including a second, independently-broken copy of the provenance bug found in the AI/MCP tools layer during the fix).

references

  • N/A

…e and merge bugs

Adds --type=auto (the new default) to `atmos config set` and `atmos stack
set`: it infers from the Atmos config schema, then from the type of the
value already at the path, warning instead of silently stringifying when
neither source has an answer. `atmos stack set` previously never inferred
at all.

Also fixes several bugs found during a field-test pass of the config/stack
commands:
- MCPSettings.Enabled (bool + omitempty) could vanish entirely when merging
  atmos.yaml with an atmos.d fragment that both set it; now a *bool.
- PickProvenanceFile picked a phantom Line:0 provenance entry over the real
  defining file for values that live only in an imported catalog manifest,
  breaking `stack set/delete/get/list` for the standard catalog+import
  pattern. This also fixed an independent copy of the same bug in the AI/MCP
  tools layer.
- Error hints containing a raw <placeholder> were silently stripped by the
  markdown renderer (parsed as inline HTML); now HTML-entity-escaped outside
  backtick spans.
- `--config a.yaml,b.yaml` on edit commands silently targeted only the first
  file; now warns.
- `config get` on a key defined only in an atmos.d fragment returned a bare
  "not found" with no indication it might be defined elsewhere.
- `unset` alias was missing from `--help` output for config/stack delete.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@atmos-pro

atmos-pro Bot commented Aug 6, 2026 •

Copy link
Copy Markdown
Contributor

Tip

Atmos Pro  

No affected stacks workflow was detected for this pull request.
If this is expected, no action is needed.
Learn More. Ask AI.

@osterman Erik Osterman (Cloud Posse) (osterman) added the minor New features that do not break anything label Aug 6, 2026
@coderabbitai

coderabbitai Bot commented Aug 6, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • ✅ Review completed - (🔄 Check again to review again)
📝 Walkthrough

Walkthrough

The change adds automatic type inference for configuration and stack setters, import-aware editing, nullable MCP enablement, sanitized error hints, vendor manifest resolution, and complete subcommand alias rendering. Tests, fixtures, and documentation cover these behaviors.

Changes

Configuration and stack value management

Layer / File(s) Summary
YAML type inference primitives
pkg/yaml/*, pkg/stack/*
Adds YAML type detection, explicit-null handling, typed-value validation, canonical scalar output, and provenance selection.
Config setter inference
cmd/config/*, website/docs/cli/commands/config/*
config set infers types from schema, existing values, and scalar shape. It warns on string fallback.
Stack setter and provenance editing
cmd/stack/*, pkg/ai/tools/atmos/stack_config_*, tests/fixtures/scenarios/config-field-test/*, website/docs/cli/commands/stack/*
stack set uses automatic inference, warns for shared files, and edits imported catalog values at their declaring files.

MCP enablement state

Layer / File(s) Summary
Nullable MCP configuration and command integration
pkg/schema/mcp.go, pkg/config/mcp_enabled_merge_test.go, cmd/mcp/*, pkg/datafetcher/schema/atmos/config/1.0.json
MCP enablement is nullable and defaults to false when unset. MCP commands use IsEnabled().

Vendor manifest resolution

Layer / File(s) Summary
Imported vendor lookup and edits
pkg/vendoring/*, cmd/vendor/edit.go, cmd/vendor/vendor_test.go, website/docs/cli/commands/vendor/*
Vendor lookup traverses imported manifests and edits the file that declares the component.
Vendor configuration diagnostics
cmd/vendor/config.go, cmd/vendor/config_test.go, website/docs/cli/commands/vendor/config/set.mdx
Vendor configuration commands add contextual hints, reject automatic inference, and warn on string fallback.

Error and help output

Layer / File(s) Summary
Error hint sanitization
errors/*
Ordinary hint angle brackets are HTML-escaped. Backtick spans, EXAMPLE:, and TITLE: hints remain unchanged.
Subcommand alias rendering
cmd/help_template.go, cmd/help_template_test.go
Help output renders every alias for each subcommand.

Supporting command behavior

Layer / File(s) Summary
Transport and fixture updates
pkg/github/releases_test.go, tests/fixtures/scenarios/complete/vendor.lock.yaml, .claude/settings.json
Transport-level GitHub failures receive regression coverage. Vendor lock fixtures and command permissions are updated.

Estimated code review effort: 4 (Complex) | ~60 minutes

Possibly related PRs

Suggested reviewers: aknysh

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 62.64% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the primary change, automatic type inference, and identifies the related provenance and merge fixes.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch osterman/field-test-config-commands

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 5

🧹 Nitpick comments (1)
pkg/yaml/edit_test.go (1)

156-173: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use table-driven tests for the new type-inference scenarios.

Each site tests independent scenarios with repeated setup and assertions. Use named table cases so each type and fallback case runs independently.

  • pkg/yaml/edit_test.go#L156-L173: Table-drive boolean, integer, string, float, null, and missing-path cases.
  • pkg/yaml/edit_test.go#L251-L265: Table-drive successful lookup, missing-path, and missing-file cases.
  • cmd/stack/operations_test.go#L400-L463: Table-drive existing-value inference and new-key string-fallback cases.

As per coding guidelines, “Use table-driven tests for testing multiple scenarios in Go.”

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pkg/yaml/edit_test.go` around lines 156 - 173, Convert the independent
scenarios into named table-driven tests: in pkg/yaml/edit_test.go lines 156-173,
cover boolean, integer, string, float, null, and missing-path cases; in
pkg/yaml/edit_test.go lines 251-265, cover successful lookup, missing-path, and
missing-file cases; and in cmd/stack/operations_test.go lines 400-463, cover
existing-value inference and new-key string fallback. Run each case through the
relevant existing test logic with per-case assertions.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@errors/builder.go`:
- Around line 191-218: Update escapeHintAngleBrackets to use a delimiter-aware
scanner that preserves Markdown code spans with one or more backticks, including
``--file <manifest>``; stop relying on backtickSpanPattern’s single-backtick
regex and ensure angle brackets inside every valid code span remain unchanged.
Add the requested regression case to TestEscapeHintAngleBrackets.

In `@pkg/yaml/edit.go`:
- Around line 199-230: Update GetType to detect path presence without calling
Get, so explicit YAML null values remain distinguishable from missing or
unaddressable nodes. Extend its tag mapping to return TypeNull for !!null while
preserving existing type mappings and failure behavior. Add a regression test
covering auto inference for an existing explicit null value.

In `@pkg/yaml/typed.go`:
- Line 42: Extend looksNonStringPattern to recognize common numeric CLI forms
including scientific notation (such as 1e3), an explicit plus sign (such as +5),
and leading-decimal values (such as .5), while retaining existing booleans,
integers, and decimals. Add regression cases covering these forms and verify
type inference no longer treats them as strings without the fallback warning.

In `@website/blog/2026-08-06-config-stack-type-inference.mdx`:
- Around line 42-46: Update both atmos stack set examples to include the
required -s <stack> and -c <component> selectors, preserving their existing
variable values and type option.
- Around line 45-46: Correct both fallback-warning examples: in
website/blog/2026-08-06-config-stack-type-inference.mdx lines 45-46, either
remove --type=bool to demonstrate automatic fallback or revise the comment to
describe explicit boolean typing; in
website/docs/cli/commands/config/config-set.mdx lines 44-46, remove the warning
claim for production or change the example to use a bool- or number-like value
on a new unmodeled path.

---

Nitpick comments:
In `@pkg/yaml/edit_test.go`:
- Around line 156-173: Convert the independent scenarios into named table-driven
tests: in pkg/yaml/edit_test.go lines 156-173, cover boolean, integer, string,
float, null, and missing-path cases; in pkg/yaml/edit_test.go lines 251-265,
cover successful lookup, missing-path, and missing-file cases; and in
cmd/stack/operations_test.go lines 400-463, cover existing-value inference and
new-key string fallback. Run each case through the relevant existing test logic
with per-case assertions.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 857569fc-1397-41bb-9a73-e5342425d3dd

📥 Commits

Reviewing files that changed from the base of the PR and between 3ce4349 and 8dc615c.

📒 Files selected for processing (36)
  • cmd/config/operations.go
  • cmd/config/operations_test.go
  • cmd/help_template.go
  • cmd/help_template_test.go
  • cmd/mcp/client/add.go
  • cmd/mcp/client/add_test.go
  • cmd/mcp/client/install.go
  • cmd/mcp/client/list.go
  • cmd/mcp/client/status.go
  • cmd/mcp/client/uninstall.go
  • cmd/mcp/server/start.go
  • cmd/stack/config.go
  • cmd/stack/operations.go
  • cmd/stack/operations_test.go
  • errors/builder.go
  • errors/builder_test.go
  • errors/formatter_test.go
  • pkg/ai/tools/atmos/stack_config_common_test.go
  • pkg/ai/tools/atmos/stack_config_delete_test.go
  • pkg/ai/tools/atmos/stack_config_format_test.go
  • pkg/ai/tools/atmos/stack_config_list_test.go
  • pkg/ai/tools/atmos/stack_config_set_test.go
  • pkg/config/mcp_enabled_merge_test.go
  • pkg/datafetcher/schema/atmos/config/1.0.json
  • pkg/schema/mcp.go
  • pkg/stack/edit.go
  • pkg/stack/edit_test.go
  • pkg/yaml/edit.go
  • pkg/yaml/edit_test.go
  • pkg/yaml/typed.go
  • pkg/yaml/typed_test.go
  • website/blog/2026-08-06-config-stack-type-inference.mdx
  • website/docs/cli/commands/config/config-set.mdx
  • website/docs/cli/commands/stack/config/set.mdx
  • website/docs/cli/commands/stack/stack-set.mdx
  • website/src/data/roadmap.js

Comment thread errors/builder.go Resolved
Comment thread pkg/yaml/edit.go Resolved
Comment thread pkg/yaml/typed.go Resolved
Adds the durable Atmos project fixture used to manually verify the
config/stack fixes in this PR live: multi-level imports, base-component
inheritance, YAML anchors/aliases, and an atmos.d fragment -- coverage no
existing fixture provided for this command surface.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@osterman

Copy link
Copy Markdown
Member Author

Reopening to re-trigger CI checks, which never registered on initial open.

@atmos-pro

atmos-pro Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Note

Atmos Pro  

Waiting for your GitHub Actions workflow to upload affected stacks.
Learn More.

@github-actions

github-actions Bot commented Aug 6, 2026 •

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues found.

Scanned Files

None

- GetType now correctly distinguishes an explicit YAML null (real,
  present value) from a missing path, returning (TypeNull, true)
  instead of ok=false. The auto-inference callers (config/stack set)
  deliberately still treat an existing null as unresolved, since
  buildRHS's TypeNull case ignores the value argument and would
  otherwise silently discard the new value being set.
- looksNonStringPattern now recognizes scientific notation (1e3),
  explicit plus signs (+5), and leading/trailing-dot decimals (.5, 5.),
  so the fallback-to-string warning fires for these shapes too.
- escapeHintAngleBrackets now uses a CommonMark-compliant
  delimiter-aware code-span scanner instead of a single-backtick regex,
  so double-backtick-delimited hints are handled correctly.
- Fixed two doc examples (blog post + config-set.mdx) that claimed to
  demonstrate the fallback warning but used commands that couldn't
  actually produce it (explicit --type, or a value that doesn't look
  non-string); also added the required -s/-c flags to two stack set
  examples.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
coderabbitai[bot]
coderabbitai Bot previously approved these changes Aug 6, 2026
The repo's real PR lint gate is ./custom-gcl (the custom golangci-lint
binary with the lintroller plugin, per pre-commit), not plain
golangci-lint. Denying the raw binary steers future sessions toward
the already-allowed ./custom-gcl instead.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@mergify

mergify Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Important

Cloud Posse Engineering Team Review Required

This pull request modifies files that require Cloud Posse's review. Please be patient, and a core maintainer will review your changes.

To expedite this process, reach out to us on Slack in the #pr-reviews channel.

A manual field test of `atmos vendor config` and the `atmos vendor
get/set` aliases found the alias commands couldn't see components
declared only in an imported vendor manifest, even though `vendor
config list`/`format` already walked the import chain correctly.

- ComponentVersionPath/SetComponentVersion now search vendor.yaml and
  every manifest it imports, writing to the file that actually
  declares the component instead of always the root file.
- vendor config set now warns when a numeric/bool-looking value is
  stored as a string with no --type passed, matching config set/stack
  set.
- vendor config get/set/delete now attach actionable hints to
  missing-file and not-found-in-import-chain errors instead of
  leaking a raw "failed to read file" message.
- The shared YAML anchor guard's error now names the actual
  workaround (an explicit override key) instead of just "restructure".

Co-Authored-By: Claude Sonnet 5 <[email protected]>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (1)
cmd/vendor/config_test.go (1)

150-185: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use table-driven coverage for all warning classifications.

These tests cover only the integer-looking value 42. Add cases for bool- and float-looking values, such as true and 1.5, and retain the explicit --type=string suppression case.

As per coding guidelines, “Use table-driven tests for testing multiple scenarios in Go.”

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@cmd/vendor/config_test.go` around lines 150 - 185, Extend
TestVendorConfigSetCmd_WarnsOnNonStringLooking into a table-driven test covering
integer-, boolean-, and float-looking values such as 42, true, and 1.5,
asserting each emits the existing warning while remaining stored as a string.
Retain TestVendorConfigSetCmd_NoWarningWhenTypeExplicit as the explicit
--type=string suppression case.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@cmd/vendor/config.go`:
- Around line 120-123: Move the warnIfVendorValueLooksNonString call in the
vendor config command to run only after runVendorConfigSet succeeds. Preserve
the existing flag and valueType conditions, and ensure failed writes do not emit
the warning.

In `@cmd/vendor/vendor_test.go`:
- Around line 212-213: Update the test around vendorGetCmd.RunE to capture the
command output and assert it contains the imported component version v0.1.0,
while retaining the existing success assertion. Keep the assertion
behavior-focused so the test verifies vendor get resolves the declaring file
rather than only covering command execution.

In `@pkg/yaml/edit.go`:
- Around line 250-255: Update pathIsExplicitlyPresent and the GetType flow so
raw yq paths preserve explicit null values instead of treating them as missing;
use a presence check that distinguishes an existing null from an absent path, or
explicitly reject raw yq paths with clear documentation. Add a regression test
covering GetType(".vars.explicit_null") and verify it reports presence with the
expected null type/value behavior.

---

Nitpick comments:
In `@cmd/vendor/config_test.go`:
- Around line 150-185: Extend TestVendorConfigSetCmd_WarnsOnNonStringLooking
into a table-driven test covering integer-, boolean-, and float-looking values
such as 42, true, and 1.5, asserting each emits the existing warning while
remaining stored as a string. Retain
TestVendorConfigSetCmd_NoWarningWhenTypeExplicit as the explicit --type=string
suppression case.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 489c45eb-508a-4ac7-b4bd-1acd3e513c45

📥 Commits

Reviewing files that changed from the base of the PR and between 7951e3f and 456f709.

📒 Files selected for processing (24)
  • .claude/settings.json
  • cmd/config/operations.go
  • cmd/config/operations_test.go
  • cmd/stack/operations.go
  • cmd/stack/operations_test.go
  • cmd/vendor/config.go
  • cmd/vendor/config_test.go
  • cmd/vendor/edit.go
  • cmd/vendor/vendor_test.go
  • errors/builder.go
  • errors/builder_test.go
  • pkg/vendoring/files.go
  • pkg/vendoring/files_test.go
  • pkg/vendoring/update_test.go
  • pkg/yaml/anchors.go
  • pkg/yaml/edit.go
  • pkg/yaml/edit_test.go
  • pkg/yaml/path.go
  • pkg/yaml/typed.go
  • pkg/yaml/typed_test.go
  • website/blog/2026-08-06-config-stack-type-inference.mdx
  • website/docs/cli/commands/config/config-set.mdx
  • website/docs/cli/commands/vendor/vendor-get.mdx
  • website/docs/cli/commands/vendor/vendor-set.mdx
🚧 Files skipped from review as they are similar to previous changes (9)
  • pkg/yaml/typed_test.go
  • website/blog/2026-08-06-config-stack-type-inference.mdx
  • website/docs/cli/commands/config/config-set.mdx
  • errors/builder_test.go
  • cmd/config/operations_test.go
  • cmd/stack/operations_test.go
  • pkg/yaml/typed.go
  • cmd/config/operations.go
  • cmd/stack/operations.go

Comment thread cmd/vendor/config.go Resolved
Comment thread cmd/vendor/vendor_test.go Resolved
Comment thread pkg/yaml/edit.go Resolved
- Move the vendor config set "looks non-string" warning to fire only
  after a successful write, so a failed write (e.g. a missing file)
  no longer falsely claims a value was stored.
- Fix GetType/pathIsExplicitlyPresent to distinguish an explicit YAML
  null from a missing value for raw yq paths (leading "."), not just
  ordinary dot-paths -- a raw path is decomposed into segments first
  when possible, falling back to the prior collapsed check only for
  genuinely non-decomposable expressions.
- Strengthen the vendor get/set import-chain regression test to
  assert the actual returned version, not just command success, so it
  would fail if get read the root file instead of the declaring file.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
coderabbitai[bot]
coderabbitai Bot previously approved these changes Aug 7, 2026
Regenerated lock entries for infra/vpc-flow-logs-bucket and
infra/account-map, picked up from running vendor-related tests
locally against this fixture.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@osterman

Copy link
Copy Markdown
Member Author

CodeRabbit (@coderabbitai) do you approve this PR? what's missing?

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

repo="cloudposse/atmos"
pr="2897"

echo "== Pull request metadata and checks =="
gh pr view "$pr" --repo "$repo" \
  --json number,title,state,isDraft,mergeable,reviewDecision,statusCheckRollup,reviews,comments \
  --jq '{
    number, title, state, isDraft, mergeable, reviewDecision,
    checks: [.statusCheckRollup[]? | {name, status, conclusion, detailsUrl}],
    reviews: [.reviews[]? | {author: .author.login, state, body}],
    comments: [.comments[]? | {author: .author.login, body, createdAt}]
  }'

echo
echo "== Changed files =="
gh pr view "$pr" --repo "$repo" --json files \
  --jq '.files[] | "\(.path)\t+\(.additions)/-\(.deletions)"'

echo
echo "== Current CodeRabbit review comments =="
gh api --paginate "repos/$repo/pulls/$pr/comments" \
  --jq '.[] | select(.user.login == "coderabbitai") | {
    path, line, side, body, html_url, created_at
  }'

echo
echo "== Focused source outlines =="
ast-grep outline cmd/config/operations.go --items all
ast-grep outline cmd/stack/operations.go --items all
ast-grep outline pkg/yaml/edit.go --items all
ast-grep outline pkg/yaml/typed.go --items all
ast-grep outline pkg/vendoring/files.go --items all
ast-grep outline pkg/schema/mcp.go --items all

echo
echo "== Focused changed hunks =="
git diff --unified=40 HEAD^ HEAD -- \
  cmd/config/operations.go \
  cmd/stack/operations.go \
  pkg/yaml/edit.go \
  pkg/yaml/typed.go \
  pkg/vendoring/files.go \
  pkg/schema/mcp.go \
  errors/builder.go

Length of output: 78508


🏁 Script executed:

#!/bin/bash
set -euo pipefail

repo="cloudposse/atmos"
pr="2897"
base_oid=$(gh pr view "$pr" --repo "$repo" --json baseRefOid --jq '.baseRefOid')

echo "== PR base and effective diff statistics =="
printf 'base=%s\nhead=%s\n' "$base_oid" "$(git rev-parse HEAD)"
git diff --stat "$base_oid"...HEAD

echo
echo "== High-risk implementation slices =="
sed -n '120,185p' cmd/config/operations.go
sed -n '133,310p' cmd/stack/operations.go
sed -n '399,545p' cmd/stack/operations.go
sed -n '173,315p' pkg/yaml/edit.go
sed -n '1,225p' pkg/yaml/typed.go
sed -n '1,190p' pkg/vendoring/files.go
sed -n '1,55p' pkg/schema/mcp.go
sed -n '150,250p' errors/builder.go
sed -n '1,75p' pkg/stack/edit.go

echo
echo "== Focused test references and implementation call sites =="
rg -n -C 3 \
  'GetType\(|GetFileType\(|LooksNonString\(|effectiveValueType\(|effectiveStackValueType\(|ComponentVersionPath\(|IsEnabled\(' \
  cmd/config/operations_test.go \
  cmd/stack/operations_test.go \
  pkg/yaml/edit_test.go \
  pkg/yaml/typed_test.go \
  pkg/vendoring/files_test.go \
  pkg/config/mcp_enabled_merge_test.go \
  cmd/mcp \
  cmd/vendor \
  pkg/ai/tools/atmos

echo
echo "== Effective PR diff for inspected implementation files =="
git diff --unified=12 "$base_oid"...HEAD -- \
  cmd/config/operations.go \
  cmd/stack/operations.go \
  pkg/yaml/edit.go \
  pkg/yaml/typed.go \
  pkg/vendoring/files.go \
  pkg/schema/mcp.go \
  pkg/stack/edit.go \
  errors/builder.go

Length of output: 130787


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== Config new-key auto-inference tests =="
sed -n '330,480p' cmd/config/operations_test.go

echo
echo "== Stack new-key auto-inference tests =="
sed -n '500,590p' cmd/stack/operations_test.go
sed -n '930,985p' cmd/stack/operations_test.go

echo
echo "== User documentation for --type=auto =="
sed -n '20,110p' website/docs/cli/commands/config/config-set.mdx
sed -n '20,110p' website/docs/cli/commands/stack/config/set.mdx
sed -n '20,110p' website/docs/cli/commands/stack/stack-set.mdx
sed -n '1,90p' website/blog/2026-08-06-config-stack-type-inference.mdx

echo
echo "== All default string fallback warning assertions =="
rg -n -C 4 \
  'stored as a literal string|falls back to string|fallback.*string|WarnsOn.*String|GuessScalarType' \
  cmd/config/operations_test.go \
  cmd/stack/operations_test.go \
  website/docs/cli/commands/config/config-set.mdx \
  website/docs/cli/commands/stack/config/set.mdx \
  website/docs/cli/commands/stack/stack-set.mdx \
  website/blog/2026-08-06-config-stack-type-inference.mdx

Length of output: 26072


@osterman I cannot approve yet.

All current CI checks pass. I found no current inline CodeRabbit findings.

One item remains:

  • website/blog/2026-08-06-config-stack-type-inference.mdx conflicts with the implemented contract. The blog says a new unmodeled value such as vars.new_flag true falls back to a string and emits a warning. The final implementation, tests, and command documentation now infer from the new value’s shape. That command writes a boolean and does not emit that fallback warning.

Please choose one contract and make all sources consistent:

  1. Keep shape-based inference. Update the blog’s “The Fix” and vars.new_flag example.
  2. Keep schema/existing-value inference only. Remove GuessScalarType fallback and update the tests and command documentation.

The current code, tests, and command documentation consistently support option 1. The blog is the remaining inconsistency.

You are interacting with an AI system.

The blog's "The Fix" section and vars.new_flag example still described
the pre-"auto nag" fix contract (new unmodeled value falls back to a
string with a warning). The shipped implementation, tests, and command
docs all now infer from the new value's own shape instead, and also
draw on the target Terraform component's declared variable type for
stack set's vars.* paths (retyping an existing value that disagrees).
Updates the post to describe that final contract, per PR review.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@osterman

Copy link
Copy Markdown
Member Author

CodeRabbit (@coderabbitai) full review

@coderabbitai

coderabbitai Bot commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor
⚠️ Action not completed

Review rate limited.


Your included review limit is currently reached under our Fair Usage Limits Policy. This review may still proceed through usage-based billing if eligible. Your next included review will be available in 13 minutes.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (4)
pkg/github/releases_test.go (1)

71-98: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use a table-driven test for the transport cases.

Lines 80-90 test multiple transport failures with the same assertion. Put these cases in a table and run each case with t.Run. Keep the 404 assertion separate because it verifies a different behavior.

As per coding guidelines, “Use table-driven tests for testing multiple scenarios in Go.”

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pkg/github/releases_test.go` around lines 71 - 98, Refactor
TestIsGitHubTransientError_TransportFailure to store the
certificate-verification and DNS failures as named table cases, then iterate
over them with t.Run and assert each is transient. Keep the separate
github.ErrorResponse 404 assertion unchanged outside the table because it covers
distinct behavior.

Source: Coding guidelines

pkg/yaml/typed.go (1)

18-23: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Update the TypeAuto doc to mention the shape-guess tier.

The comment lists schema, then existing value, then string. GuessScalarType now sits between the existing-value tier and the string fallback, and both cmd/config/operations.go and cmd/stack/operations.go call it. Add that tier so the constant's contract matches the callers.

📝 Proposed doc tweak
 	// TypeAuto infers the type: from the Atmos config schema when the path is
 	// modeled, otherwise from the type of the value already at that path (if
-	// any), otherwise string. This is the default for SetFileWithType callers
+	// any), otherwise from the new value's own scalar shape (see
+	// GuessScalarType), otherwise string. This is the default for SetFileWithType callers
 	// (config set, stack set) -- it is never passed through to buildRHS, which
 	// only ever sees a type TypeAuto has already been resolved to.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pkg/yaml/typed.go` around lines 18 - 23, Update the TypeAuto comment to
include GuessScalarType as the tier after inferring from an existing value and
before falling back to string, preserving the documented schema-first ordering
and caller contract.
tests/fixtures/scenarios/config-field-test/components/terraform/mock/main.tf (1)

16-37: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Fixture is correct; the retype notice wording is slightly off because of it.

These declarations live in main.tf, not variables.tf, and terraform-config-inspect scans the whole module, so the tests work. The retype notice in cmd/stack/operations.go line 151 prints "per variables.tf", which is inaccurate for exactly this fixture and for any component that declares variables elsewhere. Consider "per the component's Terraform variable declarations" instead.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/fixtures/scenarios/config-field-test/components/terraform/mock/main.tf`
around lines 16 - 37, Update the retype notice in the stack operation around the
existing message in operations.go to replace the inaccurate “per variables.tf”
wording with language referring to the component’s Terraform variable
declarations, preserving the notice’s existing behavior and formatting.
docs/fixes/2026-08-10-auto-type-inference-nag-fix.md (1)

102-105: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Fix the finding count.

The text says "4 findings" and then lists five: 2 godot, 1 nestif, 1 function-result-limit, 1 cyclomatic.

✏️ Proposed fix
-- `atmos fix lint` (patch-scoped, `--new-from-rev=origin/main`) — 0 issues, after fixing 4 findings
+- `atmos fix lint` (patch-scoped, `--new-from-rev=origin/main`) — 0 issues, after fixing 5 findings

Ignoring the LanguageTool typographic-quote hints here — straight ASCII quotes are the convention for docs/fixes/*.md.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/fixes/2026-08-10-auto-type-inference-nag-fix.md` around lines 102 - 105,
Update the finding count in the `atmos fix lint` summary to match the five
listed findings: 2 `godot`, 1 `nestif`, 1 `function-result-limit`, and 1
`cyclomatic`; leave the individual finding descriptions unchanged.

Source: Linters/SAST tools

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@cmd/stack/operations.go`:
- Around line 290-295: Update warnIfSilentlyStoredAsString so the nan-specific
warning directs users to --type=yaml with the dotted .nan spelling instead of
suggesting --type=float. Preserve the existing warning behavior and generic type
guidance for other values, if they still reach this function.

---

Nitpick comments:
In `@docs/fixes/2026-08-10-auto-type-inference-nag-fix.md`:
- Around line 102-105: Update the finding count in the `atmos fix lint` summary
to match the five listed findings: 2 `godot`, 1 `nestif`, 1
`function-result-limit`, and 1 `cyclomatic`; leave the individual finding
descriptions unchanged.

In `@pkg/github/releases_test.go`:
- Around line 71-98: Refactor TestIsGitHubTransientError_TransportFailure to
store the certificate-verification and DNS failures as named table cases, then
iterate over them with t.Run and assert each is transient. Keep the separate
github.ErrorResponse 404 assertion unchanged outside the table because it covers
distinct behavior.

In `@pkg/yaml/typed.go`:
- Around line 18-23: Update the TypeAuto comment to include GuessScalarType as
the tier after inferring from an existing value and before falling back to
string, preserving the documented schema-first ordering and caller contract.

In
`@tests/fixtures/scenarios/config-field-test/components/terraform/mock/main.tf`:
- Around line 16-37: Update the retype notice in the stack operation around the
existing message in operations.go to replace the inaccurate “per variables.tf”
wording with language referring to the component’s Terraform variable
declarations, preserving the notice’s existing behavior and formatting.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 36866b0d-65b7-4ebf-8092-bcf2fe1d55fb

📥 Commits

Reviewing files that changed from the base of the PR and between 21c5899 and 00d968d.

⛔ Files ignored due to path filters (1)
  • website/pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (69)
  • .claude/settings.json
  • cmd/config/operations.go
  • cmd/config/operations_test.go
  • cmd/help_template.go
  • cmd/help_template_test.go
  • cmd/mcp/client/add.go
  • cmd/mcp/client/add_test.go
  • cmd/mcp/client/install.go
  • cmd/mcp/client/list.go
  • cmd/mcp/client/status.go
  • cmd/mcp/client/uninstall.go
  • cmd/mcp/server/start.go
  • cmd/stack/config.go
  • cmd/stack/operations.go
  • cmd/stack/operations_test.go
  • cmd/vendor/config.go
  • cmd/vendor/config_test.go
  • cmd/vendor/edit.go
  • cmd/vendor/vendor_test.go
  • docs/fixes/2026-08-07-config-stack-set-auto-type-inference-round-2.md
  • docs/fixes/2026-08-10-auto-type-inference-nag-fix.md
  • docs/fixes/2026-08-10-github-transient-error-tls-cert-flake.md
  • errors/builder.go
  • errors/builder_test.go
  • errors/formatter_test.go
  • internal/exec/terraform_declared_var_type.go
  • internal/exec/terraform_declared_var_type_test.go
  • pkg/ai/tools/atmos/config_set_test.go
  • pkg/ai/tools/atmos/stack_config_common_test.go
  • pkg/ai/tools/atmos/stack_config_delete_test.go
  • pkg/ai/tools/atmos/stack_config_format_test.go
  • pkg/ai/tools/atmos/stack_config_list_test.go
  • pkg/ai/tools/atmos/stack_config_set_test.go
  • pkg/config/mcp_enabled_merge_test.go
  • pkg/datafetcher/schema/atmos/config/1.0.json
  • pkg/github/releases_test.go
  • pkg/schema/mcp.go
  • pkg/stack/edit.go
  • pkg/stack/edit_test.go
  • pkg/stack/var_type.go
  • pkg/stack/var_type_test.go
  • pkg/vendoring/files.go
  • pkg/vendoring/files_test.go
  • pkg/vendoring/update_test.go
  • pkg/yaml/anchors.go
  • pkg/yaml/anchors_test.go
  • pkg/yaml/edit.go
  • pkg/yaml/edit_test.go
  • pkg/yaml/errors.go
  • pkg/yaml/path.go
  • pkg/yaml/typed.go
  • pkg/yaml/typed_test.go
  • tests/fixtures/scenarios/complete/vendor.lock.yaml
  • tests/fixtures/scenarios/config-field-test/atmos.d/extra.yaml
  • tests/fixtures/scenarios/config-field-test/atmos.yaml
  • tests/fixtures/scenarios/config-field-test/components/terraform/mock/main.tf
  • tests/fixtures/scenarios/config-field-test/stacks/catalog/abstract.yaml
  • tests/fixtures/scenarios/config-field-test/stacks/catalog/mock.yaml
  • tests/fixtures/scenarios/config-field-test/stacks/deploy/nonprod.yaml
  • tests/fixtures/scenarios/config-field-test/stacks/deploy/prod.yaml
  • website/blog/2026-08-06-config-stack-type-inference.mdx
  • website/docs/cli/commands/config/config-set.mdx
  • website/docs/cli/commands/stack/config/set.mdx
  • website/docs/cli/commands/stack/stack-set.mdx
  • website/docs/cli/commands/vendor/config/set.mdx
  • website/docs/cli/commands/vendor/vendor-get.mdx
  • website/docs/cli/commands/vendor/vendor-set.mdx
  • website/package.json
  • website/src/data/roadmap.js
🚧 Files skipped from review as they are similar to previous changes (52)
  • pkg/vendoring/update_test.go
  • cmd/help_template_test.go
  • tests/fixtures/scenarios/config-field-test/stacks/deploy/prod.yaml
  • cmd/mcp/client/list.go
  • tests/fixtures/scenarios/config-field-test/stacks/catalog/abstract.yaml
  • .claude/settings.json
  • pkg/stack/edit.go
  • cmd/stack/config.go
  • errors/formatter_test.go
  • pkg/stack/edit_test.go
  • pkg/yaml/errors.go
  • tests/fixtures/scenarios/config-field-test/atmos.d/extra.yaml
  • pkg/ai/tools/atmos/stack_config_common_test.go
  • website/docs/cli/commands/vendor/config/set.mdx
  • cmd/help_template.go
  • pkg/config/mcp_enabled_merge_test.go
  • cmd/mcp/client/add_test.go
  • pkg/ai/tools/atmos/stack_config_format_test.go
  • tests/fixtures/scenarios/config-field-test/stacks/deploy/nonprod.yaml
  • website/docs/cli/commands/vendor/vendor-get.mdx
  • pkg/datafetcher/schema/atmos/config/1.0.json
  • website/package.json
  • cmd/mcp/client/uninstall.go
  • pkg/ai/tools/atmos/stack_config_delete_test.go
  • pkg/ai/tools/atmos/config_set_test.go
  • cmd/mcp/server/start.go
  • website/docs/cli/commands/config/config-set.mdx
  • website/docs/cli/commands/stack/config/set.mdx
  • cmd/config/operations_test.go
  • pkg/ai/tools/atmos/stack_config_set_test.go
  • cmd/mcp/client/add.go
  • pkg/schema/mcp.go
  • tests/fixtures/scenarios/config-field-test/atmos.yaml
  • cmd/vendor/vendor_test.go
  • cmd/mcp/client/install.go
  • pkg/yaml/edit_test.go
  • website/src/data/roadmap.js
  • errors/builder_test.go
  • website/docs/cli/commands/vendor/vendor-set.mdx
  • website/docs/cli/commands/stack/stack-set.mdx
  • pkg/yaml/anchors_test.go
  • errors/builder.go
  • cmd/config/operations.go
  • pkg/yaml/path.go
  • cmd/vendor/edit.go
  • cmd/vendor/config.go
  • pkg/yaml/anchors.go
  • pkg/vendoring/files.go
  • cmd/mcp/client/status.go
  • pkg/vendoring/files_test.go
  • pkg/yaml/edit.go
  • pkg/ai/tools/atmos/stack_config_list_test.go

Comment thread cmd/stack/operations.go Resolved
warnIfSilentlyStoredAsString's hint told users to pass --type to
store a value "as bool, int, float, or yaml" -- but this warning is
now reachable only for the bare "nan" literal (GuessScalarType
handles every other bool/int/float shape directly), and --type=float
explicitly rejects NaN/Infinity, so the hint sent users straight into
a parser error.

CodeRabbit correctly flagged the --type=float suggestion as broken,
but its own proposed replacement (--type=yaml with a .nan literal)
is also broken -- confirmed live: the leading "." in ".nan" collides
with yq's path-navigation operator in the raw assignment expression,
so it silently writes null instead of NaN. That's worse than the
original message, since it "succeeds" while corrupting the value
instead of failing loudly.

There's no currently-safe way to write NaN/Infinity as a typed float
through this command, so the new message says so plainly instead of
pointing at a workaround that doesn't work.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@aknysh
Andriy Knysh (aknysh) added this pull request to the merge queue Aug 12, 2026
@atmos-pro

atmos-pro Bot commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor

Tip

Atmos Pro  

No affected stacks workflow was detected for this pull request.
If this is expected, no action is needed.
Learn More. Ask AI.

Merged via the queue into main with commit a25bfb5 Aug 12, 2026
144 of 145 checks passed
@aknysh
Andriy Knysh (aknysh) deleted the osterman/field-test-config-commands branch August 12, 2026 19:28
@atmos-pro

atmos-pro Bot commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor

Tip

Atmos Pro  

No affected stacks workflow was detected for this pull request.
If this is expected, no action is needed.
Learn More. Ask AI.

@mergify mergify Bot removed the needs-cloudposse Needs Cloud Posse assistance label Aug 12, 2026
@github-actions

Copy link
Copy Markdown

Warning

Release Documentation Required

This PR is labeled minor or major and requires documentation updates:

  • Changelog entry - Add a blog post in website/blog/YYYY-MM-DD-feature-name.mdx
  • Roadmap update - Update website/src/data/roadmap.js with the new milestone

Alternatively: If this change doesn't require release documentation, remove the minor or major label.

@github-actions

Copy link
Copy Markdown

These changes were released in v1.226.0-rc.6.

This branch was successfully deployed

1 active and 1 inactive deployments
preview — 7388bd4b Deployed Aug 11, 2026 by github-actions[bot]
screengrabs — 7388bd4b Deployed Aug 11, 2026 by osterman via build #1335
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

minor New features that do not break anything size/l Large size PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants