Skip to content

[FSH] Migrated fs usage to kbn/fs for sample ingest#244163

Merged
elena-shostak merged 19 commits intoelastic:mainfrom
elena-shostak:239385-fs-usage-sample-ingest
Dec 8, 2025
Merged

[FSH] Migrated fs usage to kbn/fs for sample ingest#244163
elena-shostak merged 19 commits intoelastic:mainfrom
elena-shostak:239385-fs-usage-sample-ingest

Conversation

@elena-shostak
Copy link
Copy Markdown
Contributor

@elena-shostak elena-shostak commented Nov 25, 2025

Summary

Migrated fs usage to @kbn/fs for sample ingest in scope of filesystem hardening initiative.

Checklist

Relates: #239385

@elena-shostak elena-shostak added release_note:skip Skip the PR/issue when compiling release notes backport:version Backport to applied version labels v8.19.8 v9.2.2 v9.1.8 Team:Security Platform Security: Auth, Users, Roles, Spaces, Audit Logging, etc t// Feature:Hardening Harding of Kibana from a security perspective labels Nov 26, 2025
const sampleDataManager = new SampleDataManager({
kibanaVersion: this.context.env.packageInfo.version,
artifactsFolder: Path.join(getDataPath(), 'sample-data-artifacts'),
artifactsFolder: 'sample-data-artifacts',
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Note

There is no need to form a full path anymore, @kbn/fs saves to data folder under the hood

const artifactFileName = getArtifactName({ productName, productVersion });
const artifactUrl = `${this.artifactRepositoryUrl}/${artifactFileName}`;
const artifactPath = `${this.artifactsFolder}/${artifactFileName}`;
const artifactPathAtVolume = `${this.artifactsFolder}/${artifactFileName}`;
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Note

sample-data-artifacts folder will be created under the hood

@elena-shostak elena-shostak marked this pull request as ready for review December 1, 2025 11:29
@elena-shostak elena-shostak requested review from a team as code owners December 1, 2025 11:29
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/kibana-security (Team:Security)

@SiddharthMantri SiddharthMantri self-requested a review December 1, 2025 13:25
Copy link
Copy Markdown
Contributor

@SiddharthMantri SiddharthMantri left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Copy Markdown
Contributor

@yansavitski yansavitski left a comment

Choose a reason for hiding this comment

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

LGTM

Thank you

@elasticmachine
Copy link
Copy Markdown
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

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/fs 2 5 +3
Unknown metric groups

API count

id before after diff
@kbn/fs 38 41 +3

History

@elena-shostak elena-shostak merged commit e7ebe47 into elastic:main Dec 8, 2025
12 checks passed
@kibanamachine
Copy link
Copy Markdown
Contributor

Starting backport for target branches: 8.19, 9.1, 9.2

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

@kibanamachine
Copy link
Copy Markdown
Contributor

kibanamachine commented Dec 8, 2025

💔 All backports failed

Status Branch Result
9.2 Backport failed because of merge conflicts

Manual backport

To create the backport manually run:

node scripts/backport --pr 244163

Questions ?

Please refer to the Backport tool documentation

mbondyra added a commit to mbondyra/kibana that referenced this pull request Dec 8, 2025
* commit '6647f813c9fa03ac0378e3d4756246e8dc4b4c76': (33 commits)
  [Detection Engine] Extracts Rules/Alerts/Exceptions permission to new Rules feature privileges (elastic#239634)
  [Agent Builder] Add Intro Tour (elastic#245551)
  Add datastream lifecycle support to indices metadata (elastic#245548)
  [Serverless] Update preconfigured connectors (elastic#245445)
  [Metrics][Discover] Discover to prefer line chars for time series data (elastic#244595)
  Update dependency @elastic/ebt to ^1.4.1 (main) (elastic#241629)
  [One Workflow] fix: request bodies with oneof schemas (`kibana.SetAlertsStatus`, etc) (elastic#245344)
  Update dependency ai to v5 (elastic#244675)
  Fix Discover trace waterfall behavior with duplicate spans (elastic#244984)
  [FSH] Migrated fs usage to kbn/fs for sample ingest (elastic#244163)
  Streamlang: Unskip type coercion test (elastic#245519)
  [Response Ops][Reporting] Fixing error in calculating delay value between retries (elastic#245431)
  Add TopNavMenuBeta to navigation plugin (elastic#243578)
  [scout] support custom servers configuration (elastic#244306)
  [Fleet] Run agentless background sync without dry run (elastic#245286)
  Fix Change Password Flaky Test (elastic#245443)
  Add new gap fill status for rules (elastic#242595)
  [Kibana Search] Move SLOs higher up in search results (elastic#245518)
  feat(slo): introduce find SLO instances internal route (elastic#245333)
  [FSH] Dropped unnecessary `fs` persistence for synthetics project code (elastic#244338)
  ...
@elena-shostak
Copy link
Copy Markdown
Contributor Author

💚 All backports created successfully

Status Branch Result
9.2

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

Questions ?

Please refer to the Backport tool documentation

elena-shostak added a commit to elena-shostak/kibana that referenced this pull request Dec 9, 2025
## Summary

Migrated `fs` usage to `@kbn/fs` for sample ingest in scope of
filesystem hardening initiative.

### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.

__Relates: https://github.com/elastic/kibana/issues/239385__

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Yan Savitski <yan.savitski@elastic.co>
(cherry picked from commit e7ebe47)

# Conflicts:
#	x-pack/platform/plugins/shared/sample_data_ingest/moon.yml
#	x-pack/platform/plugins/shared/sample_data_ingest/server/plugin.ts
#	x-pack/platform/plugins/shared/sample_data_ingest/server/services/artifact_manager/artifact_manager.ts
#	x-pack/platform/plugins/shared/sample_data_ingest/server/services/artifact_manager/utils/download.test.ts
#	x-pack/platform/plugins/shared/sample_data_ingest/server/services/artifact_manager/utils/download.ts
#	x-pack/platform/plugins/shared/sample_data_ingest/tsconfig.json
@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label Dec 10, 2025
@kibanamachine
Copy link
Copy Markdown
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.
cc: @elena-shostak

1 similar comment
@kibanamachine
Copy link
Copy Markdown
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.
cc: @elena-shostak

elena-shostak added a commit that referenced this pull request Dec 11, 2025
…245613)

# Backport

This will backport the following commits from `main` to `9.2`:
- [[FSH] Migrated fs usage to kbn/fs for sample ingest
(#244163)](#244163)

<!--- Backport version: 10.2.0 -->

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

<!--BACKPORT [{"author":{"name":"Elena
Shostak","email":"165678770+elena-shostak@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-12-08T16:44:42Z","message":"[FSH]
Migrated fs usage to kbn/fs for sample ingest (#244163)\n\n##
Summary\n\nMigrated `fs` usage to `@kbn/fs` for sample ingest in scope
of\nfilesystem hardening initiative.\n\n\n### Checklist\n\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] Review the
[backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand
apply applicable `backport:*` labels.\n\n__Relates:
https://github.com/elastic/kibana/issues/239385__\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by: Yan
Savitski
<yan.savitski@elastic.co>","sha":"e7ebe47f5f80d4e0e848ba560ce8c9bacb203d02","branchLabelMapping":{"^v9.3.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Security","release_note:skip","Feature:Hardening","backport:version","v9.3.0","v8.19.8","v9.2.2","v9.1.8"],"title":"[FSH]
Migrated fs usage to kbn/fs for sample
ingest","number":244163,"url":"https://github.com/elastic/kibana/pull/244163","mergeCommit":{"message":"[FSH]
Migrated fs usage to kbn/fs for sample ingest (#244163)\n\n##
Summary\n\nMigrated `fs` usage to `@kbn/fs` for sample ingest in scope
of\nfilesystem hardening initiative.\n\n\n### Checklist\n\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] Review the
[backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand
apply applicable `backport:*` labels.\n\n__Relates:
https://github.com/elastic/kibana/issues/239385__\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by: Yan
Savitski
<yan.savitski@elastic.co>","sha":"e7ebe47f5f80d4e0e848ba560ce8c9bacb203d02"}},"sourceBranch":"main","suggestedTargetBranches":["8.19","9.2","9.1"],"targetPullRequestStates":[{"branch":"main","label":"v9.3.0","branchLabelMappingKey":"^v9.3.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/244163","number":244163,"mergeCommit":{"message":"[FSH]
Migrated fs usage to kbn/fs for sample ingest (#244163)\n\n##
Summary\n\nMigrated `fs` usage to `@kbn/fs` for sample ingest in scope
of\nfilesystem hardening initiative.\n\n\n### Checklist\n\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] Review the
[backport\nguidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)\nand
apply applicable `backport:*` labels.\n\n__Relates:
https://github.com/elastic/kibana/issues/239385__\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by: Yan
Savitski
<yan.savitski@elastic.co>","sha":"e7ebe47f5f80d4e0e848ba560ce8c9bacb203d02"}},{"branch":"8.19","label":"v8.19.8","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.2","label":"v9.2.2","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.1","label":"v9.1.8","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
@kibanamachine kibanamachine added v9.2.3 and removed backport missing Added to PRs automatically when the are determined to be missing a backport. labels Dec 11, 2025
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 Feature:Hardening Harding of Kibana from a security perspective release_note:skip Skip the PR/issue when compiling release notes Team:Security Platform Security: Auth, Users, Roles, Spaces, Audit Logging, etc t// v9.2.2 v9.2.3 v9.3.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants