Skip to content

[9.2] move kbn-client into its own package (#258963)#259148

Merged
dmlemeshko merged 6 commits intoelastic:9.2from
dmlemeshko:backport/9.2/pr-258963
Mar 25, 2026
Merged

[9.2] move kbn-client into its own package (#258963)#259148
dmlemeshko merged 6 commits intoelastic:9.2from
dmlemeshko:backport/9.2/pr-258963

Conversation

@dmlemeshko
Copy link
Copy Markdown
Contributor

Backport

This will backport the following commits from main to 9.2:

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-test/src/auth/session_manager.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/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 15:57
@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

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 - 53 +53
@kbn/test 322 349 +27
total +80

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
Unknown metric groups

API count

id before after diff
@kbn/kbn-client - 62 +62
@kbn/test 381 415 +34
total +96

History

@dmlemeshko dmlemeshko requested a review from csr March 25, 2026 12:47
@dmlemeshko dmlemeshko merged commit 8eece27 into elastic:9.2 Mar 25, 2026
14 checks passed
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