Skip to content

feat(core): add experimantal cli arg to validate manifest - #9721

Merged
olblak merged 14 commits into
updatecli:mainfrom
olblak:issue/1001
Jul 31, 2026
Merged

feat(core): add experimantal cli arg to validate manifest#9721
olblak merged 14 commits into
updatecli:mainfrom
olblak:issue/1001

Conversation

@olblak

@olblak olblak commented Jul 28, 2026

Copy link
Copy Markdown
Member

Fix #1001

Add a function to validate manifest.
This is currently experimental to see if it solves the problem.

Test

To test this pull request, you can run the following commands:

make test

Additional Information

Checklist

  • I have updated the documentation via pull request in website repository.

Tradeoff

Potential improvement

Signed-off-by: Olblak <me@olblak.com>
@olblak olblak added enhancement New feature or request core All things related to Updatecli core engine labels Jul 28, 2026
@olblak
olblak requested a review from Copilot July 28, 2026 06:49

Copilot AI 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.

Pull request overview

This PR introduces an experimental manifest schema validation capability intended to catch misspelled/unknown keys (and other schema mismatches) before manifests are committed or executed, aligning with the request in #1001.

Changes:

  • Add schema compilation/validation helpers and a manifest-oriented validator that validates resources “by kind” for more precise errors.
  • Add updatecli manifest validate (experimental) plus wiring to optionally validate schemas during other commands via a shared --validate-schema flag.
  • Adjust resource specs / e2e fixtures to match the schema (e.g., conditional url requirement, dockerimage versionfilter shape).

Reviewed changes

Copilot reviewed 40 out of 40 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
pkg/plugins/resources/gittag/main.go Loosens schema “required” tagging for url to reflect conditional requirement.
pkg/plugins/resources/gitbranch/main.go Loosens schema “required” tagging for url to reflect conditional requirement.
pkg/core/pipeline/scm/config.go Extracts SCM kind→spec mapping for reuse (schema + validator).
pkg/core/pipeline/autodiscovery/main.go Includes crawler aliases in autodiscovery spec mapping for schema/validation.
pkg/core/pipeline/action/main.go Extracts action kind→spec mapping for reuse (schema + validator).
pkg/core/jsonschema/validate.go Adds generic validator error flattening + YAML normalization.
pkg/core/jsonschema/main.go Makes comment-map retrieval/cache optional so schemas can be built at runtime without cloning repo.
pkg/core/jsonschema/main_test.go Adds coverage ensuring schema generation works without code comments available.
pkg/core/jsonschema/compile.go Adds schema compilation helper that pins draft and strips $schema.
pkg/core/jsonschema/compile_test.go Adds tests validating compilation behavior is draft-independent.
pkg/core/engine/manifest_validate.go Adds engine entrypoint for validating manifests and aggregating problems.
pkg/core/engine/configuration.go Refactors default-manifest detection and wires ValidateSchema option into config loading.
pkg/core/config/schemavalidate.go Implements manifest schema validation with layered checks and per-kind spec validation.
pkg/core/config/schemavalidate_value.go Adds helpers for case-normalization and “did you mean” suggestions.
pkg/core/config/schemavalidate_test.go Adds unit tests for manifest schema validation behavior and messages.
pkg/core/config/schemavalidate_registry.go Builds/compiles schema registry and per-section/per-kind schemas.
pkg/core/config/schemavalidate_registry_test.go Ensures every supported kind compiles and mappings stay in sync.
pkg/core/config/schemavalidate_problem.go Defines SchemaProblem/SchemaReport types and formatting/helpers.
pkg/core/config/schemavalidate_corpus_test.go Validates shipped manifest corpus against schema to prevent regressions.
pkg/core/config/main.go Makes manifest name optional in schema; adds ValidateSchema + OnSchemaProblem options and hooks validation into config loading.
pkg/core/compose/schemavalidate.go Adds optional compose schema validation (single-schema validation path).
pkg/core/compose/schemavalidate_test.go Adds tests for compose schema validation output.
pkg/core/compose/file.go Hooks compose schema validation before post-processing defaults.
go.mod Adds direct deps for Levenshtein suggestions and jsonschema validator.
e2e/venom.d/test_manifest_validate.yaml Adds e2e test suite for updatecli manifest validate.
e2e/updatecli.d/success.d/golang/gomod.yaml Updates fixture to remove schema-invalid kind field in spec.
e2e/updatecli.d/success.d/dockerimage.yaml Updates fixture to match schema-required versionfilter structure.
e2e/updatecli.d/invalid.d/typos.yaml Adds an intentionally-invalid manifest to assert error reporting.
e2e/scripts/test_manifest_validate.bash Adds e2e helper script for validating deprecated manifests.
e2e/scripts/test_manifest_validate_invalid.bash Adds e2e helper script expecting validation failure (inverted exit).
cmd/root.go Wires new manifest/validate run target and global --validate-schema backing var.
cmd/pipeline_diff.go Adds shared --validate-schema flag wiring for pipeline diff.
cmd/pipeline_apply.go Adds shared --validate-schema flag wiring for pipeline apply.
cmd/manifest_validate.go Adds experimental updatecli manifest validate command and flags.
cmd/flags.go Adds shared --validate-schema flag with env default.
cmd/env.go Adds UPDATECLI_VALIDATE_SCHEMA env var.
cmd/diff.go Adds shared --validate-schema flag wiring for deprecated diff command.
cmd/compose_diff.go Adds shared --validate-schema flag wiring + compose schema validation toggle.
cmd/compose_apply.go Adds shared --validate-schema flag wiring + compose schema validation toggle.
cmd/apply.go Adds shared --validate-schema flag wiring for deprecated apply command.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pkg/core/jsonschema/validate.go
Comment thread pkg/core/config/schemavalidate.go
Comment thread pkg/core/pipeline/autodiscovery/main.go
@olblak
olblak enabled auto-merge (squash) July 28, 2026 15:00
@mergify

mergify Bot commented Jul 30, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@olblak
olblak merged commit d988ea3 into updatecli:main Jul 31, 2026
8 checks passed
@olblak olblak changed the title feat(core): add function to validate manifest feat(core): add experimantal cli arg to validate manifest Aug 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core All things related to Updatecli core engine enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Add Command to validate manifest

2 participants