[Lens as Code] Use as code dataView schema#260914
Merged
Merged
Conversation
lukasolson
reviewed
Apr 2, 2026
Contributor
|
Pinging @elastic/kibana-visualizations (Team:Visualizations) |
lukasolson
approved these changes
Apr 3, 2026
Contributor
lukasolson
left a comment
There was a problem hiding this comment.
LGTM, added a couple very minor comments below.
Contributor
|
You will probably want to wait for #261181 to merge before this one, else the OAS generation will break. |
nickofthyme
approved these changes
Apr 6, 2026
Contributor
💚 Build Succeeded
Metrics [docs]Module Count
Public APIs missing comments
Async chunks
Page load bundle
History
|
florent-leborgne
added a commit
that referenced
this pull request
Apr 8, 2026
Align all YAML examples and overlay inline code with the schema rename from `dataset` to `data_source` (index→data_view_spec, dataView→data_view_reference, index→index_pattern, id→ref_id) that landed in main via #260914. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
florent-leborgne
added a commit
that referenced
this pull request
Apr 8, 2026
- Fix POST target path from /api/dashboards/{id} to /api/dashboards
- Align all YAML examples and overlay inline code with the schema rename
from `dataset` to `data_source` (index→data_view_spec, dataView→data_view_reference,
index→index_pattern, id→ref_id) that landed in main via #260914.
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
This was referenced Apr 8, 2026
florent-leborgne
added a commit
that referenced
this pull request
Apr 9, 2026
Align all YAML examples and overlay inline code with the schema rename from `dataset` to `data_source` (index→data_view_spec, dataView→data_view_reference, index→index_pattern, id→ref_id) that landed in main via #260914. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
florent-leborgne
added a commit
that referenced
this pull request
Apr 9, 2026
- Fix POST target path from /api/dashboards/{id} to /api/dashboards
- Align all YAML examples and overlay inline code with the schema rename
from `dataset` to `data_source` (index→data_view_spec, dataView→data_view_reference,
index→index_pattern, id→ref_id) that landed in main via #260914.
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix #260031
Uses the As Code DataView schema from
@kbn/as-code-data-views-schema.I've also aligned the
datasetschema property todata_sourceas also used in discover sessions.Better to review the first commit, then the second one as I wasn't able to make git happy with the rename and editing of the
dataset.tsanddataset.test.tsfile. The second commitjust contains the file rename and associated changes
I have touched the code in the
@kbn/data-views-schemapackage to detach its dependency to the@kbn/data-views-pluginfor one specific reason:the
unified_doc_viewerwas already an indirect consumer of Lensconfig-buildercode, and this PR made that path start pulling in@kbn/data-views-plugin/commonat runtime through the new shared data-view schema.This turned an existing package usage into an undeclared browser-bundle dependency.
So instead of adding the
data viewsplugin as required plugin in theunified_doc_viewerI've thought it was better to split the logic in the as-code package. To avoid creating yet another package for the constants, to keep the changes to a minimal set, I've exported just the types of the constants and recreated the constants in the as-code-data-view package.