Skip to content

Commit

Permalink
Sustainable Kibana Architecture: Move modules owned by `@elastic/obs-…
Browse files Browse the repository at this point in the history
…entities` (elastic#202713)

## Summary

This PR aims at relocating some of the Kibana modules (plugins and
packages) into a new folder structure, according to the _Sustainable
Kibana Architecture_ initiative.

> [!IMPORTANT]
> * We kindly ask you to:
> * Manually fix the errors in the error section below (if there are
any).
> * Search for the `packages[\/\\]` and `plugins[\/\\]` patterns in the
source code (Babel and Eslint config files), and update them
appropriately.
> * Manually review
`.buildkite/scripts/pipelines/pull_request/pipeline.ts` to ensure that
any CI pipeline customizations continue to be correctly applied after
the changed path names
> * Review all of the updated files, specially the `.ts` and `.js` files
listed in the sections below, as some of them contain relative paths
that have been updated.
> * Think of potential impact of the move, including tooling and
configuration files that can be pointing to the relocated modules. E.g.:
>     * customised eslint rules
>     * docs pointing to source code

> [!NOTE]
> This PR has been auto-generated.
> Do not attempt to push any changes unless you know what you are doing.
> Please use
[#sustainable_kibana_architecture](https://elastic.slack.com/archives/C07TCKTA22E)
Slack channel for feedback.




#### 3 plugin(s) are going to be relocated:

| Id | Target folder |
| -- | ------------- |
| `@kbn/entities-data-access-plugin` |
`x-pack/solutions/observability/plugins/observability_solution/entities_data_access`
|
| `@kbn/entityManager-app-plugin` |
`x-pack/solutions/observability/plugins/observability_solution/entity_manager_app`
|
| `@kbn/entityManager-plugin` |
`x-pack/platform/plugins/shared/entity_manager` |


#### 1 package(s) are going to be relocated:

  | Id | Target folder |
  | -- | ------------- |
| `@kbn/entities-schema` |
`x-pack/platform/packages/shared/kbn-entities-schema` |


<details>
<summary>Updated references</summary>

```
./docs/developer/plugin-list.asciidoc
./package.json
./packages/kbn-repo-packages/package-map.json
./packages/kbn-ts-projects/config-paths.json
./tsconfig.base.json
./x-pack/platform/packages/shared/kbn-entities-schema/jest.config.js
./x-pack/platform/plugins/shared/entity_manager/jest.config.js
./x-pack/plugins/entity_manager/docs/entity_definitions.md
./x-pack/solutions/observability/plugins/observability_solution/entities_data_access/jest.config.js
./x-pack/solutions/observability/plugins/observability_solution/entity_manager_app/jest.config.js
./yarn.lock
```
</details>
<details>
<summary>Updated relative paths</summary>

```
x-pack/platform/packages/shared/kbn-entities-schema/jest.config.js:10
x-pack/platform/packages/shared/kbn-entities-schema/scripts/generate.js:8
x-pack/platform/packages/shared/kbn-entities-schema/scripts/generate_oas.js:65
x-pack/platform/packages/shared/kbn-entities-schema/scripts/generate_oas.js:8
x-pack/platform/packages/shared/kbn-entities-schema/scripts/serve_oas_ui.js:8
x-pack/platform/packages/shared/kbn-entities-schema/tsconfig.json:2
x-pack/platform/plugins/shared/entity_manager/jest.config.js:10
x-pack/platform/plugins/shared/entity_manager/tsconfig.json:2
x-pack/platform/plugins/shared/entity_manager/tsconfig.json:7
x-pack/solutions/observability/plugins/observability_solution/entities_data_access/jest.config.js:12
x-pack/solutions/observability/plugins/observability_solution/entities_data_access/tsconfig.json:2
x-pack/solutions/observability/plugins/observability_solution/entity_manager_app/jest.config.js:12
x-pack/solutions/observability/plugins/observability_solution/entity_manager_app/tsconfig.json:2
x-pack/solutions/observability/plugins/observability_solution/entity_manager_app/tsconfig.json:7
```
</details>
<details>
<summary>Script errors</summary>

```

```
</details>

---------

Co-authored-by: kibanamachine <[email protected]>
Co-authored-by: Rudolf Meijering <[email protected]>
  • Loading branch information
3 people authored and markov00 committed Dec 7, 2024
1 parent a9bf579 commit 854f8b3
Show file tree
Hide file tree
Showing 191 changed files with 67 additions and 62 deletions.
8 changes: 4 additions & 4 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,6 @@ x-pack/packages/kbn-cloud-security-posture/public @elastic/kibana-cloud-security
x-pack/packages/kbn-data-forge @elastic/obs-ux-management-team
x-pack/packages/kbn-elastic-assistant @elastic/security-generative-ai
x-pack/packages/kbn-elastic-assistant-common @elastic/security-generative-ai
x-pack/packages/kbn-entities-schema @elastic/obs-entities
x-pack/packages/kbn-infra-forge @elastic/obs-ux-management-team
x-pack/packages/kbn-langchain @elastic/security-generative-ai
x-pack/packages/kbn-random-sampling @elastic/kibana-visualizations
Expand Down Expand Up @@ -864,6 +863,8 @@ x-pack/packages/security/plugin_types_server @elastic/kibana-security
x-pack/packages/security/role_management_model @elastic/kibana-security
x-pack/packages/security/ui_components @elastic/kibana-security
x-pack/performance @elastic/appex-qa
x-pack/platform/packages/shared/kbn-entities-schema @elastic/obs-entities
x-pack/platform/plugins/shared/entity_manager @elastic/obs-entities
x-pack/plugins/actions @elastic/response-ops
x-pack/plugins/ai_infra/llm_tasks @elastic/appex-ai-infra
x-pack/plugins/ai_infra/product_doc_base @elastic/appex-ai-infra
Expand Down Expand Up @@ -894,7 +895,6 @@ x-pack/plugins/elastic_assistant @elastic/security-generative-ai
x-pack/plugins/embeddable_enhanced @elastic/kibana-presentation
x-pack/plugins/encrypted_saved_objects @elastic/kibana-security
x-pack/plugins/enterprise_search @elastic/search-kibana
x-pack/plugins/entity_manager @elastic/obs-entities
x-pack/plugins/event_log @elastic/response-ops
x-pack/plugins/features @elastic/kibana-core
x-pack/plugins/fields_metadata @elastic/obs-ux-logs-team
Expand Down Expand Up @@ -926,8 +926,6 @@ x-pack/plugins/observability_solution/apm @elastic/obs-ux-infra_services-team
x-pack/plugins/observability_solution/apm_data_access @elastic/obs-ux-infra_services-team
x-pack/plugins/observability_solution/apm/ftr_e2e @elastic/obs-ux-infra_services-team
x-pack/plugins/observability_solution/dataset_quality @elastic/obs-ux-logs-team
x-pack/plugins/observability_solution/entities_data_access @elastic/obs-entities
x-pack/plugins/observability_solution/entity_manager_app @elastic/obs-entities
x-pack/plugins/observability_solution/exploratory_view @elastic/obs-ux-management-team
x-pack/plugins/observability_solution/infra @elastic/obs-ux-logs-team @elastic/obs-ux-infra_services-team
x-pack/plugins/observability_solution/inventory @elastic/obs-ux-infra_services-team
Expand Down Expand Up @@ -994,6 +992,8 @@ x-pack/plugins/translations @elastic/kibana-localization
x-pack/plugins/triggers_actions_ui @elastic/response-ops
x-pack/plugins/upgrade_assistant @elastic/kibana-management
x-pack/plugins/watcher @elastic/kibana-management
x-pack/solutions/observability/plugins/observability_solution/entities_data_access @elastic/obs-entities
x-pack/solutions/observability/plugins/observability_solution/entity_manager_app @elastic/obs-entities
x-pack/test
x-pack/test_serverless
x-pack/test/alerting_api_integration/common/plugins/aad @elastic/response-ops
Expand Down
6 changes: 3 additions & 3 deletions docs/developer/plugin-list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -575,15 +575,15 @@ security and spaces filtering.
|This plugin provides Kibana user interfaces for managing the Enterprise Search solution and its products, App Search and Workplace Search.
|{kib-repo}blob/{branch}/x-pack/plugins/observability_solution/entities_data_access/README.md[entitiesDataAccess]
|{kib-repo}blob/{branch}/x-pack/solutions/observability/plugins/observability_solution/entities_data_access/README.md[entitiesDataAccess]
|Exposes services to access entities data.
|{kib-repo}blob/{branch}/x-pack/plugins/entity_manager/README.md[entityManager]
|{kib-repo}blob/{branch}/x-pack/platform/plugins/shared/entity_manager/README.md[entityManager]
|This plugin provides access to observed entity data, such as information about hosts, pods, containers, services, and more.
|{kib-repo}blob/{branch}/x-pack/plugins/observability_solution/entity_manager_app/README.md[entityManagerApp]
|{kib-repo}blob/{branch}/x-pack/solutions/observability/plugins/observability_solution/entity_manager_app/README.md[entityManagerApp]
|This plugin provides a user interface to interact with the Entity Manager.
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -477,11 +477,11 @@
"@kbn/embedded-lens-example-plugin": "link:x-pack/examples/embedded_lens_example",
"@kbn/encrypted-saved-objects-plugin": "link:x-pack/plugins/encrypted_saved_objects",
"@kbn/enterprise-search-plugin": "link:x-pack/plugins/enterprise_search",
"@kbn/entities-data-access-plugin": "link:x-pack/plugins/observability_solution/entities_data_access",
"@kbn/entities-schema": "link:x-pack/packages/kbn-entities-schema",
"@kbn/entities-data-access-plugin": "link:x-pack/solutions/observability/plugins/observability_solution/entities_data_access",
"@kbn/entities-schema": "link:x-pack/platform/packages/shared/kbn-entities-schema",
"@kbn/entity-manager-fixture-plugin": "link:x-pack/test/api_integration/apis/entity_manager/fixture_plugin",
"@kbn/entityManager-app-plugin": "link:x-pack/plugins/observability_solution/entity_manager_app",
"@kbn/entityManager-plugin": "link:x-pack/plugins/entity_manager",
"@kbn/entityManager-app-plugin": "link:x-pack/solutions/observability/plugins/observability_solution/entity_manager_app",
"@kbn/entityManager-plugin": "link:x-pack/platform/plugins/shared/entity_manager",
"@kbn/error-boundary-example-plugin": "link:examples/error_boundary",
"@kbn/es-errors": "link:packages/kbn-es-errors",
"@kbn/es-query": "link:packages/kbn-es-query",
Expand Down
16 changes: 8 additions & 8 deletions tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -822,16 +822,16 @@
"@kbn/encrypted-saved-objects-plugin/*": ["x-pack/plugins/encrypted_saved_objects/*"],
"@kbn/enterprise-search-plugin": ["x-pack/plugins/enterprise_search"],
"@kbn/enterprise-search-plugin/*": ["x-pack/plugins/enterprise_search/*"],
"@kbn/entities-data-access-plugin": ["x-pack/plugins/observability_solution/entities_data_access"],
"@kbn/entities-data-access-plugin/*": ["x-pack/plugins/observability_solution/entities_data_access/*"],
"@kbn/entities-schema": ["x-pack/packages/kbn-entities-schema"],
"@kbn/entities-schema/*": ["x-pack/packages/kbn-entities-schema/*"],
"@kbn/entities-data-access-plugin": ["x-pack/solutions/observability/plugins/observability_solution/entities_data_access"],
"@kbn/entities-data-access-plugin/*": ["x-pack/solutions/observability/plugins/observability_solution/entities_data_access/*"],
"@kbn/entities-schema": ["x-pack/platform/packages/shared/kbn-entities-schema"],
"@kbn/entities-schema/*": ["x-pack/platform/packages/shared/kbn-entities-schema/*"],
"@kbn/entity-manager-fixture-plugin": ["x-pack/test/api_integration/apis/entity_manager/fixture_plugin"],
"@kbn/entity-manager-fixture-plugin/*": ["x-pack/test/api_integration/apis/entity_manager/fixture_plugin/*"],
"@kbn/entityManager-app-plugin": ["x-pack/plugins/observability_solution/entity_manager_app"],
"@kbn/entityManager-app-plugin/*": ["x-pack/plugins/observability_solution/entity_manager_app/*"],
"@kbn/entityManager-plugin": ["x-pack/plugins/entity_manager"],
"@kbn/entityManager-plugin/*": ["x-pack/plugins/entity_manager/*"],
"@kbn/entityManager-app-plugin": ["x-pack/solutions/observability/plugins/observability_solution/entity_manager_app"],
"@kbn/entityManager-app-plugin/*": ["x-pack/solutions/observability/plugins/observability_solution/entity_manager_app/*"],
"@kbn/entityManager-plugin": ["x-pack/platform/plugins/shared/entity_manager"],
"@kbn/entityManager-plugin/*": ["x-pack/platform/plugins/shared/entity_manager/*"],
"@kbn/error-boundary-example-plugin": ["examples/error_boundary"],
"@kbn/error-boundary-example-plugin/*": ["examples/error_boundary/*"],
"@kbn/es": ["packages/kbn-es"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@

module.exports = {
preset: '@kbn/test',
rootDir: '../../..',
roots: ['<rootDir>/x-pack/packages/kbn-entities-schema'],
rootDir: '../../../../..',
roots: ['<rootDir>/x-pack/platform/packages/shared/kbn-entities-schema'],
};
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

require('../../../../src/setup_node_env');
require('../../../../../../src/setup_node_env');

const { generateOAS } = require('./generate_oas');
const { writeFileSync } = require('fs');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

require('../../../../src/setup_node_env');
require('../../../../../../src/setup_node_env');

const swaggerJsdoc = require('swagger-jsdoc');
const { zodToJsonSchema } = require('zod-to-json-schema');
Expand Down Expand Up @@ -62,6 +62,6 @@ export const generateOAS = (options) =>
},
},
},
apis: ['../../plugins/observability_solution/entity_manager/server/routes/**/*.ts'],
apis: ['../../../../plugins/observability_solution/entity_manager/server/routes/**/*.ts'],
...options,
});
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

require('../../../../src/setup_node_env');
require('../../../../../../src/setup_node_env');

const { generateOAS } = require('./generate_oas');
const express = require('express');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../../tsconfig.base.json",
"extends": "../../../../../tsconfig.base.json",
"compilerOptions": {
"outDir": "target/types",
"types": [
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Entity definitions are a core concept of the entity model. They define the way t
> [!NOTE]
> Entity definitions are based on transform and as such a subset of the configuration is tightly coupled to transform settings. While we provide defaults for these settings, one can still update properties such as `frequency`, `sync.time.delay` and `sync.time.field` (see [transform documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/put-transform.html)).
When creating a definition (see [entity definition schema](https://github.com/elastic/kibana/blob/main/x-pack/packages/kbn-entities-schema/src/schema/entity_definition.ts#L21)), entity manager will create a transforms to collect entities based on the configured [identityFields](https://github.com/elastic/kibana/blob/main/x-pack/packages/kbn-entities-schema/src/schema/entity_definition.ts#L29).
When creating a definition (see [entity definition schema](https://github.com/elastic/kibana/blob/main/x-pack/platform/packages/shared/kbn-entities-schema/src/schema/entity_definition.ts#L21)), entity manager will create a transforms to collect entities based on the configured [identityFields](https://github.com/elastic/kibana/blob/main/x-pack/platform/packages/shared/kbn-entities-schema/src/schema/entity_definition.ts#L29).
The transform creates one document per entity, reading documents from the configured source indices and grouping them by the identity fields. Each entity document gets overwritten each time the transform runs.

The transforms outputs the data to a unique index (`.entities.v1.latest.<definition-id>`).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@

module.exports = {
preset: '@kbn/test',
rootDir: '../../..',
roots: ['<rootDir>/x-pack/plugins/entity_manager'],
coverageDirectory: '<rootDir>/target/kibana-coverage/jest/x-pack/plugins/entity_manager',
rootDir: '../../../../..',
roots: ['<rootDir>/x-pack/platform/plugins/shared/entity_manager'],
coverageDirectory:
'<rootDir>/target/kibana-coverage/jest/x-pack/platform/plugins/shared/entity_manager',
coverageReporters: ['text', 'html'],
collectCoverageFrom: [
'<rootDir>/x-pack/plugins/entity_manager/{common,public,server}/**/*.{js,ts,tsx}',
'<rootDir>/x-pack/platform/plugins/shared/entity_manager/{common,public,server}/**/*.{js,ts,tsx}',
],
};
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"extends": "../../../tsconfig.base.json",
"extends": "../../../../../tsconfig.base.json",
"compilerOptions": {
"outDir": "target/types"
},
"include": [
"../../../typings/**/*",
"../../../../../typings/**/*",
"common/**/*",
"server/**/*",
"public/**/*",
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ const path = require('path');

module.exports = {
preset: '@kbn/test',
rootDir: path.resolve(__dirname, '../../../..'),
roots: ['<rootDir>/x-pack/plugins/observability_solution/entities_data_access'],
rootDir: path.resolve(__dirname, '../../../../../..'),
roots: [
'<rootDir>/x-pack/solutions/observability/plugins/observability_solution/entities_data_access',
],
};
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../../../tsconfig.base.json",
"extends": "../../../../../../tsconfig.base.json",
"compilerOptions": {
"outDir": "target/types"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

const path = require('path');

module.exports = {
preset: '@kbn/test',
rootDir: path.resolve(__dirname, '../../../../../..'),
roots: [
'<rootDir>/x-pack/solutions/observability/plugins/observability_solution/entity_manager_app',
],
coverageDirectory:
'<rootDir>/target/kibana-coverage/jest/x-pack/solutions/observability/plugins/observability_solution/entity_manager_app',
coverageReporters: ['text', 'html'],
collectCoverageFrom: [
'<rootDir>/x-pack/solutions/observability/plugins/observability_solution/entity_manager_app/{common,public,server}/**/*.{js,ts,tsx}',
],
};
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"extends": "../../../../tsconfig.base.json",
"extends": "../../../../../../tsconfig.base.json",
"compilerOptions": {
"outDir": "target/types"
},
"include": [
"../../../../typings/**/*",
"../../../../../../typings/**/*",
"common/**/*",
"public/**/*",
"types/**/*"
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5460,23 +5460,23 @@
version "0.0.0"
uid ""

"@kbn/entities-data-access-plugin@link:x-pack/plugins/observability_solution/entities_data_access":
"@kbn/entities-data-access-plugin@link:x-pack/solutions/observability/plugins/observability_solution/entities_data_access":
version "0.0.0"
uid ""

"@kbn/entities-schema@link:x-pack/packages/kbn-entities-schema":
"@kbn/entities-schema@link:x-pack/platform/packages/shared/kbn-entities-schema":
version "0.0.0"
uid ""

"@kbn/entity-manager-fixture-plugin@link:x-pack/test/api_integration/apis/entity_manager/fixture_plugin":
version "0.0.0"
uid ""

"@kbn/entityManager-app-plugin@link:x-pack/plugins/observability_solution/entity_manager_app":
"@kbn/entityManager-app-plugin@link:x-pack/solutions/observability/plugins/observability_solution/entity_manager_app":
version "0.0.0"
uid ""

"@kbn/entityManager-plugin@link:x-pack/plugins/entity_manager":
"@kbn/entityManager-plugin@link:x-pack/platform/plugins/shared/entity_manager":
version "0.0.0"
uid ""

Expand Down

0 comments on commit 854f8b3

Please sign in to comment.