Skip to content

[8.19] move kbn-client into its own package (#258963)#259156

Merged
dmlemeshko merged 9 commits intoelastic:8.19from
dmlemeshko:backport/8.19/pr-258963
Mar 27, 2026
Merged

[8.19] move kbn-client into its own package (#258963)#259156
dmlemeshko merged 9 commits intoelastic:8.19from
dmlemeshko:backport/8.19/pr-258963

Conversation

@dmlemeshko
Copy link
Copy Markdown
Contributor

Backport

This will backport the following commits from main to 8.19:

Questions ?

Please refer to the Backport tool documentation

## Summary

Extracts the Kibana tooling HTTP client (`KbnClient` and related
helpers) from `@kbn/test` into a dedicated `@kbn/kbn-client` package.
`@kbn/test` continues to re-export the same symbols so existing `import
{ … } from '@kbn/test'` call sites keep working.

### Why

- Smaller, clearer dependency graph for tools that only need a Kibana
HTTP client (e.g. `Scout`, `Cypress` helpers, `evals`) without pulling
in the full FTR/Jest/Mocha surface of `@kbn/test`.
- Single public entry for client APIs instead of deep imports like
`@kbn/test/src/kbn_client/...`, which aligns with package boundaries and
makes types like UiSettingValues and ReqOptions part of a stable export
surface.
- Easier next steps to peel off other focused pieces (e.g. SAML session
management) on top of `@kbn/kbn-client` instead of growing `@kbn/test`
further.

### Notes
- New package is `devOnly` like @kbn/test.
- Jest/unit tests for the client live under `@kbn/kbn-client`.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit c701e38)

# Conflicts:
#	.github/CODEOWNERS
#	src/platform/packages/shared/kbn-kbn-client/src/kbn_client/kbn_client_requester_error.test.ts
#	src/platform/packages/shared/kbn-scout/src/common/services/clients.ts
#	src/platform/packages/shared/kbn-scout/src/playwright/fixtures/scope/worker/core_fixtures.ts
#	src/platform/packages/shared/kbn-scout/src/playwright/fixtures/scope/worker/scout_space/index.ts
#	src/platform/packages/shared/kbn-scout/src/playwright/fixtures/scope/worker/scout_space/parallel.ts
#	src/platform/packages/shared/kbn-scout/src/playwright/fixtures/scope/worker/ui_settings/index.ts
#	src/platform/packages/shared/kbn-scout/src/playwright/fixtures/scope/worker/ui_settings/single_thread.ts
#	src/platform/packages/shared/kbn-test/src/auth/session_manager.ts
#	src/platform/packages/shared/kbn-test/src/functional_test_runner/lib/dedicated_task_runner.ts
#	x-pack/platform/packages/shared/kbn-evals/moon.yml
#	x-pack/platform/packages/shared/kbn-evals/src/utils/evaluations_kbn_client.test.ts
#	x-pack/platform/packages/shared/kbn-evals/src/utils/evaluations_kbn_client.ts
#	x-pack/platform/packages/shared/kbn-evals/src/utils/http_handler_from_kbn_client.ts
#	x-pack/platform/packages/shared/kbn-evals/src/utils/kbn_client_with_retries.ts
#	x-pack/platform/packages/shared/kbn-evals/tsconfig.json
#	x-pack/solutions/security/test/cloud_security_posture_functional/data_views/data_views.ts
#	x-pack/solutions/security/test/moon.yml
#	x-pack/solutions/security/test/tsconfig.json
@dmlemeshko dmlemeshko added the backport This PR is a backport of another PR label Mar 23, 2026
@dmlemeshko dmlemeshko enabled auto-merge (squash) March 23, 2026 16:06
@dmlemeshko dmlemeshko requested a review from csr March 25, 2026 13:16
@dmlemeshko dmlemeshko merged commit 8fc5f51 into elastic:8.19 Mar 27, 2026
14 of 19 checks passed
@elasticmachine
Copy link
Copy Markdown
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] Jest Tests #14 / should render status information

Metrics [docs]

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/kbn-client - 52 +52
@kbn/test 321 347 +26
total +78

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/kbn-client - 1 +1
@kbn/test 4 5 +1
total +2

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/kbn-client - 7 +7
@kbn/test 14 5 -9
total -2

Page load bundle

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

id before after diff
kbnUiSharedDeps-srcJs 3.6MB 3.6MB +127.0B
Unknown metric groups

API count

id before after diff
@kbn/kbn-client - 61 +61
@kbn/test 380 413 +33
total +94

History

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants