Skip to content

fix: correct out-of-date atmos-manifest workflow schema (#2708) - #2710

Merged
Andriy Knysh (aknysh) merged 2 commits into
cloudposse:mainfrom
sgtoj:fix/schema-workflow-2708
Jul 9, 2026
Merged

Andriy Knysh (aknysh) merged 2 commits into
cloudposse:mainfrom
sgtoj:fix/schema-workflow-2708

Conversation

@sgtoj

@sgtoj Brian Ojeda (sgtoj) commented Jul 9, 2026 •

Copy link
Copy Markdown
Contributor

what

  • Bring the published atmos-manifest JSON Schema (served at atmos.tools and mirrored to SchemaStore) back in sync with the workflow features shipped in 1.222.0, so editors using # yaml-language-server: $schema=… stop drawing false-positive errors on valid workflows.
  • workflow_manifest (the object under each named workflow): add the 7 missing workflow-definition fields — dependencies, working_directory, env, container, output, viewport, show (reusing the existing dependencies definition via $ref).
  • workflow_step: add the 75 missing step fields with descriptions, spanning every step-type family (options/default/interactive/tty/script, plus http, cast, container, style, log, say, env, exit, emulator, junit, require, workdir, table, control/parallel). Set additionalProperties: true and make level a plain string (see why).
  • Add three shared sub-definitions: workflow_viewport, workflow_show, workflow_container (the latter also accepts false to run on the host).
  • Add a reflection-based ratchet test (schema_workflow_coverage_test.go) that fails the build if a WorkflowStep/WorkflowDefinition field is ever authored without a matching schema property — the same "you can't forget the schema" pattern already used for top-level/component sections.
  • Add regression tests (schema_workflow_validation_test.go) reproducing the issue's exact snippets, covering one field from every step-type family, all workflow-level fields, and confirming typed fields (e.g. options, code) are still validated.

why

  • The issue named three rejected fields (dependencies, options, default), but the schema had drifted far more broadly: it modeled only 21 of ~96 authored step fields and 3 of 10 workflow-definition fields, both with additionalProperties: false. Any workflow using a newer field produced misleading "Property X is not allowed" red squiggles on config that Atmos parses and runs correctly.
  • I validated the updated schema against all 60 real workflow files in the repo. That surfaced two ways the old strict schema over-tightened against shipped examples: an ignored/unknown key, and level: values outside a log-level set. Workflow steps are a lenient, polymorphic union of ~30 step types and Atmos ignores unknown keys at runtime, so additionalProperties: true (plus fully enumerated known fields for autocomplete + type checks) matches real behavior and eliminates the whole false-positive class — present and future — mirroring how providers/templates are modeled. level is a plain string field, so it is no longer constrained by an enum.
  • The ratchet test makes this drift a build failure going forward, so the published schema can't silently fall behind the structs again.
  • Scope is intentionally the published (website/SchemaStore) schema; the embedded schemas do not model workflow steps and atmos validate stacks is unchanged.

references

  • Closes Published atmos-manifest JSON Schema is out-of-date (1.222.0 features) #2708
  • Follow-ups discovered while validating real workflows (out of scope here, worth separate issues):
    • examples/quick-start-advanced/stacks/workflows/{backend,validation}.yaml (and the mirrored doc) use command: true — an unquoted-YAML-boolean footgun where a string command belongs; the schema correctly flags it.
    • Dedicated schemas for custom-command files (commands:) and profile files (auth:) — the issue's "ideally" ask; purely additive (no false-positives today) and a larger separate effort.

)

The published atmos-manifest JSON Schema modeled only 21 of ~96 authored workflow_step fields and 3 of 10 workflow_manifest fields under additionalProperties:false, so editors using the published $schema flagged valid 1.222.0 workflows (e.g. dependencies.tools, interactive choose/input steps).

- Add all missing workflow_step (75) and workflow_manifest (7) fields with descriptions.
- Set workflow_step additionalProperties:true (lenient, polymorphic step union) and make level a plain string.
- Add shared workflow_viewport/workflow_show/workflow_container definitions.
- Add a reflection ratchet test to prevent future drift, plus regression tests for the issue's snippets and every step-type family.
@sgtoj
Brian Ojeda (sgtoj) requested a review from a team as a code owner July 9, 2026 15:31
@atmos-pro

atmos-pro Bot commented Jul 9, 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.

@github-actions github-actions Bot added the size/m Medium size PR label Jul 9, 2026
@sgtoj

Copy link
Copy Markdown
Contributor Author

Intended semver label: patch (user-visible bug fix to the published schema; not a new feature, not breaking). Per the release-docs policy, patch requires no blog post or roadmap update. Flagging here since external contributors can't self-apply labels — could a maintainer add patch so the PR Semver Labels gate passes? Thanks!

@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Updates the atmos-manifest JSON schema to add missing workflow_manifest and workflow_step properties (dependencies, env, container, output, viewport, show, options, default, etc.), relaxes workflow_step additionalProperties, and adds Go tests enforcing schema coverage and validation regressions.

Changes

Workflow schema catch-up

Layer / File(s) Summary
Expand atmos-manifest JSON schema
website/static/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json
Adds new workflow_manifest fields (working_directory, dependencies, env, container, output, viewport, show), new definitions (workflow_viewport, workflow_show, workflow_container), extends workflow_step with many step-type properties, flips additionalProperties to true, and rewrites the prompt/simulate allOf conditional.
Schema coverage ratchet tests
pkg/datafetcher/schema_workflow_coverage_test.go
Reflects over WorkflowStep and WorkflowDefinition YAML tags plus polymorphic keys, and asserts each authored key exists as a schema property, failing with sorted missing-field reports.
Schema validation regression tests
pkg/datafetcher/schema_workflow_validation_test.go
Adds tests confirming dependencies.tools, choose/input defaults, workflow-level fields, and unknown step fields validate correctly, while invalid typed values (choose.options, exit.code) are rejected.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

  • cloudposse/atmos#2114: Adds the workflow_retry definition and wires retry into workflow_step, matching this PR's coverage checks.
  • cloudposse/atmos#2635: Adds parallel/matrix control-step fields (needs, output, background, for, matrix/steps) that this PR's coverage tests directly target.

Suggested labels: no-release

Suggested reviewers: aknysh, osterman

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and accurately describes the main change to the atmos-manifest workflow schema.
Linked Issues check ✅ Passed The schema updates and regression tests cover the reported workflow-level dependencies and step fields, matching #2708.
Out of Scope Changes check ✅ Passed The added tests and schema expansions stay within the manifest schema fix and don't introduce unrelated changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

🧹 Nitpick comments (2)
website/static/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json (2)

1885-2481: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Step-field expansion aligns well with WorkflowStep; a few enumerable fields could use enum.

The new workflow_step properties (options, default, placeholder, source, viewport, background oneOf string/boolean, for oneOf string/array, etc.) match the Go struct shapes shown in pkg/schema/workflow.go, and additionalProperties: true correctly matches the PR's intent to stop rejecting unmodeled/future keys. A couple of fields document an exact value set in their description but aren't constrained with enum, unlike sibling definitions elsewhere in this same file (backend_type, output.mode, fail.mode):

♻️ Example: tighten `method` and `print`
         "method": {
           "type": "string",
-          "description": "HTTP method for the http step type: GET (default), POST, PUT, PATCH, DELETE, HEAD, or OPTIONS."
+          "description": "HTTP method for the http step type: GET (default), POST, PUT, PATCH, DELETE, HEAD, or OPTIONS.",
+          "enum": ["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"]
         },
