From 42e71f4256183f83b173384b252c11186a87712d Mon Sep 17 00:00:00 2001 From: Marshall Main <55718608+marshallmain@users.noreply.github.com> Date: Wed, 18 Dec 2024 17:33:43 -0500 Subject: [PATCH] [8.x] Sustainable Kibana Architecture: Move modules owned by `@elastic/security-detections-response` (#202847) (#204833) # Backport This will backport the following commits from `main` to `8.x`: - [Sustainable Kibana Architecture: Move modules owned by `@elastic/security-detections-response` (#202847)](https://github.com/elastic/kibana/pull/202847) ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) Co-authored-by: Gerard Soldevila --- .buildkite/scripts/pipelines/pull_request/pipeline.ts | 2 +- .github/CODEOWNERS | 2 +- package.json | 2 +- .../platform/packages/shared}/kbn-rule-data-utils/index.ts | 0 .../packages/shared}/kbn-rule-data-utils/jest.config.js | 4 ++-- .../packages/shared}/kbn-rule-data-utils/kibana.jsonc | 0 .../packages/shared}/kbn-rule-data-utils/package.json | 0 .../shared}/kbn-rule-data-utils/src/alerts_as_data_cases.ts | 0 .../kbn-rule-data-utils/src/alerts_as_data_rbac.test.ts | 0 .../shared}/kbn-rule-data-utils/src/alerts_as_data_rbac.ts | 0 .../kbn-rule-data-utils/src/alerts_as_data_severity.ts | 0 .../shared}/kbn-rule-data-utils/src/alerts_as_data_status.ts | 0 .../shared}/kbn-rule-data-utils/src/default_alerts_as_data.ts | 0 .../shared}/kbn-rule-data-utils/src/legacy_alerts_as_data.ts | 0 .../kbn-rule-data-utils/src/routes/stack_rule_paths.ts | 0 .../shared}/kbn-rule-data-utils/src/rule_types/index.ts | 0 .../shared}/kbn-rule-data-utils/src/rule_types/o11y_rules.ts | 0 .../shared}/kbn-rule-data-utils/src/rule_types/stack_rules.ts | 0 .../shared}/kbn-rule-data-utils/src/technical_field_names.ts | 0 .../packages/shared}/kbn-rule-data-utils/tsconfig.json | 2 +- tsconfig.base.json | 4 ++-- yarn.lock | 2 +- 22 files changed, 9 insertions(+), 9 deletions(-) rename {packages => src/platform/packages/shared}/kbn-rule-data-utils/index.ts (100%) rename {packages => src/platform/packages/shared}/kbn-rule-data-utils/jest.config.js (83%) rename {packages => src/platform/packages/shared}/kbn-rule-data-utils/kibana.jsonc (100%) rename {packages => src/platform/packages/shared}/kbn-rule-data-utils/package.json (100%) rename {packages => src/platform/packages/shared}/kbn-rule-data-utils/src/alerts_as_data_cases.ts (100%) rename {packages => src/platform/packages/shared}/kbn-rule-data-utils/src/alerts_as_data_rbac.test.ts (100%) rename {packages => src/platform/packages/shared}/kbn-rule-data-utils/src/alerts_as_data_rbac.ts (100%) rename {packages => src/platform/packages/shared}/kbn-rule-data-utils/src/alerts_as_data_severity.ts (100%) rename {packages => src/platform/packages/shared}/kbn-rule-data-utils/src/alerts_as_data_status.ts (100%) rename {packages => src/platform/packages/shared}/kbn-rule-data-utils/src/default_alerts_as_data.ts (100%) rename {packages => src/platform/packages/shared}/kbn-rule-data-utils/src/legacy_alerts_as_data.ts (100%) rename {packages => src/platform/packages/shared}/kbn-rule-data-utils/src/routes/stack_rule_paths.ts (100%) rename {packages => src/platform/packages/shared}/kbn-rule-data-utils/src/rule_types/index.ts (100%) rename {packages => src/platform/packages/shared}/kbn-rule-data-utils/src/rule_types/o11y_rules.ts (100%) rename {packages => src/platform/packages/shared}/kbn-rule-data-utils/src/rule_types/stack_rules.ts (100%) rename {packages => src/platform/packages/shared}/kbn-rule-data-utils/src/technical_field_names.ts (100%) rename {packages => src/platform/packages/shared}/kbn-rule-data-utils/tsconfig.json (82%) diff --git a/.buildkite/scripts/pipelines/pull_request/pipeline.ts b/.buildkite/scripts/pipelines/pull_request/pipeline.ts index e5152c174b236..403dbe53350f8 100644 --- a/.buildkite/scripts/pipelines/pull_request/pipeline.ts +++ b/.buildkite/scripts/pipelines/pull_request/pipeline.ts @@ -302,7 +302,7 @@ const getPipeline = (filename: string, removeSteps = true) => { /^packages\/kbn-grouping/, /^packages\/kbn-resizable-layout/, /^packages\/kbn-rison/, - /^packages\/kbn-rule-data-utils/, + /^src\/platform\/packages\/shared\/kbn-rule-data-utils/, /^packages\/kbn-safer-lodash-set/, /^packages\/kbn-search-types/, /^packages\/kbn-securitysolution-.*/, diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index dd93c3adcb9d3..988ef63ca4877 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -758,7 +758,7 @@ packages/kbn-router-to-openapispec @elastic/kibana-core packages/kbn-router-utils @elastic/obs-ux-logs-team examples/routing_example @elastic/kibana-core packages/kbn-rrule @elastic/response-ops -packages/kbn-rule-data-utils @elastic/security-detections-response @elastic/response-ops @elastic/obs-ux-management-team +src/platform/packages/shared/kbn-rule-data-utils @elastic/security-detections-response @elastic/response-ops @elastic/obs-ux-management-team x-pack/plugins/rule_registry @elastic/response-ops @elastic/obs-ux-management-team x-pack/platform/plugins/private/runtime_fields @elastic/kibana-management packages/kbn-safer-lodash-set @elastic/kibana-security diff --git a/package.json b/package.json index da1189c509e8e..12e17e0d91001 100644 --- a/package.json +++ b/package.json @@ -770,7 +770,7 @@ "@kbn/router-utils": "link:packages/kbn-router-utils", "@kbn/routing-example-plugin": "link:examples/routing_example", "@kbn/rrule": "link:packages/kbn-rrule", - "@kbn/rule-data-utils": "link:packages/kbn-rule-data-utils", + "@kbn/rule-data-utils": "link:src/platform/packages/shared/kbn-rule-data-utils", "@kbn/rule-registry-plugin": "link:x-pack/plugins/rule_registry", "@kbn/runtime-fields-plugin": "link:x-pack/platform/plugins/private/runtime_fields", "@kbn/safer-lodash-set": "link:packages/kbn-safer-lodash-set", diff --git a/packages/kbn-rule-data-utils/index.ts b/src/platform/packages/shared/kbn-rule-data-utils/index.ts similarity index 100% rename from packages/kbn-rule-data-utils/index.ts rename to src/platform/packages/shared/kbn-rule-data-utils/index.ts diff --git a/packages/kbn-rule-data-utils/jest.config.js b/src/platform/packages/shared/kbn-rule-data-utils/jest.config.js similarity index 83% rename from packages/kbn-rule-data-utils/jest.config.js rename to src/platform/packages/shared/kbn-rule-data-utils/jest.config.js index fd0feabd9f0ad..c8cb6a4bbec63 100644 --- a/packages/kbn-rule-data-utils/jest.config.js +++ b/src/platform/packages/shared/kbn-rule-data-utils/jest.config.js @@ -9,6 +9,6 @@ module.exports = { preset: '@kbn/test', - rootDir: '../..', - roots: ['/packages/kbn-rule-data-utils'], + rootDir: '../../../../..', + roots: ['/src/platform/packages/shared/kbn-rule-data-utils'], }; diff --git a/packages/kbn-rule-data-utils/kibana.jsonc b/src/platform/packages/shared/kbn-rule-data-utils/kibana.jsonc similarity index 100% rename from packages/kbn-rule-data-utils/kibana.jsonc rename to src/platform/packages/shared/kbn-rule-data-utils/kibana.jsonc diff --git a/packages/kbn-rule-data-utils/package.json b/src/platform/packages/shared/kbn-rule-data-utils/package.json similarity index 100% rename from packages/kbn-rule-data-utils/package.json rename to src/platform/packages/shared/kbn-rule-data-utils/package.json diff --git a/packages/kbn-rule-data-utils/src/alerts_as_data_cases.ts b/src/platform/packages/shared/kbn-rule-data-utils/src/alerts_as_data_cases.ts similarity index 100% rename from packages/kbn-rule-data-utils/src/alerts_as_data_cases.ts rename to src/platform/packages/shared/kbn-rule-data-utils/src/alerts_as_data_cases.ts diff --git a/packages/kbn-rule-data-utils/src/alerts_as_data_rbac.test.ts b/src/platform/packages/shared/kbn-rule-data-utils/src/alerts_as_data_rbac.test.ts similarity index 100% rename from packages/kbn-rule-data-utils/src/alerts_as_data_rbac.test.ts rename to src/platform/packages/shared/kbn-rule-data-utils/src/alerts_as_data_rbac.test.ts diff --git a/packages/kbn-rule-data-utils/src/alerts_as_data_rbac.ts b/src/platform/packages/shared/kbn-rule-data-utils/src/alerts_as_data_rbac.ts similarity index 100% rename from packages/kbn-rule-data-utils/src/alerts_as_data_rbac.ts rename to src/platform/packages/shared/kbn-rule-data-utils/src/alerts_as_data_rbac.ts diff --git a/packages/kbn-rule-data-utils/src/alerts_as_data_severity.ts b/src/platform/packages/shared/kbn-rule-data-utils/src/alerts_as_data_severity.ts similarity index 100% rename from packages/kbn-rule-data-utils/src/alerts_as_data_severity.ts rename to src/platform/packages/shared/kbn-rule-data-utils/src/alerts_as_data_severity.ts diff --git a/packages/kbn-rule-data-utils/src/alerts_as_data_status.ts b/src/platform/packages/shared/kbn-rule-data-utils/src/alerts_as_data_status.ts similarity index 100% rename from packages/kbn-rule-data-utils/src/alerts_as_data_status.ts rename to src/platform/packages/shared/kbn-rule-data-utils/src/alerts_as_data_status.ts diff --git a/packages/kbn-rule-data-utils/src/default_alerts_as_data.ts b/src/platform/packages/shared/kbn-rule-data-utils/src/default_alerts_as_data.ts similarity index 100% rename from packages/kbn-rule-data-utils/src/default_alerts_as_data.ts rename to src/platform/packages/shared/kbn-rule-data-utils/src/default_alerts_as_data.ts diff --git a/packages/kbn-rule-data-utils/src/legacy_alerts_as_data.ts b/src/platform/packages/shared/kbn-rule-data-utils/src/legacy_alerts_as_data.ts similarity index 100% rename from packages/kbn-rule-data-utils/src/legacy_alerts_as_data.ts rename to src/platform/packages/shared/kbn-rule-data-utils/src/legacy_alerts_as_data.ts diff --git a/packages/kbn-rule-data-utils/src/routes/stack_rule_paths.ts b/src/platform/packages/shared/kbn-rule-data-utils/src/routes/stack_rule_paths.ts similarity index 100% rename from packages/kbn-rule-data-utils/src/routes/stack_rule_paths.ts rename to src/platform/packages/shared/kbn-rule-data-utils/src/routes/stack_rule_paths.ts diff --git a/packages/kbn-rule-data-utils/src/rule_types/index.ts b/src/platform/packages/shared/kbn-rule-data-utils/src/rule_types/index.ts similarity index 100% rename from packages/kbn-rule-data-utils/src/rule_types/index.ts rename to src/platform/packages/shared/kbn-rule-data-utils/src/rule_types/index.ts diff --git a/packages/kbn-rule-data-utils/src/rule_types/o11y_rules.ts b/src/platform/packages/shared/kbn-rule-data-utils/src/rule_types/o11y_rules.ts similarity index 100% rename from packages/kbn-rule-data-utils/src/rule_types/o11y_rules.ts rename to src/platform/packages/shared/kbn-rule-data-utils/src/rule_types/o11y_rules.ts diff --git a/packages/kbn-rule-data-utils/src/rule_types/stack_rules.ts b/src/platform/packages/shared/kbn-rule-data-utils/src/rule_types/stack_rules.ts similarity index 100% rename from packages/kbn-rule-data-utils/src/rule_types/stack_rules.ts rename to src/platform/packages/shared/kbn-rule-data-utils/src/rule_types/stack_rules.ts diff --git a/packages/kbn-rule-data-utils/src/technical_field_names.ts b/src/platform/packages/shared/kbn-rule-data-utils/src/technical_field_names.ts similarity index 100% rename from packages/kbn-rule-data-utils/src/technical_field_names.ts rename to src/platform/packages/shared/kbn-rule-data-utils/src/technical_field_names.ts diff --git a/packages/kbn-rule-data-utils/tsconfig.json b/src/platform/packages/shared/kbn-rule-data-utils/tsconfig.json similarity index 82% rename from packages/kbn-rule-data-utils/tsconfig.json rename to src/platform/packages/shared/kbn-rule-data-utils/tsconfig.json index 77352c4f44209..536c1110ab3e3 100644 --- a/packages/kbn-rule-data-utils/tsconfig.json +++ b/src/platform/packages/shared/kbn-rule-data-utils/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig.base.json", + "extends": "../../../../../tsconfig.base.json", "compilerOptions": { "outDir": "target/types", "types": [ diff --git a/tsconfig.base.json b/tsconfig.base.json index c43eb12794e5d..73e7098c444de 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -1510,8 +1510,8 @@ "@kbn/routing-example-plugin/*": ["examples/routing_example/*"], "@kbn/rrule": ["packages/kbn-rrule"], "@kbn/rrule/*": ["packages/kbn-rrule/*"], - "@kbn/rule-data-utils": ["packages/kbn-rule-data-utils"], - "@kbn/rule-data-utils/*": ["packages/kbn-rule-data-utils/*"], + "@kbn/rule-data-utils": ["src/platform/packages/shared/kbn-rule-data-utils"], + "@kbn/rule-data-utils/*": ["src/platform/packages/shared/kbn-rule-data-utils/*"], "@kbn/rule-registry-plugin": ["x-pack/plugins/rule_registry"], "@kbn/rule-registry-plugin/*": ["x-pack/plugins/rule_registry/*"], "@kbn/runtime-fields-plugin": ["x-pack/platform/plugins/private/runtime_fields"], diff --git a/yarn.lock b/yarn.lock index 2aaff10774d3c..9755e42ba06df 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6827,7 +6827,7 @@ version "0.0.0" uid "" -"@kbn/rule-data-utils@link:packages/kbn-rule-data-utils": +"@kbn/rule-data-utils@link:src/platform/packages/shared/kbn-rule-data-utils": version "0.0.0" uid ""