Document Kanvas design validation events (pattern/validate)
Summary
Kanvas now records each design validation as a pattern/validate event in Meshery's events list (layer5labs/meshery-extensions#4401, built on meshery/schemas#1341 in @meshery/schemas v1.3.114). The user-facing Kanvas docs should describe these events.
What to document
When the validation runs (category pattern, action validate, severity informational), the event metadata contains:
designId,designName,designVersion(when the design has one), anddesignLink, an absolute URL that opens the design in the designer.status: one ofsuccess,partial,failedorerror. Kanvas currently sendssuccessorfailed.errorCount: the total number of validation errors.errors: up to 20 entries of{code, componentId}, wherecodeis the validation keyword.truncated: true when there were more than 20 errors, soerrorslists only the first 20.
When the validation cannot run (the validator returned no result or threw), Kanvas sends a severity error event with metadata status: "error" and error: {code, message}, plus the same identity fields and designLink. It has no errors, errorCount or truncated. The codes are:
validator-no-result: the validator returned no result.validator-exception: the validator failed while validating the design.
This status means the validation itself did not run; it does not mean the design failed validation.
Requires Meshery Server v1.0.58 or later.
References
- layer5labs/meshery-extensions#4401
- meshery/schemas#1341
Hi @yi-nuo426 , I’d like to take this. I’ve worked with Hugo/static docs sites and can add a section covering the pattern/validate events (success/failed vs. error status, metadata fields, the v1.0.58 requirement). Could you assign it to me?”
Thanks for picking this up, @jaydeep-99o - assigned to you. The distinction to keep sharp in the docs is success/failed (validation ran and produced a design result) versus error (validation itself did not run). Please open a PR against this issue when ready, and ask here if the right docs page is unclear.
Thanks for the review! I applied the wording change. On viewLink: #1373 lists designLink as the only link Kanvas sends today, so I documented just that. Happy to add viewLink if Kanvas starts writing it.
Right call on viewLink - the contract lists it as an optional operator view, and Kanvas does not send it today, so documenting designLink only is correct. I reviewed layer5io/docs#1374 and left one small suggestion there (a note that the 16 KB guard can drop the outcome fields). Apply that and I will approve and merge.
Applied, thanks!
Thanks for applying that so quickly, @jaydeep-99o. layer5io/docs#1374 is merged, which closes this issue. Nice first contribution to the Kanvas docs - the validation events page reads well now.