Skip to content

[kbn/es-archiver] add 'dataOnly' arg to avoid kbnClient use#254962

Merged
dmlemeshko merged 6 commits intoelastic:mainfrom
dmlemeshko:esArchiver/add-data-only-mode
Feb 26, 2026
Merged

[kbn/es-archiver] add 'dataOnly' arg to avoid kbnClient use#254962
dmlemeshko merged 6 commits intoelastic:mainfrom
dmlemeshko:esArchiver/add-data-only-mode

Conversation

@dmlemeshko
Copy link
Copy Markdown
Contributor

@dmlemeshko dmlemeshko commented Feb 25, 2026

Summary

related to #254791

Adds a dataOnly mode to EsArchiver that enforces data-only ingestion by rejecting archives containing saved object indices (.kibana*) and removes the requirement for kbnClient.

Motivation:

  • Scout tests should use kbnArchiver for saved objects, not esArchiver. This change makes that boundary explicit by throwing a clear error if a Scout test accidentally tries to load .kibana* archives via esArchiver.
  • For Cross Project Search (CPS) support, the linked project's ES cluster has no Kibana instance, so esArchiver must work without kbnClient.

What changed:

  • EsArchiver constructor accepts a new dataOnly?: boolean option. When true, kbnClient is not required, emptyKibanaIndex() throws error, and load()/loadIfNeeded() reject any archive that touches saved object indices.
  • loadAction skips the kbnClient.plugins.getEnabledIds() call and saved object migration when dataOnly is enabled.
  • Scout's getEsArchiver and its Playwright fixture now use dataOnly: true without kbnClient.
  • FTR and Cypress flows are unchanged -- they continue using EsArchiver without dataOnly, with full kbnClient support.

@dmlemeshko dmlemeshko self-assigned this Feb 25, 2026
@dmlemeshko dmlemeshko added release_note:skip Skip the PR/issue when compiling release notes backport:all-open Backport to all branches that could still receive a release labels Feb 25, 2026
Comment on lines +32 to +36
/**
* When true, `kbnClient` is not required and loading archives that contain
* saved-object indices (.kibana*) will throw. Intended for Scout tests and
* linked CPS projects that should only ingest pure ES data.
*/
Copy link
Copy Markdown
Contributor Author

@dmlemeshko dmlemeshko Feb 25, 2026

Choose a reason for hiding this comment

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

to be honest we want it to be in FTR too, but many tests has to migrate to different archives and it won't happen with FTR (migrating directly to Scout is better)

@dmlemeshko dmlemeshko marked this pull request as ready for review February 25, 2026 16:23
@dmlemeshko dmlemeshko requested a review from a team as a code owner February 25, 2026 16:23
@dmlemeshko dmlemeshko requested a review from csr February 25, 2026 16:28
Copy link
Copy Markdown
Member

@csr csr left a comment

Choose a reason for hiding this comment

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

Overall LGTM, left some minor suggestions. This is a wonderful addition to keep tests robust and predictable!

@dmlemeshko dmlemeshko enabled auto-merge (squash) February 26, 2026 07:58
@dmlemeshko dmlemeshko merged commit 8500782 into elastic:main Feb 26, 2026
16 checks passed
@kibanamachine
Copy link
Copy Markdown
Contributor

Starting backport for target branches: 8.19, 9.2, 9.3

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

@elasticmachine
Copy link
Copy Markdown
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] Jest Tests #7 / Mappings editor core component props props.value and props.onChange props.onChange() => should forward the changes to the consumer component

Metrics [docs]

✅ unchanged

History

cc @dmlemeshko

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Feb 26, 2026
…254962)

## Summary

related to elastic#254791

Adds a `dataOnly` mode to `EsArchiver` that enforces data-only ingestion
by rejecting archives containing saved object indices (`.kibana*`) and
removes the requirement for `kbnClient`.

### Motivation:
- Scout tests should use `kbnArchiver` for saved objects, not
`esArchiver`. This change makes that boundary explicit by throwing a
clear error if a Scout test accidentally tries to load .kibana* archives
via esArchiver.
- For Cross Project Search (CPS) support, the linked project's ES
cluster has no Kibana instance, so `esArchiver` must work without
`kbnClient`.

### What changed:
- `EsArchiver` constructor accepts a new `dataOnly?: boolean` option.
When true, `kbnClient` is not required, `emptyKibanaIndex()` throws
error, and `load()/loadIfNeeded()` reject any archive that touches saved
object indices.
- `loadAction` skips the `kbnClient.plugins.getEnabledIds()` call and
saved object migration when `dataOnly` is enabled.
- Scout's `getEsArchiver` and its Playwright fixture now use `dataOnly:
true` without `kbnClient`.
- FTR and Cypress flows are unchanged -- they continue using
`EsArchiver` without dataOnly, with full `kbnClient` support.

---------

Co-authored-by: Cesare de Cal <cesare.decal@elastic.co>
(cherry picked from commit 8500782)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Feb 26, 2026
…254962)

## Summary

related to elastic#254791

Adds a `dataOnly` mode to `EsArchiver` that enforces data-only ingestion
by rejecting archives containing saved object indices (`.kibana*`) and
removes the requirement for `kbnClient`.

### Motivation:
- Scout tests should use `kbnArchiver` for saved objects, not
`esArchiver`. This change makes that boundary explicit by throwing a
clear error if a Scout test accidentally tries to load .kibana* archives
via esArchiver.
- For Cross Project Search (CPS) support, the linked project's ES
cluster has no Kibana instance, so `esArchiver` must work without
`kbnClient`.

### What changed:
- `EsArchiver` constructor accepts a new `dataOnly?: boolean` option.
When true, `kbnClient` is not required, `emptyKibanaIndex()` throws
error, and `load()/loadIfNeeded()` reject any archive that touches saved
object indices.
- `loadAction` skips the `kbnClient.plugins.getEnabledIds()` call and
saved object migration when `dataOnly` is enabled.
- Scout's `getEsArchiver` and its Playwright fixture now use `dataOnly:
true` without `kbnClient`.
- FTR and Cypress flows are unchanged -- they continue using
`EsArchiver` without dataOnly, with full `kbnClient` support.

---------

Co-authored-by: Cesare de Cal <cesare.decal@elastic.co>
(cherry picked from commit 8500782)
@kibanamachine
Copy link
Copy Markdown
Contributor

💔 Some backports could not be created

Status Branch Result
8.19 Backport failed because of merge conflicts
9.2
9.3

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

Manual backport

To create the backport manually run:

node scripts/backport --pr 254962

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Feb 26, 2026
…54962) (#255062)

# Backport

This will backport the following commits from `main` to `9.3`:
- [[kbn/es-archiver] add 'dataOnly' arg to avoid kbnClient use
(#254962)](#254962)

<!--- Backport version: 9.6.6 -->

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

<!--BACKPORT [{"author":{"name":"Dzmitry
Lemechko","email":"dzmitry.lemechko@elastic.co"},"sourceCommit":{"committedDate":"2026-02-26T09:18:09Z","message":"[kbn/es-archiver]
add 'dataOnly' arg to avoid kbnClient use (#254962)\n\n##
Summary\n\nrelated to
https://github.com/elastic/kibana/pull/254791\n\nAdds a `dataOnly` mode
to `EsArchiver` that enforces data-only ingestion\nby rejecting archives
containing saved object indices (`.kibana*`) and\nremoves the
requirement for `kbnClient`.\n\n### Motivation:\n- Scout tests should
use `kbnArchiver` for saved objects, not\n`esArchiver`. This change
makes that boundary explicit by throwing a\nclear error if a Scout test
accidentally tries to load .kibana* archives\nvia esArchiver.\n- For
Cross Project Search (CPS) support, the linked project's ES\ncluster has
no Kibana instance, so `esArchiver` must work
without\n`kbnClient`.\n\n### What changed:\n- `EsArchiver` constructor
accepts a new `dataOnly?: boolean` option.\nWhen true, `kbnClient` is
not required, `emptyKibanaIndex()` throws\nerror, and
`load()/loadIfNeeded()` reject any archive that touches saved\nobject
indices.\n- `loadAction` skips the `kbnClient.plugins.getEnabledIds()`
call and\nsaved object migration when `dataOnly` is enabled.\n- Scout's
`getEsArchiver` and its Playwright fixture now use `dataOnly:\ntrue`
without `kbnClient`.\n- FTR and Cypress flows are unchanged -- they
continue using\n`EsArchiver` without dataOnly, with full `kbnClient`
support.\n\n---------\n\nCo-authored-by: Cesare de Cal
<cesare.decal@elastic.co>","sha":"8500782b3fe8428598054b559fb6b83c5ed1d88f","branchLabelMapping":{"^v9.4.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:all-open","v9.4.0"],"title":"[kbn/es-archiver]
add 'dataOnly' arg to avoid kbnClient
use","number":254962,"url":"https://github.com/elastic/kibana/pull/254962","mergeCommit":{"message":"[kbn/es-archiver]
add 'dataOnly' arg to avoid kbnClient use (#254962)\n\n##
Summary\n\nrelated to
https://github.com/elastic/kibana/pull/254791\n\nAdds a `dataOnly` mode
to `EsArchiver` that enforces data-only ingestion\nby rejecting archives
containing saved object indices (`.kibana*`) and\nremoves the
requirement for `kbnClient`.\n\n### Motivation:\n- Scout tests should
use `kbnArchiver` for saved objects, not\n`esArchiver`. This change
makes that boundary explicit by throwing a\nclear error if a Scout test
accidentally tries to load .kibana* archives\nvia esArchiver.\n- For
Cross Project Search (CPS) support, the linked project's ES\ncluster has
no Kibana instance, so `esArchiver` must work
without\n`kbnClient`.\n\n### What changed:\n- `EsArchiver` constructor
accepts a new `dataOnly?: boolean` option.\nWhen true, `kbnClient` is
not required, `emptyKibanaIndex()` throws\nerror, and
`load()/loadIfNeeded()` reject any archive that touches saved\nobject
indices.\n- `loadAction` skips the `kbnClient.plugins.getEnabledIds()`
call and\nsaved object migration when `dataOnly` is enabled.\n- Scout's
`getEsArchiver` and its Playwright fixture now use `dataOnly:\ntrue`
without `kbnClient`.\n- FTR and Cypress flows are unchanged -- they
continue using\n`EsArchiver` without dataOnly, with full `kbnClient`
support.\n\n---------\n\nCo-authored-by: Cesare de Cal
<cesare.decal@elastic.co>","sha":"8500782b3fe8428598054b559fb6b83c5ed1d88f"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.4.0","branchLabelMappingKey":"^v9.4.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/254962","number":254962,"mergeCommit":{"message":"[kbn/es-archiver]
add 'dataOnly' arg to avoid kbnClient use (#254962)\n\n##
Summary\n\nrelated to
https://github.com/elastic/kibana/pull/254791\n\nAdds a `dataOnly` mode
to `EsArchiver` that enforces data-only ingestion\nby rejecting archives
containing saved object indices (`.kibana*`) and\nremoves the
requirement for `kbnClient`.\n\n### Motivation:\n- Scout tests should
use `kbnArchiver` for saved objects, not\n`esArchiver`. This change
makes that boundary explicit by throwing a\nclear error if a Scout test
accidentally tries to load .kibana* archives\nvia esArchiver.\n- For
Cross Project Search (CPS) support, the linked project's ES\ncluster has
no Kibana instance, so `esArchiver` must work
without\n`kbnClient`.\n\n### What changed:\n- `EsArchiver` constructor
accepts a new `dataOnly?: boolean` option.\nWhen true, `kbnClient` is
not required, `emptyKibanaIndex()` throws\nerror, and
`load()/loadIfNeeded()` reject any archive that touches saved\nobject
indices.\n- `loadAction` skips the `kbnClient.plugins.getEnabledIds()`
call and\nsaved object migration when `dataOnly` is enabled.\n- Scout's
`getEsArchiver` and its Playwright fixture now use `dataOnly:\ntrue`
without `kbnClient`.\n- FTR and Cypress flows are unchanged -- they
continue using\n`EsArchiver` without dataOnly, with full `kbnClient`
support.\n\n---------\n\nCo-authored-by: Cesare de Cal
<cesare.decal@elastic.co>","sha":"8500782b3fe8428598054b559fb6b83c5ed1d88f"}}]}]
BACKPORT-->

Co-authored-by: Dzmitry Lemechko <dzmitry.lemechko@elastic.co>
Co-authored-by: Cesare de Cal <cesare.decal@elastic.co>
kibanamachine added a commit that referenced this pull request Feb 26, 2026
…54962) (#255061)

# Backport

This will backport the following commits from `main` to `9.2`:
- [[kbn/es-archiver] add 'dataOnly' arg to avoid kbnClient use
(#254962)](#254962)

<!--- Backport version: 9.6.6 -->

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

<!--BACKPORT [{"author":{"name":"Dzmitry
Lemechko","email":"dzmitry.lemechko@elastic.co"},"sourceCommit":{"committedDate":"2026-02-26T09:18:09Z","message":"[kbn/es-archiver]
add 'dataOnly' arg to avoid kbnClient use (#254962)\n\n##
Summary\n\nrelated to
https://github.com/elastic/kibana/pull/254791\n\nAdds a `dataOnly` mode
to `EsArchiver` that enforces data-only ingestion\nby rejecting archives
containing saved object indices (`.kibana*`) and\nremoves the
requirement for `kbnClient`.\n\n### Motivation:\n- Scout tests should
use `kbnArchiver` for saved objects, not\n`esArchiver`. This change
makes that boundary explicit by throwing a\nclear error if a Scout test
accidentally tries to load .kibana* archives\nvia esArchiver.\n- For
Cross Project Search (CPS) support, the linked project's ES\ncluster has
no Kibana instance, so `esArchiver` must work
without\n`kbnClient`.\n\n### What changed:\n- `EsArchiver` constructor
accepts a new `dataOnly?: boolean` option.\nWhen true, `kbnClient` is
not required, `emptyKibanaIndex()` throws\nerror, and
`load()/loadIfNeeded()` reject any archive that touches saved\nobject
indices.\n- `loadAction` skips the `kbnClient.plugins.getEnabledIds()`
call and\nsaved object migration when `dataOnly` is enabled.\n- Scout's
`getEsArchiver` and its Playwright fixture now use `dataOnly:\ntrue`
without `kbnClient`.\n- FTR and Cypress flows are unchanged -- they
continue using\n`EsArchiver` without dataOnly, with full `kbnClient`
support.\n\n---------\n\nCo-authored-by: Cesare de Cal
<cesare.decal@elastic.co>","sha":"8500782b3fe8428598054b559fb6b83c5ed1d88f","branchLabelMapping":{"^v9.4.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:all-open","v9.4.0"],"title":"[kbn/es-archiver]
add 'dataOnly' arg to avoid kbnClient
use","number":254962,"url":"https://github.com/elastic/kibana/pull/254962","mergeCommit":{"message":"[kbn/es-archiver]
add 'dataOnly' arg to avoid kbnClient use (#254962)\n\n##
Summary\n\nrelated to
https://github.com/elastic/kibana/pull/254791\n\nAdds a `dataOnly` mode
to `EsArchiver` that enforces data-only ingestion\nby rejecting archives
containing saved object indices (`.kibana*`) and\nremoves the
requirement for `kbnClient`.\n\n### Motivation:\n- Scout tests should
use `kbnArchiver` for saved objects, not\n`esArchiver`. This change
makes that boundary explicit by throwing a\nclear error if a Scout test
accidentally tries to load .kibana* archives\nvia esArchiver.\n- For
Cross Project Search (CPS) support, the linked project's ES\ncluster has
no Kibana instance, so `esArchiver` must work
without\n`kbnClient`.\n\n### What changed:\n- `EsArchiver` constructor
accepts a new `dataOnly?: boolean` option.\nWhen true, `kbnClient` is
not required, `emptyKibanaIndex()` throws\nerror, and
`load()/loadIfNeeded()` reject any archive that touches saved\nobject
indices.\n- `loadAction` skips the `kbnClient.plugins.getEnabledIds()`
call and\nsaved object migration when `dataOnly` is enabled.\n- Scout's
`getEsArchiver` and its Playwright fixture now use `dataOnly:\ntrue`
without `kbnClient`.\n- FTR and Cypress flows are unchanged -- they
continue using\n`EsArchiver` without dataOnly, with full `kbnClient`
support.\n\n---------\n\nCo-authored-by: Cesare de Cal
<cesare.decal@elastic.co>","sha":"8500782b3fe8428598054b559fb6b83c5ed1d88f"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.4.0","branchLabelMappingKey":"^v9.4.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/254962","number":254962,"mergeCommit":{"message":"[kbn/es-archiver]
add 'dataOnly' arg to avoid kbnClient use (#254962)\n\n##
Summary\n\nrelated to
https://github.com/elastic/kibana/pull/254791\n\nAdds a `dataOnly` mode
to `EsArchiver` that enforces data-only ingestion\nby rejecting archives
containing saved object indices (`.kibana*`) and\nremoves the
requirement for `kbnClient`.\n\n### Motivation:\n- Scout tests should
use `kbnArchiver` for saved objects, not\n`esArchiver`. This change
makes that boundary explicit by throwing a\nclear error if a Scout test
accidentally tries to load .kibana* archives\nvia esArchiver.\n- For
Cross Project Search (CPS) support, the linked project's ES\ncluster has
no Kibana instance, so `esArchiver` must work
without\n`kbnClient`.\n\n### What changed:\n- `EsArchiver` constructor
accepts a new `dataOnly?: boolean` option.\nWhen true, `kbnClient` is
not required, `emptyKibanaIndex()` throws\nerror, and
`load()/loadIfNeeded()` reject any archive that touches saved\nobject
indices.\n- `loadAction` skips the `kbnClient.plugins.getEnabledIds()`
call and\nsaved object migration when `dataOnly` is enabled.\n- Scout's
`getEsArchiver` and its Playwright fixture now use `dataOnly:\ntrue`
without `kbnClient`.\n- FTR and Cypress flows are unchanged -- they
continue using\n`EsArchiver` without dataOnly, with full `kbnClient`
support.\n\n---------\n\nCo-authored-by: Cesare de Cal
<cesare.decal@elastic.co>","sha":"8500782b3fe8428598054b559fb6b83c5ed1d88f"}}]}]
BACKPORT-->

Co-authored-by: Dzmitry Lemechko <dzmitry.lemechko@elastic.co>
Co-authored-by: Cesare de Cal <cesare.decal@elastic.co>
qn895 pushed a commit to qn895/kibana that referenced this pull request Mar 11, 2026
…254962)

## Summary

related to elastic#254791

Adds a `dataOnly` mode to `EsArchiver` that enforces data-only ingestion
by rejecting archives containing saved object indices (`.kibana*`) and
removes the requirement for `kbnClient`.

### Motivation:
- Scout tests should use `kbnArchiver` for saved objects, not
`esArchiver`. This change makes that boundary explicit by throwing a
clear error if a Scout test accidentally tries to load .kibana* archives
via esArchiver.
- For Cross Project Search (CPS) support, the linked project's ES
cluster has no Kibana instance, so `esArchiver` must work without
`kbnClient`.

### What changed:
- `EsArchiver` constructor accepts a new `dataOnly?: boolean` option.
When true, `kbnClient` is not required, `emptyKibanaIndex()` throws
error, and `load()/loadIfNeeded()` reject any archive that touches saved
object indices.
- `loadAction` skips the `kbnClient.plugins.getEnabledIds()` call and
saved object migration when `dataOnly` is enabled.
- Scout's `getEsArchiver` and its Playwright fixture now use `dataOnly:
true` without `kbnClient`.
- FTR and Cypress flows are unchanged -- they continue using
`EsArchiver` without dataOnly, with full `kbnClient` support.

---------

Co-authored-by: Cesare de Cal <cesare.decal@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:all-open Backport to all branches that could still receive a release release_note:skip Skip the PR/issue when compiling release notes v9.2.6 v9.3.1 v9.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants