Skip to content

[Data Views as Code] Use ref_id and add metadata in data views schemas#261181

Merged
lukasolson merged 8 commits into
elastic:mainfrom
lukasolson:data_views_as_code/schema_meta
Apr 7, 2026
Merged

[Data Views as Code] Use ref_id and add metadata in data views schemas#261181
lukasolson merged 8 commits into
elastic:mainfrom
lukasolson:data_views_as_code/schema_meta

Conversation

@lukasolson
Copy link
Copy Markdown
Contributor

@lukasolson lukasolson commented Apr 3, 2026

Summary

Align the by-reference data view field name with other as-code patterns (ref_id vs. id), and add stable OAS component ids and titles so generated docs/refs are consistent.

This also fixes an issue with the OAS generation because we were doing const dataViewSchema = schema.discriminatedUnion() without the underlying types having meta.id.

Changes

  • Data view reference (data_view_reference): Rename property idref_id so the serialized shape matches the “reference id” naming used elsewhere in as-code APIs.

  • OAS generation duplication: Add meta.id / meta.title (and description where helpful) on schemas so OAS generation can reuse components and labels read clearly.

@lukasolson lukasolson self-assigned this Apr 3, 2026
@lukasolson lukasolson added Feature:Data Views Data Views code and UI - index patterns before 8.0 release_note:skip Skip the PR/issue when compiling release notes backport:skip This PR does not require backporting Team:DataDiscovery Discover, search (data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. t// Project:Dashboards API labels Apr 3, 2026
@lukasolson lukasolson changed the title [Data Views as Code] Add meta to data views schema to avoid OAS duplication [Data Views as Code] Use ref_id and add metadata in data views schemas Apr 3, 2026
@elasticmachine
Copy link
Copy Markdown
Contributor

elasticmachine commented Apr 3, 2026

💔 Build Failed

Failed CI Steps

Test Failures

  • [job] [logs] Jest Tests #6 / searchEmbeddableTransforms transformOut converts by-value stored state to DiscoverSession API shape with tabs
  • [job] [logs] Jest Tests #6 / searchEmbeddableTransforms transformOut converts by-value stored state to DiscoverSession API shape with tabs
  • [job] [logs] Jest Tests #5 / Serialization utils serialize state by value
  • [job] [logs] Jest Tests #5 / Serialization utils serialize state by value

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
discover 1.6MB 1.6MB +8.0B

History

cc @lukasolson

@lukasolson lukasolson marked this pull request as ready for review April 3, 2026 21:45
@lukasolson lukasolson requested a review from a team as a code owner April 3, 2026 21:45
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/kibana-data-discovery (Team:DataDiscovery)

@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
discover 1.6MB 1.6MB +8.0B

History

cc @lukasolson

@lukasolson lukasolson merged commit 41ee5c0 into elastic:main Apr 7, 2026
19 checks passed
mbondyra added a commit to Heenawter/kibana that referenced this pull request Apr 7, 2026
* commit 'bfc2446fdbcba2b3183f4518817c9757198c95ef':
  [Cascade] make cascade layout enabled by default (elastic#260698)
  [Dashboard Agent] Extract safe dashboard attachment integration refactors (elastic#261422)
  [One Workflow] Replace workflows:aiAgent:enabled with agentBuilder:experimentalFeatures (elastic#261330)
  [EDR Workflows] Osquery: hide query code from dropdown and show Elastic for automated Run By (elastic#261394)
  [Observability Onboarding] Add data detection & loading indicators to onboarding flows  (elastic#257870)
  [Significant events] Format event count with locale-aware number separators (elastic#261570)
  [Fleet] Fix deprecated filter in browse integrations (elastic#261459)
  [Lens as code] Split `xyStateSchema` config (elastic#261089)
  [Data Views as Code] Use `ref_id` and add metadata in data views schemas (elastic#261181)

Made-with: Cursor

# Conflicts:
#	x-pack/platform/packages/shared/dashboard-agent/dashboard-agent-common/types.ts
mbondyra added a commit to mbondyra/kibana that referenced this pull request Apr 7, 2026
…r-uid-to-id

* commit '6868ae2f195462f1f6809a6a544114f54e48239e':
  [One Workflow] Replace workflows:aiAgent:enabled with agentBuilder:experimentalFeatures (elastic#261330)
  [EDR Workflows] Osquery: hide query code from dropdown and show Elastic for automated Run By (elastic#261394)
  [Observability Onboarding] Add data detection & loading indicators to onboarding flows  (elastic#257870)
  [Significant events] Format event count with locale-aware number separators (elastic#261570)
  [Fleet] Fix deprecated filter in browse integrations (elastic#261459)
  [Lens as code] Split `xyStateSchema` config (elastic#261089)
  [Data Views as Code] Use `ref_id` and add metadata in data views schemas (elastic#261181)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting Feature:Data Views Data Views code and UI - index patterns before 8.0 Project:Dashboards API release_note:skip Skip the PR/issue when compiling release notes Team:DataDiscovery Discover, search (data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL. t// v9.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants