Skip to content

[Lens as code] Config builder cleanup and improvements#262871

Merged
Ikuni17 merged 13 commits intoelastic:mainfrom
nickofthyme:lens-config-builder-cleanup
Apr 20, 2026
Merged

[Lens as code] Config builder cleanup and improvements#262871
Ikuni17 merged 13 commits intoelastic:mainfrom
nickofthyme:lens-config-builder-cleanup

Conversation

@nickofthyme
Copy link
Copy Markdown
Contributor

@nickofthyme nickofthyme commented Apr 13, 2026

Summary

This PR is a widespread cleanup related to @kbn/lens-embeddable-utils

  • Using Config naming over State naming
  • Using simplified path imports from @kbn/lens-embeddable-utils not deeper directories
  • Unifies type naming with schemas

Note

This should have no functional affect on the code

Checklist

  • Documentation was added for features that require explanation or tutorials
  • Unit or functional tests were updated or added to match the most common scenarios
  • The PR description includes the appropriate Release Notes section, and the correct release_note:* label is applied per the guidelines
  • Review the backport guidelines and apply applicable backport:* labels.

@nickofthyme nickofthyme added release_note:skip Skip the PR/issue when compiling release notes backport:skip This PR does not require backporting labels Apr 13, 2026
@nickofthyme nickofthyme requested review from a team as code owners April 13, 2026 17:39
@botelastic botelastic Bot added the ci:project-deploy-observability Create an Observability project label Apr 13, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

@nickofthyme nickofthyme force-pushed the lens-config-builder-cleanup branch from eca5114 to 8da34f5 Compare April 13, 2026 17:43
Copy link
Copy Markdown
Contributor

@nreese nreese left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kibana-presentation changes LGTM - import change only
code review only

@nickofthyme nickofthyme added backport:version Backport to applied version labels v9.4.0 v9.5.0 and removed backport:skip This PR does not require backporting labels Apr 13, 2026
Copy link
Copy Markdown
Contributor

@cauemarcondes cauemarcondes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Obs exploration changes LGTM

Copy link
Copy Markdown
Contributor

@janmonschke janmonschke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kibana-cases changes lgtm (only code review)

@nickofthyme nickofthyme removed the ci:project-deploy-observability Create an Observability project label Apr 15, 2026
@botelastic botelastic Bot added the ci:project-deploy-observability Create an Observability project label Apr 15, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

@nickofthyme
Copy link
Copy Markdown
Contributor Author

@elastic/obs-presentation-team, @elastic/obs-ai-team, @elastic/appex-ai-infra, @elastic/workchat-eng could your review these naming changes? Thanks!

@andrimal andrimal self-requested a review April 16, 2026 08:37
Copy link
Copy Markdown
Contributor

@andrimal andrimal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes LGTM ✨

One nit note: I checked that there are 2 more files with deep imports that maybe we could fix

  • x-pack/platform/plugins/shared/lens/common/transforms/transform_out.test.ts
  • x-pack/platform/packages/shared/agent-builder/agent-builder-genai-utils/tools/visualization/chart_type_registry.ts

@elasticmachine
Copy link
Copy Markdown
Contributor

elasticmachine commented Apr 20, 2026

💚 Build Succeeded

  • Buildkite Build
  • Commit: d9fe40b
  • Kibana Serverless Image: docker.elastic.co/kibana-ci/kibana-serverless:pr-262871-d9fe40b24709

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
agentBuilder 1381 1382 +1
dashboard 1121 1122 +1
dashboardAgent 611 612 +1
discover 2002 2003 +1
infra 1861 1862 +1
unifiedDocViewer 955 956 +1
total +6

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
@kbn/lens-embeddable-utils 81 164 +83

Any counts in public APIs

Total count of every any typed public API. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats any for more detailed information.

id before after diff
@kbn/lens-embeddable-utils 0 3 +3

Async chunks

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

id before after diff
dashboardAgent 387.5KB 387.5KB -6.0B
lens 2.0MB 2.0MB +1.4KB
total +1.3KB

Public APIs missing exports

Total count of every type that is part of your API that should be exported but is not. This will cause broken links in the API documentation system. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats exports for more detailed information.

id before after diff
@kbn/lens-embeddable-utils 4 5 +1

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
lens 83.8KB 83.9KB +89.0B
Unknown metric groups

API count

id before after diff
@kbn/lens-embeddable-utils 86 183 +97

History

@elastic-vault-github-plugin-prod
Copy link
Copy Markdown
Contributor

Run Metadata

  • Triggered by: Issue #239
  • Elasticsearch image tag: 9.5.0-SNAPSHOT
  • Kibana image: docker.elastic.co/kibana-ci/kibana-serverless:pr-262871-d9fe40b24709
  • Date: 2026-04-20
  • PR: elastic/kibana#262871 — [Lens as code] Config builder cleanup and improvements
  • Mode: PR-targeted (journeys generated from PR diff)
  • Journeys executed: 8
  • Passed: 8
  • Errored: 0
  • Findings: 0 bugs, 0 warnings, 0 info

Findings

No findings -- all journeys completed without issues.


Screenshots

Screenshots are available in the workflow artifacts.


Workflow run: https://github.com/elastic/kibana-exploratory-testing/actions/runs/24677418852

@Ikuni17 Ikuni17 merged commit 9e06771 into elastic:main Apr 20, 2026
17 checks passed
@kibanamachine
Copy link
Copy Markdown
Contributor

Starting backport for target branches: 9.4

https://github.com/elastic/kibana/actions/runs/24681411892

@nickofthyme nickofthyme deleted the lens-config-builder-cleanup branch April 20, 2026 17:45
@kibanamachine
Copy link
Copy Markdown
Contributor

💔 All backports failed

Status Branch Result
9.4 Backport failed because of merge conflicts

You might need to backport the following PRs to 9.4:
- [Lens as Code] Revert heatmap 'axes' property to 'axis' (#263784)

Manual backport

To create the backport manually run:

node scripts/backport --pr 262871

Questions ?

Please refer to the Backport tool documentation

@nickofthyme
Copy link
Copy Markdown
Contributor Author

💚 All backports created successfully

Status Branch Result
9.4

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

justinkambic added a commit to justinkambic/kibana that referenced this pull request Apr 20, 2026
The lens entry bundle was 72-83B over its 86,000B page-load limit after
rebasing this branch on main. Nothing in this PR's scope
(kbn-unified-chart-section-viewer + one Discover test spec) can reach
lens's bundle — a codebase-wide grep shows zero imports of
@kbn/unified-chart-section-viewer from x-pack/platform/plugins/shared/lens,
and a local dist build's stats.json contains no matching module paths.

Cumulative drift from recent Lens-as-code commits that merged into main
(e.g., elastic#262871, elastic#264134, elastic#261581, elastic#264147, elastic#263810) pushed the entry
bundle just over the line. Raising the limit here is the documented
path when no in-PR contribution is found.

Limit set via `node scripts/build_kibana_platform_plugins --focus lens --update-limits`.
nickofthyme added a commit that referenced this pull request Apr 21, 2026
#264501)

# Backport

This will backport the following commits from `main` to `9.4`:
- [[Lens as code] Config builder cleanup and improvements
(#262871)](#262871)

<!--- Backport version: 11.0.1 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Nick
Partridge","email":"nicholas.partridge@elastic.co"},"sourceCommit":{"committedDate":"2026-04-20T17:43:57Z","message":"[Lens
as code] Config builder cleanup and improvements (#262871)\n\n##
Summary\n\nThis PR is a widespread cleanup related to
`@kbn/lens-embeddable-utils`\n\n- Using `Config` naming over `State`
naming\n- Using simplified path imports from
`@kbn/lens-embeddable-utils` not\ndeeper directories\n- Unifies type
naming with schemas\n\n> [!NOTE]\n> This should have no functional
affect on the code \n\n### Checklist\n-
[x]\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\nwas
added for features that require explanation or tutorials\n- [x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [x] The PR
description includes the appropriate Release Notes section,\nand the
correct `release_note:*` label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n-
[x] Review the
[backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand
apply applicable `backport:*`
labels.","sha":"9e0677119558fbed2e6b3b2994535cbaa9d7b422","branchLabelMapping":{"^v9.5.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","ci:project-deploy-observability","backport:version","v9.4.0","v9.5.0"],"title":"[Lens
as code] Config builder cleanup and
improvements","number":262871,"url":"https://github.com/elastic/kibana/pull/262871","mergeCommit":{"message":"[Lens
as code] Config builder cleanup and improvements (#262871)\n\n##
Summary\n\nThis PR is a widespread cleanup related to
`@kbn/lens-embeddable-utils`\n\n- Using `Config` naming over `State`
naming\n- Using simplified path imports from
`@kbn/lens-embeddable-utils` not\ndeeper directories\n- Unifies type
naming with schemas\n\n> [!NOTE]\n> This should have no functional
affect on the code \n\n### Checklist\n-
[x]\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\nwas
added for features that require explanation or tutorials\n- [x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [x] The PR
description includes the appropriate Release Notes section,\nand the
correct `release_note:*` label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n-
[x] Review the
[backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand
apply applicable `backport:*`
labels.","sha":"9e0677119558fbed2e6b3b2994535cbaa9d7b422"}},"sourceBranch":"main","suggestedTargetBranches":["9.4"],"targetPullRequestStates":[{"branch":"9.4","label":"v9.4.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.5.0","branchLabelMappingKey":"^v9.5.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/262871","number":262871,"mergeCommit":{"message":"[Lens
as code] Config builder cleanup and improvements (#262871)\n\n##
Summary\n\nThis PR is a widespread cleanup related to
`@kbn/lens-embeddable-utils`\n\n- Using `Config` naming over `State`
naming\n- Using simplified path imports from
`@kbn/lens-embeddable-utils` not\ndeeper directories\n- Unifies type
naming with schemas\n\n> [!NOTE]\n> This should have no functional
affect on the code \n\n### Checklist\n-
[x]\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\nwas
added for features that require explanation or tutorials\n- [x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [x] The PR
description includes the appropriate Release Notes section,\nand the
correct `release_note:*` label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n-
[x] Review the
[backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand
apply applicable `backport:*`
labels.","sha":"9e0677119558fbed2e6b3b2994535cbaa9d7b422"}}]}]
BACKPORT-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:version Backport to applied version labels ci:project-deploy-observability Create an Observability project release_note:skip Skip the PR/issue when compiling release notes v9.4.0 v9.5.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants