Repository navigation
feat(config): auto type inference + provenance/merge bug fixes - #2897
Conversation
…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]>
|
Tip Atmos Pro
No affected stacks workflow was detected for this pull request. |
|
Note Reviews pausedIt 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 Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThe 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. ChangesConfiguration and stack value management
MCP enablement state
Vendor manifest resolution
Error and help output
Supporting command behavior
Estimated code review effort: 4 (Complex) | ~60 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 5
🧹 Nitpick comments (1)
pkg/yaml/edit_test.go (1)
156-173: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winUse 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
📒 Files selected for processing (36)
cmd/config/operations.gocmd/config/operations_test.gocmd/help_template.gocmd/help_template_test.gocmd/mcp/client/add.gocmd/mcp/client/add_test.gocmd/mcp/client/install.gocmd/mcp/client/list.gocmd/mcp/client/status.gocmd/mcp/client/uninstall.gocmd/mcp/server/start.gocmd/stack/config.gocmd/stack/operations.gocmd/stack/operations_test.goerrors/builder.goerrors/builder_test.goerrors/formatter_test.gopkg/ai/tools/atmos/stack_config_common_test.gopkg/ai/tools/atmos/stack_config_delete_test.gopkg/ai/tools/atmos/stack_config_format_test.gopkg/ai/tools/atmos/stack_config_list_test.gopkg/ai/tools/atmos/stack_config_set_test.gopkg/config/mcp_enabled_merge_test.gopkg/datafetcher/schema/atmos/config/1.0.jsonpkg/schema/mcp.gopkg/stack/edit.gopkg/stack/edit_test.gopkg/yaml/edit.gopkg/yaml/edit_test.gopkg/yaml/typed.gopkg/yaml/typed_test.gowebsite/blog/2026-08-06-config-stack-type-inference.mdxwebsite/docs/cli/commands/config/config-set.mdxwebsite/docs/cli/commands/stack/config/set.mdxwebsite/docs/cli/commands/stack/stack-set.mdxwebsite/src/data/roadmap.js
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]>
|
Reopening to re-trigger CI checks, which never registered on initial open. |
Dependency Review✅ No vulnerabilities or license issues found.Scanned FilesNone |
- 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]>
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]>
|
Important Cloud Posse Engineering Team Review RequiredThis 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 |
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]>
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (1)
cmd/vendor/config_test.go (1)
150-185: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winUse 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 astrueand1.5, and retain the explicit--type=stringsuppression 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
📒 Files selected for processing (24)
.claude/settings.jsoncmd/config/operations.gocmd/config/operations_test.gocmd/stack/operations.gocmd/stack/operations_test.gocmd/vendor/config.gocmd/vendor/config_test.gocmd/vendor/edit.gocmd/vendor/vendor_test.goerrors/builder.goerrors/builder_test.gopkg/vendoring/files.gopkg/vendoring/files_test.gopkg/vendoring/update_test.gopkg/yaml/anchors.gopkg/yaml/edit.gopkg/yaml/edit_test.gopkg/yaml/path.gopkg/yaml/typed.gopkg/yaml/typed_test.gowebsite/blog/2026-08-06-config-stack-type-inference.mdxwebsite/docs/cli/commands/config/config-set.mdxwebsite/docs/cli/commands/vendor/vendor-get.mdxwebsite/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
- 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]>
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]>
|
CodeRabbit (@coderabbitai) do you approve this PR? what's missing? |
|
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.goLength 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.goLength 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.mdxLength of output: 26072
All current CI checks pass. I found no current inline CodeRabbit findings. One item remains:
Please choose one contract and make all sources consistent:
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]>
|
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. |
|
CodeRabbit (@coderabbitai) full review |
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (4)
pkg/github/releases_test.go (1)
71-98: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winUse 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 valueUpdate the
TypeAutodoc to mention the shape-guess tier.The comment lists schema, then existing value, then string.
GuessScalarTypenow sits between the existing-value tier and the string fallback, and bothcmd/config/operations.goandcmd/stack/operations.gocall 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 valueFixture is correct; the retype notice wording is slightly off because of it.
These declarations live in
main.tf, notvariables.tf, andterraform-config-inspectscans the whole module, so the tests work. The retype notice incmd/stack/operations.goline 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 valueFix the finding count.
The text says "4 findings" and then lists five: 2
godot, 1nestif, 1function-result-limit, 1cyclomatic.✏️ 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 findingsIgnoring 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
⛔ Files ignored due to path filters (1)
website/pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (69)
.claude/settings.jsoncmd/config/operations.gocmd/config/operations_test.gocmd/help_template.gocmd/help_template_test.gocmd/mcp/client/add.gocmd/mcp/client/add_test.gocmd/mcp/client/install.gocmd/mcp/client/list.gocmd/mcp/client/status.gocmd/mcp/client/uninstall.gocmd/mcp/server/start.gocmd/stack/config.gocmd/stack/operations.gocmd/stack/operations_test.gocmd/vendor/config.gocmd/vendor/config_test.gocmd/vendor/edit.gocmd/vendor/vendor_test.godocs/fixes/2026-08-07-config-stack-set-auto-type-inference-round-2.mddocs/fixes/2026-08-10-auto-type-inference-nag-fix.mddocs/fixes/2026-08-10-github-transient-error-tls-cert-flake.mderrors/builder.goerrors/builder_test.goerrors/formatter_test.gointernal/exec/terraform_declared_var_type.gointernal/exec/terraform_declared_var_type_test.gopkg/ai/tools/atmos/config_set_test.gopkg/ai/tools/atmos/stack_config_common_test.gopkg/ai/tools/atmos/stack_config_delete_test.gopkg/ai/tools/atmos/stack_config_format_test.gopkg/ai/tools/atmos/stack_config_list_test.gopkg/ai/tools/atmos/stack_config_set_test.gopkg/config/mcp_enabled_merge_test.gopkg/datafetcher/schema/atmos/config/1.0.jsonpkg/github/releases_test.gopkg/schema/mcp.gopkg/stack/edit.gopkg/stack/edit_test.gopkg/stack/var_type.gopkg/stack/var_type_test.gopkg/vendoring/files.gopkg/vendoring/files_test.gopkg/vendoring/update_test.gopkg/yaml/anchors.gopkg/yaml/anchors_test.gopkg/yaml/edit.gopkg/yaml/edit_test.gopkg/yaml/errors.gopkg/yaml/path.gopkg/yaml/typed.gopkg/yaml/typed_test.gotests/fixtures/scenarios/complete/vendor.lock.yamltests/fixtures/scenarios/config-field-test/atmos.d/extra.yamltests/fixtures/scenarios/config-field-test/atmos.yamltests/fixtures/scenarios/config-field-test/components/terraform/mock/main.tftests/fixtures/scenarios/config-field-test/stacks/catalog/abstract.yamltests/fixtures/scenarios/config-field-test/stacks/catalog/mock.yamltests/fixtures/scenarios/config-field-test/stacks/deploy/nonprod.yamltests/fixtures/scenarios/config-field-test/stacks/deploy/prod.yamlwebsite/blog/2026-08-06-config-stack-type-inference.mdxwebsite/docs/cli/commands/config/config-set.mdxwebsite/docs/cli/commands/stack/config/set.mdxwebsite/docs/cli/commands/stack/stack-set.mdxwebsite/docs/cli/commands/vendor/config/set.mdxwebsite/docs/cli/commands/vendor/vendor-get.mdxwebsite/docs/cli/commands/vendor/vendor-set.mdxwebsite/package.jsonwebsite/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
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]>
|
Tip Atmos Pro
No affected stacks workflow was detected for this pull request. |
|
Tip Atmos Pro
No affected stacks workflow was detected for this pull request. |
|
Warning Release Documentation RequiredThis PR is labeled
|
|
These changes were released in v1.226.0-rc.6. |
what
atmos config setandatmos stack setnow default--typetoauto: 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 setpreviously never inferred at all — every value was stored as a string unless--typewas passed explicitly.PickProvenanceFile(shared byatmos stack set/get/delete/listand the AI/MCP tools layer) always picking the last provenance entry, which for any value defined only in an imported catalog file was a phantomLine:0entry pointing at the wrong (importing) manifest instead of the file that actually defines the value.MCPSettings.Enabled(abooltaggedomitempty) silently disappearing from the merged config whenatmos.yamland anatmos.d/fragment both set it to different values, instead of the explicit value winning.<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.yamlonatmos config get/set/delete/formatnow warns that only the first file is targeted, instead of silently dropping the rest.atmos config geton a key defined only in anatmos.d/fragment now hints to checkatmos describe configinstead of just reporting "not found".unsetalias (forconfig/stack delete) now shows up in--helpoutput, alongsidedel.why
atmos configandatmos stack/atmos stack configsurfaced 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.references