...
         "print": {
           "type": "string",
-          "description": "Print policy for the say step type: fallback (default), always, or never."
+          "description": "Print policy for the say step type: fallback (default), always, or never.",
+          "enum": ["fallback", "always", "never"]
         },

Since additionalProperties: true already prevents rejection of unknown keys, adding enum to already-typed fields only tightens value validation — it won't reintroduce the false-positive class this PR fixes.

🤖 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/static/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json` around
lines 1885 - 2481, The new workflow_step schema in the `workflow_step`
definition should be tightened by adding enum constraints to fields whose
descriptions already specify a fixed set of values, such as `method`, `print`,
and any similar scalar fields in this block. Update the corresponding properties
in `workflow_step` to use `enum` while keeping `additionalProperties: true`
unchanged so unknown keys remain accepted, and verify the constrained values
stay aligned with the behavior modeled by `WorkflowStep` and the other schema
definitions like `output.mode` and `fail.mode`.

1736-1884: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

New shared definitions look correct; consider enum for small fixed-vocabulary fields.

workflow_viewport, workflow_show, and workflow_container correctly mirror the tri-state/boolean and container-config shapes described. One improvement opportunity: workflow_container.pull documents an exact value set ("always, missing, or never") but is typed as a bare string — an enum here would catch typos without reintroducing the false-positive problem this PR is fixing (enums only constrain the value of an already-declared key, they don't reject unknown keys).

♻️ Example: tighten `pull`
             "pull": {
               "type": "string",
-              "description": "Image pull policy: always, missing, or never."
+              "description": "Image pull policy: always, missing, or never.",
+              "enum": ["always", "missing", "never"]
             },
🤖 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/static/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json` around
lines 1736 - 1884, The shared schema definitions for workflow settings look
good, but the workflow_container.pull field is still too loose because it is a
plain string even though only a small fixed set of values is valid. Update
workflow_container in the manifest schema to use an enum for pull, keeping the
existing oneOf/include/object structure intact, and leave the other fields like
workflow_viewport, workflow_show, and the container object unchanged.
🤖 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.

Nitpick comments:
In `@website/static/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json`:
- Around line 1885-2481: The new workflow_step schema in the `workflow_step`
definition should be tightened by adding enum constraints to fields whose
descriptions already specify a fixed set of values, such as `method`, `print`,
and any similar scalar fields in this block. Update the corresponding properties
in `workflow_step` to use `enum` while keeping `additionalProperties: true`
unchanged so unknown keys remain accepted, and verify the constrained values
stay aligned with the behavior modeled by `WorkflowStep` and the other schema
definitions like `output.mode` and `fail.mode`.
- Around line 1736-1884: The shared schema definitions for workflow settings
look good, but the workflow_container.pull field is still too loose because it
is a plain string even though only a small fixed set of values is valid. Update
workflow_container in the manifest schema to use an enum for pull, keeping the
existing oneOf/include/object structure intact, and leave the other fields like
workflow_viewport, workflow_show, and the container object unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 848b861a-a283-4473-ada7-d8966dc9d1c4

📥 Commits

Reviewing files that changed from the base of the PR and between ef726e1 and 09fadc8.

📒 Files selected for processing (3)
  • pkg/datafetcher/schema_workflow_coverage_test.go
  • pkg/datafetcher/schema_workflow_validation_test.go
  • website/static/schemas/atmos/atmos-manifest/1.0/atmos-manifest.json

@aknysh Andriy Knysh (aknysh) added the patch A minor, backward compatible change label Jul 9, 2026
@aknysh
Andriy Knysh (aknysh) merged commit a3e5d53 into cloudposse:main Jul 9, 2026
79 of 80 checks passed
@atmos-pro

atmos-pro Bot commented Jul 9, 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.

@github-actions

Copy link
Copy Markdown

These changes were released in v1.223.0-rc.7.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

patch A minor, backward compatible change size/m Medium size PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Published atmos-manifest JSON Schema is out-of-date (1.222.0 features)

2 participants