docs icon indicating copy to clipboard operation
docs copied to clipboard

Document Kanvas design validation events (pattern/validate)

Open yi-nuo426 opened this issue 3 weeks ago • 6 comments

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), and designLink, an absolute URL that opens the design in the designer.
  • status: one of success, partial, failed or error. Kanvas currently sends success or failed.
  • errorCount: the total number of validation errors.
  • errors: up to 20 entries of {code, componentId}, where code is the validation keyword.
  • truncated: true when there were more than 20 errors, so errors lists 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

yi-nuo426 avatar Nov 05 '26 00:11 yi-nuo426

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?”

jaydeep-99o avatar Nov 05 '26 03:11 jaydeep-99o

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.

yi-nuo426 avatar Nov 05 '26 03:11 yi-nuo426

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.

jaydeep-99o avatar Nov 06 '26 03:11 jaydeep-99o

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.

yi-nuo426 avatar Nov 06 '26 03:11 yi-nuo426

Applied, thanks!

jaydeep-99o avatar Nov 06 '26 03:11 jaydeep-99o

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.

yi-nuo426 avatar Nov 06 '26 03:11 yi-nuo426