Repository navigation
Add deprecation validation warnings - #2793
Conversation
|
Tip Atmos Pro
No affected stacks workflow was detected for this pull request. |
Dependency Review✅ No vulnerabilities or license issues found.Scanned Files
|
|
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:
📝 WalkthroughWalkthroughSchema deprecation metadata and YAML scanning now produce positioned warnings across CLI and LSP validation. Schema validation succeeds when diagnostics contain no errors, and dependency parsing retains compatibility with legacy top-level ChangesSchema Deprecation and Compatibility
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant ValidateStacks
participant DeprecatedYAMLSchema
participant YAMLPositions
participant UI
User->>ValidateStacks: validate stack files
ValidateStacks->>DeprecatedYAMLSchema: scan stack YAML
DeprecatedYAMLSchema-->>ValidateStacks: deprecated fields
ValidateStacks->>YAMLPositions: locate fields
YAMLPositions-->>ValidateStacks: line and column data
ValidateStacks->>UI: print formatted warnings
Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 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 (5)
pkg/validator/deprecation.go (2)
3-13: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueSeparate Atmos imports from third-party imports.
Move the
github.com/cloudposse/atmos/...imports into their own group.As per coding guidelines, “Organize imports into standard library, third-party, and Atmos groups.”
🤖 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/validator/deprecation.go` around lines 3 - 13, Reorganize the import block in deprecation.go into separate standard-library, third-party, and Atmos groups, placing the github.com/cloudposse/atmos/datafetcher and github.com/cloudposse/atmos/schema imports in their own group while preserving all existing imports.Source: Coding guidelines
27-38: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winWrap deprecation-scan failures with their operation and input.
Raw errors make CLI failures difficult to diagnose. Preserve
errors.Isbehavior with%wwhile identifying the schema source or YAML file.
pkg/validator/deprecation.go#L27-L38: wrap schema retrieval, JSON decoding, and YAML decoding errors with the schema source and operation.internal/exec/validate_schema.go#L383-L390: wrap YAML file reads and deprecated-field scans with the file path and operation.As per coding guidelines, “wrap errors with context” and use
fmt.Errorf("context: %w", err).🤖 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/validator/deprecation.go` around lines 27 - 38, Wrap the schema retrieval, JSON decoding, and YAML decoding errors in FindDeprecatedYAMLFields with fmt.Errorf context naming the relevant operation and schemaSource, preserving the original errors with %w. Also update internal/exec/validate_schema.go lines 383-390 to wrap YAML file-read and deprecated-field scan failures with the file path and operation, likewise retaining %w for errors.Is compatibility.Source: Coding guidelines
pkg/lsp/server/config_schema_test.go (1)
89-100: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winAssert the warning range.
The feature promises positioned diagnostics, but this test only checks severity and message. Assert the zero-based line and character for
name_patternto protect the YAML-path normalization contract.As per coding guidelines, tests should “test behavior rather than implementation.”
🤖 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/lsp/server/config_schema_test.go` around lines 89 - 100, Update the “deprecated property produces a warning diagnostic” test to also assert the diagnostic’s zero-based range points to the YAML `name_pattern` key. Use the existing diagnostics range fields and verify both start and end line/character values, while preserving the current severity and message assertions.Source: Coding guidelines
pkg/config/schema/generate_test.go (1)
80-93: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAssert metadata on each expected schema node.
A global
"deprecated": truematch does not prove every listed replacement belongs to a deprecated property. Decode the schema and assert each targeted field contains bothdeprecated: trueand its expected replacement.As per coding guidelines, tests should “test behavior rather than implementation.”
🤖 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/config/schema/generate_test.go` around lines 80 - 93, Update TestGenerateMarksDeprecatedConfigurationFields to decode generatedSchema(t) and inspect each targeted schema node individually. For every listed replacement, locate the corresponding field and assert that its metadata contains deprecated: true and the expected replacement, removing the global document-level deprecated assertion while preserving behavior-focused validation.Source: Coding guidelines
pkg/validator/deprecation_test.go (1)
12-55: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winCover schema references and composition branches.
Add table-driven cases for local
$ref,allOf/anyOf/oneOf, andpatternProperties. These are core scanner paths but currently have no regression coverage.As per coding guidelines, “Every new feature must include comprehensive unit tests” and tests should use table-driven scenarios.
🤖 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/validator/deprecation_test.go` around lines 12 - 55, Expand the deprecation scanner tests with a table-driven test covering local $ref resolution, allOf/anyOf/oneOf composition branches, and patternProperties, asserting each deprecated field path and replacement. Reuse the existing schema-file and YAML-input setup from TestFindDeprecatedYAMLFields, and keep the expected results deterministic.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 `@internal/exec/dependency_parser.go`:
- Around line 56-65: Update the dependency selection logic before the legacy
fallback so an empty settingsSection["depends_on"] mapping is treated as absent,
allowing componentSection["depends_on"] to be used. Keep non-empty
settings-level dependencies preferred, align this behavior with
getComponentDependencies, and add a regression test covering an empty settings
mapping with populated legacy dependencies.
In `@internal/exec/validate_schema.go`:
- Around line 361-370: Move the deprecation diagnostics computation and warning
emission out of the len(validationErrors) == 0 branch in the schema validation
flow. In the validation logic around schemaFilePositions and
av.deprecationDiagnostics, compute and print warnings before branching on
validationErrors, while preserving the existing warning error return and success
reporting behavior.
In `@internal/exec/validate_stacks.go`:
- Around line 293-311: Update warnDeprecatedStackFields to fetch and parse
schemaPath once before iterating over files, then reuse the parsed schema when
identifying deprecated fields for each file. Adjust FindDeprecatedYAMLFields or
introduce the appropriate reusable schema input so it does not re-fetch or
re-parse the schema inside the per-file loop, while preserving the existing
warning positions and messages.
- Around line 293-311: The warnDeprecatedStackFields scan currently aborts
ValidateStacks on the first file read or deprecated-field parsing error. Update
this flow to record or log per-file errors and continue processing the remaining
files, while preserving the existing hard-failure behavior for the main semantic
validation path and reporting the collected scan issues through the established
validation error mechanism.
In `@pkg/validator/deprecation.go`:
- Line 27: Update the exported function FindDeprecatedYAMLFields to defer
perf.Track(atmosConfig, "validator.FindDeprecatedYAMLFields")() immediately at
function entry, followed by a blank line; add the required perf import if it is
not already present.
---
Nitpick comments:
In `@pkg/config/schema/generate_test.go`:
- Around line 80-93: Update TestGenerateMarksDeprecatedConfigurationFields to
decode generatedSchema(t) and inspect each targeted schema node individually.
For every listed replacement, locate the corresponding field and assert that its
metadata contains deprecated: true and the expected replacement, removing the
global document-level deprecated assertion while preserving behavior-focused
validation.
In `@pkg/lsp/server/config_schema_test.go`:
- Around line 89-100: Update the “deprecated property produces a warning
diagnostic” test to also assert the diagnostic’s zero-based range points to the
YAML `name_pattern` key. Use the existing diagnostics range fields and verify
both start and end line/character values, while preserving the current severity
and message assertions.
In `@pkg/validator/deprecation_test.go`:
- Around line 12-55: Expand the deprecation scanner tests with a table-driven
test covering local $ref resolution, allOf/anyOf/oneOf composition branches, and
patternProperties, asserting each deprecated field path and replacement. Reuse
the existing schema-file and YAML-input setup from TestFindDeprecatedYAMLFields,
and keep the expected results deterministic.
In `@pkg/validator/deprecation.go`:
- Around line 3-13: Reorganize the import block in deprecation.go into separate
standard-library, third-party, and Atmos groups, placing the
github.com/cloudposse/atmos/datafetcher and github.com/cloudposse/atmos/schema
imports in their own group while preserving all existing imports.
- Around line 27-38: Wrap the schema retrieval, JSON decoding, and YAML decoding
errors in FindDeprecatedYAMLFields with fmt.Errorf context naming the relevant
operation and schemaSource, preserving the original errors with %w. Also update
internal/exec/validate_schema.go lines 383-390 to wrap YAML file-read and
deprecated-field scan failures with the file path and operation, likewise
retaining %w for errors.Is compatibility.
🪄 Autofix (Beta)
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: 8436550b-0c65-416a-901f-ccaf368a6b49
📒 Files selected for processing (20)
cmd/validate_schema.gointernal/exec/dependency_parser.gointernal/exec/describe_dependents.gointernal/exec/describe_dependents_test.gointernal/exec/validate_schema.gointernal/exec/validate_stacks.gopkg/config/schema/generate_test.gopkg/datafetcher/schema/atmos/config/1.0.jsonpkg/datafetcher/schema/atmos/manifest/1.0.jsonpkg/datafetcher/schema/stacks/stack-config/1.0.jsonpkg/lsp/server/config_schema.gopkg/lsp/server/config_schema_test.gopkg/schema/schema.gopkg/schema/schema_auth.gopkg/schema/version.gopkg/validator/deprecation.gopkg/validator/deprecation_test.gotests/fixtures/scenarios/deprecated-config-compatibility/atmos.yamltests/fixtures/scenarios/deprecated-config-compatibility/stacks/deploy/dev.yamltests/test-cases/deprecated-config-compatibility.yaml
Records the deprecation-warning work already landed on this branch so legacy config compatibility fixes stay tracked per the fix-log skill. Co-Authored-By: Claude Sonnet 5 <[email protected]>
Bumps google.golang.org/grpc to v1.82.1 (GHSA-hrxh-6v49-42gf: xDS RBAC auth bypass, HTTP/2 Rapid Reset bypass, RBAC panic) and pins the website's transitive fast-uri, svgo, and dompurify to their patched versions via pnpm overrides, regenerating NOTICE accordingly. Co-Authored-By: Claude Sonnet 5 <[email protected]>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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 `@docs/fixes/2026-07-23-schema-deprecation-warnings-and-compatibility.md`:
- Around line 42-57: Update the relevant website documentation pages for config
validation, stack validation, and the Atmos LSP to describe schema deprecation
warnings, including representative output or usage examples. Explain that
deprecation-only diagnostics do not cause validation to fail and document when
migration hints are shown, while linking the guidance to the deprecated fields
already covered by the docs.
🪄 Autofix (Beta)
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: e8f1069d-9017-4ff4-b46f-d7d49b138250
⛔ Files ignored due to path filters (2)
go.sumis excluded by!**/*.sumwebsite/pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (4)
NOTICEdocs/fixes/2026-07-23-schema-deprecation-warnings-and-compatibility.mdgo.modwebsite/package.json
deprecationDiagnostics returned a hard error when it couldn't re-read a file or resolve a schema source, aborting validation that had already succeeded. Make it best-effort (log + continue) like its sibling warnDeprecatedStackFields, fixing 7 failing internal/exec subtests that exercise the validator through mocked files/schemas. Co-Authored-By: Claude Sonnet 5 <[email protected]>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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 `@docs/fixes/2026-07-24-deprecation-scan-failing-schema-validation-tests.md`:
- Around line 23-30: Reconcile the reported failing-subtest count in the
documentation with the explicitly listed tests: either identify and add the
missing seventh subtest or change the count from seven to six. Keep the named
test references and surrounding failure description accurate.
🪄 Autofix (Beta)
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: 3d6938c2-92bb-44a9-9a5e-ce695aa35516
📒 Files selected for processing (2)
docs/fixes/2026-07-24-deprecation-scan-failing-schema-validation-tests.mdinternal/exec/validate_schema.go
Add "Deprecation Warnings" sections to the validate schema/stacks command docs and the LSP server feature list, and note the restored component-level depends_on compatibility form. Addresses CodeRabbit thread PRRT_kwDOEW4XoM6TceLm on PR #2793 — the warnings were user-facing but undocumented. 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
website/docs/cli/commands/validate/validate-stacks.mdx (1)
116-120: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winUse the current terminal-cast convention.
This new CLI example uses
<Terminal>, while this documentation subtree uses static<CastPlayer>terminal casts. Replace the wrapper and add the corresponding cast asset if required.Based on learnings, CLI command documentation should use static
CastPlayerrather than the legacy terminal component.🤖 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 `@website/docs/cli/commands/validate/validate-stacks.mdx` around lines 116 - 120, Replace the legacy Terminal wrapper around the “atmos validate stacks” example with the subtree’s static CastPlayer convention, and add the corresponding cast asset using the existing naming and placement patterns for CLI documentation. Preserve the displayed command output, including the deprecation warning.Source: Learnings
🤖 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 `@website/docs/cli/commands/validate/validate-schema.mdx`:
- Around line 59-61: Qualify the deprecation-warning coverage claims to match
the validator contract: in
website/docs/cli/commands/validate/validate-schema.mdx lines 59-61 and
website/docs/cli/commands/validate/validate-stacks.mdx lines 111-123, state that
warnings apply to deprecated fields in the supplied schema and locally resolved
$refs, excluding externally referenced fields or remote schemas that the scanner
does not inspect.
---
Nitpick comments:
In `@website/docs/cli/commands/validate/validate-stacks.mdx`:
- Around line 116-120: Replace the legacy Terminal wrapper around the “atmos
validate stacks” example with the subtree’s static CastPlayer convention, and
add the corresponding cast asset using the existing naming and placement
patterns for CLI documentation. Preserve the displayed command output, including
the deprecation warning.
🪄 Autofix (Beta)
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: 8f837aa5-fa2b-49c8-bb45-d6400506f000
📒 Files selected for processing (5)
docs/fixes/2026-07-24-document-schema-deprecation-warnings.mdwebsite/docs/cli/commands/validate/validate-schema.mdxwebsite/docs/cli/commands/validate/validate-stacks.mdxwebsite/docs/lsp/lsp-server.mdxwebsite/docs/stacks/settings/depends_on.mdx
- Fix-log doc said 7 failing subtests but named 6; correct the count to match (confirmed against the CI logs: 6 leaf-level subtest failures, 2 parent test-group rollups). - Qualify "applies to every schema"/"the same" coverage claims in validate-schema.mdx and validate-stacks.mdx: the scanner only resolves deprecated annotations via local $refs, so fields deprecated only in an externally referenced schema document validate without a warning. Addresses CodeRabbit threads PRRT_kwDOEW4XoM6TdMGB and PRRT_kwDOEW4XoM6TdPd- on PR #2793. Co-Authored-By: Claude Sonnet 5 <[email protected]>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #2793 +/- ##
==========================================
+ Coverage 81.77% 81.80% +0.02%
==========================================
Files 1791 1792 +1
Lines 172737 172940 +203
==========================================
+ Hits 141258 141467 +209
+ Misses 23680 23669 -11
- Partials 7799 7804 +5
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Check Markdown Links failed on 9 unrelated github.com URLs (issues, tree/blob links, releases, a user profile) all returning 502/504 in CI while resolving 200 outside it. Same class of GitHub-gateway flakiness already accepted for 500; extend the accept list rather than chase individual URLs that will just recur elsewhere next run. Co-Authored-By: Claude Sonnet 5 <[email protected]>
…es' into osterman/fix-terraform-1-224-rules
|
Tip Atmos Pro
No affected stacks workflow was detected for this pull request. |
|
These changes were released in v1.224.1-rc.0. |
what
why
references
Summary by CodeRabbit
depends_onreplacement guidance.depends_onhandling for legacy manifest layouts.