Skip to content

[As Code] Stringify zod panel warnings on dropped panels from dashboards#280806

Draft
nickpeihl wants to merge 101 commits into
elastic:mainfrom
nickpeihl:stringify-zod-panel-warnings
Draft

[As Code] Stringify zod panel warnings on dropped panels from dashboards#280806
nickpeihl wants to merge 101 commits into
elastic:mainfrom
nickpeihl:stringify-zod-panel-warnings

Conversation

@nickpeihl

@nickpeihl nickpeihl commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

To be merged after #268329

Summary

Stringify zod panel warnings on dropped panels from dashboards

Zod validation errors on panel transforms are returned as JSON objects which doesn't translate well in the warnings panel in the dashboard or in the warning array from the API endpoints. Fortunately, we have a zod helper to make the errors more pretty.

Note: The stringifyZodError helper also limits the number of reported errors to five and reports a count of the remaining errors.

Examples

Before:
Screenshot 2026-07-24 at 9 15 06 AM

After:

Screenshot 2026-07-24 at 9 27 47 AM

Before:
Screenshot 2026-07-24 at 9 40 08 AM

After:

Screenshot 2026-07-24 at 9 38 58 AM

nickofthyme and others added 30 commits May 13, 2026 09:51
Co-authored-by: Nick Partridge <nick.ryan.partridge@gmail.com>
nickofthyme and others added 29 commits July 21, 2026 14:27
When porting from @kbn/config-schema to Zod, the old config-schema
convention of `{ meta: { description: '...' } }` was carried over
verbatim. Zod's .meta() takes a flat object, so the extra `meta:` layer
was passed through z.toJSONSchema() as-is and emitted into OAS output
as an invalid `meta:` property, triggering additionalProperties errors.

Claude-Session: https://claude.ai/code/session_0192CGTMjJU7B5T5FRGEykcr
Co-authored-by: Nick Partridge <nick.ryan.partridge@gmail.com>
Converts allowHiddenIndicesSchema from @kbn/config-schema (unimported)
to z.boolean().optional().meta(), fixing a ReferenceError on startup
that caused all discover/as-code jobs to fail.

Claude-Session: https://claude.ai/code/session_0132ugcMCNCJZSqUGDsh8pPM
@infra-vault-gh-plugin-prod

Copy link
Copy Markdown
🤖 Jobs for this PR can be triggered through checkboxes. 🚧

ℹ️ To trigger the CI, please tick the checkbox below 👇

  • Click to trigger kibana-pull-request for this PR!
  • Click to trigger kibana-deploy-project-from-pr for this PR!
  • Click to trigger kibana-deploy-cloud-from-pr for this PR!
  • Click to trigger kibana-entity-store-performance-from-pr for this PR!
  • Click to trigger kibana-storybooks-from-pr for this PR!

Sign up for free to 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.

4 participants