Skip to content

Feat #3: ucm validate + schema (M0) - #4

Merged
micheledaddetta-databricks merged 1 commit into
mainfrom
feat/3-validate-schema
Apr 21, 2026
Merged

Feat #3: ucm validate + schema (M0)#4
micheledaddetta-databricks merged 1 commit into
mainfrom
feat/3-validate-schema

Conversation

@micheledaddetta-databricks

Copy link
Copy Markdown
Owner

Closes#3.

Summary

  • Adds ucm/ engine scaffolding: config loader (dyn-backed Root, target merge), mutator chain (DefineDefaultTarget, SelectDefaultTarget, SelectTarget, ValidateTags), phases (Load*, Validate, PolicyCheck), and a minimal Ucm struct tracking RootPath, Config, and the selected Target.
  • Adds resources/ types for the M0 slice: Catalog, Schema, Grant, TagValidationRule.
  • Wires real ucm validate and ucm schema verbs under cmd/ucm/, replacing the stubs from Scaffold ucm subcommand with verb stubs and gitops workflow #1. validate runs the full mutator chain, returns ErrAlreadyPrinted on diagnostics, and supports --strict to fail on warnings. schema prints the JSON schema generated from the typed config.Root via libs/jsonschema.FromType.
  • Adds fixture-driven tests under cmd/ucm/testdata/ (valid/, missing_tag/) plus unit tests per mutator. Mutator coverage is 94.6%.

Why

This is the M0 slice of the fork: the first end-to-end path that can load a ucm.yml, apply mutators (including tag policy enforcement), and fail CI on violations. Interpolation, cloud resources, and TF wiring are deliberately out of scope and land in M1+.

Test plan

  • go build ./...
  • go vet ./...
  • go test ./ucm/... ./cmd/ucm/... (all pass; ucm/config/mutator at 94.6% coverage)
  • Happy path smoke: ./databricks ucm validate on cmd/ucm/testdata/validValidation OK!
  • Missing-tag smoke: ./databricks ucm validate on cmd/ucm/testdata/missing_tag → exits non-zero with file:line:col diagnostic
  • Disallowed-value smoke: fixture with bad classification → diagnostic points to the offending path
  • ./databricks ucm schema → valid JSON describing resources.Catalog, resources.TagValidationRule, etc.
  • No edits to cmd/cmd.go or other upstream files

This pull request and its description were written by Isaac.

Closes#3.
Wire up real `ucm validate` and `ucm schema` verbs on a minimal UC
resource set (catalogs, schemas, grants, tag_validation_rules). Adds
the ucm engine scaffolding (config loader, mutator chain, phases) and
a fixture-driven test harness.
Why: M0 milestone — first end-to-end slice of the fork that can load a
ucm.yml, apply the mutator chain (including tag validation), and fail
CI on policy violations. No interpolation, cloud resources, or TF
wiring yet — those land in M1+.
No upstream files modified; `cmd/cmd.go` already wires the ucm subtree
from issue #1.
Co-authored-by: Isaac
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

M0: Implement ucm validate + schema on sample ucm.yml

1 participant

@micheledaddetta-databricks