Repository navigation
Conversation
An unknown key in the workload YAML was reported by the strict YAML
decode, whose message names the Go struct ("field enviroment not found
in type aircmd.runConfig") and offers no hint.
Check the document's keys against the run config schema before decoding
and report each unknown key by its dotted path, with the closest valid
sibling and the `-h config` page that lists the fields.
Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
|
Commit: Regression test reportSelected 1 changed tests (limit=20, 0 not selected) 1 tests: regression=1 unreleased=0 coverage=0 failing=0
TestAccept/air/run: branch ✅ | main (532408b) ❌ | latest (v1.26.0) ❌main (532408b): latest (v1.26.0): |
✅ Integration test reportCommit: 9208ba8
Top 6 slowest tests (at least 2 minutes):
|
pardis-beikzadeh-db
left a comment
There was a problem hiding this comment.
This duplicates #7528: same feature, and the two conflict in all four files, so only one should land. Please sort out with @abdulkareem-db which one.
If it's this one, it needs one fix first (inline): a self-referencing list crashes the CLI with a stack overflow instead of an error.
Following an alias that points at its own ancestor recursed until the stack overflowed. Also keep the help pointer at the nearest documented field for keys below a hidden one. Co-authored-by: Isaac <no-reply@databricks.com>
|
Re the review: the self-referencing-list crash and the two other inline points are fixed in 92fbf89 (threads answered). On the overlap with #7528: acknowledged, I had not seen it when opening this. Which of the two lands is still to be agreed with its author, so please treat this PR as on hold for merge until then. Comment written by Isaac. |
Co-authored-by: Isaac <no-reply@databricks.com>
|
On the overlap with #7528: Dima has decided to go ahead with this PR as the one to land for CNXT-2554, so it is no longer on hold. @abdulkareem-db, flagging so the two don't both merge; anything from #7528 that is missing here (the list of valid fields, the CLI-upgrade hint) can follow as a separate change on top. Since the last review:
@pardis-beikzadeh-db this is ready for another look. Comment written by Isaac. |
Changes
An unknown key in an AIR workload YAML is now reported by its field path, with the closest valid field and the help page that lists the fields.
Before:
After:
unknown field "compute.acclerator_type"; did you mean "accelerator_type"? Run "databricks air run -h config.compute" ....loadRunConfignow checks the parsed document's keys againstconfigSchema()(the same schema walk behind-h config.<field>and--overridevalidation) before the strict decode. The strict decode stays in place, so nothing that was rejected before is accepted now. Keys under free-form maps (parameters,env_variables,secrets) are not checked, as before.visibleConfigChildNamesreplaces two copies of the "sorted documented children" loop.Why
CNXT-2554: the Go struct name means nothing to someone writing a workload YAML, and the old message gave no hint at the valid field.
Tests
cmd/air/runconfig_test.gofor top-level, nested, list/hidden-parent, no-match, multiple-key, and free-form-map cases. Three existing assertions that pinned the oldfield X not foundwording now pin the new message.acceptance/air/runwith the ticket's repro.go test ./cmd/air,go test ./acceptance -run 'TestAccept/air/',./task lint-q, and./task wspass locally.This pull request and its description were written by Isaac.