Commit 91e5b58
committed
Fix cligen schema walker to recurse through nested array items
The request/response field-tree walker only unwrapped one array level
before checking whether the element schema was an object, so a nested
array field like an OR-of-AND filter tree (array<array<object>>) never
expanded its item fields the way a plain array<object> field did — and
its rendered type label collapsed to the uninformative "array<array>".
Both --help and the skill-card generator read from this same walker, so
every filters/source_filters/target_filters field across silence,
escalate, inhibit, and unsubscribe rules (and any other nested-array
field) silently dropped its key/oper/vals schema.
Generalize the array case to unwrap items through any depth of nested
arrays (bounded, not per-command special-cased) before testing for an
object leaf, and apply the same fix to the type-label formatter. Add
unit tests covering the nested-object, nested-scalar, and single-level
regression cases.
Also rewrite the channel card's maintenance-silence example, which
built a rule with only a time window — servers reject that as having no
matching scope — and add a general rule for constructing `filters` from
an incident's own labels (severity + distinguishing labels, with the
value/key exclusions and key vocabulary needed to avoid silently
building a rule that never matches).1 parent eace839 commit 91e5b58
6 files changed
Lines changed: 239 additions & 39 deletions
File tree
- internal
- cli
- cmd/cligen
- skills/flashduty/reference
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments