Skip to content

Commit

Permalink
[ingest pipeline mgmt] Move to x-pack/platform/plugins/shared/ingest_…
Browse files Browse the repository at this point in the history
…pipelines (elastic#204331)

## 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.
> * Any manual contributions will be lost if the 'relocate' script is
re-run.
> * Try to obtain the missing reviews / approvals before applying manual
fixes, and/or keep your changes in a .patch / git stash.
> * Please use
[#sustainable_kibana_architecture](https://elastic.slack.com/archives/C07TCKTA22E)
Slack channel for feedback.

Are you trying to rebase this PR to solve merge conflicts? Please follow
the steps describe
[here](https://elastic.slack.com/archives/C07TCKTA22E/p1734019532879269?thread_ts=1734019339.935419&cid=C07TCKTA22E).

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

| Id | Target folder |
| -- | ------------- |
| `@kbn/ingest-pipelines-plugin` |
`x-pack/platform/plugins/shared/ingest_pipelines` |

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

```
./docs/developer/plugin-list.asciidoc
./package.json
./packages/kbn-package-map/package-map.json
./packages/kbn-repo-packages/package-map.json
./packages/kbn-ts-projects/config-paths.json
./tsconfig.base.json
./tsconfig.base.type_check.json
./tsconfig.refs.json
./x-pack/.i18nrc.json
./x-pack/platform/plugins/private/transform/common/types/es_ingest_pipeline.ts
./x-pack/platform/plugins/shared/ingest_pipelines/jest.config.js
./yarn.lock
.github/CODEOWNERS
```

</details><details >
<summary>Updated relative paths</summary>

```
x-pack/platform/plugins/shared/ingest_pipelines/jest.config.js:10
x-pack/platform/plugins/shared/ingest_pipelines/tsconfig.json:11
x-pack/platform/plugins/shared/ingest_pipelines/tsconfig.json:2
x-pack/platform/plugins/shared/ingest_pipelines/tsconfig.type_check.json:13
x-pack/platform/plugins/shared/ingest_pipelines/tsconfig.type_check.json:2
x-pack/platform/plugins/shared/ingest_pipelines/tsconfig.type_check.json:20
x-pack/platform/plugins/shared/ingest_pipelines/tsconfig.type_check.json:35
x-pack/platform/plugins/shared/ingest_pipelines/tsconfig.type_check.json:38
x-pack/platform/plugins/shared/ingest_pipelines/tsconfig.type_check.json:41
x-pack/platform/plugins/shared/ingest_pipelines/tsconfig.type_check.json:44
x-pack/platform/plugins/shared/ingest_pipelines/tsconfig.type_check.json:47
x-pack/platform/plugins/shared/ingest_pipelines/tsconfig.type_check.json:50
x-pack/platform/plugins/shared/ingest_pipelines/tsconfig.type_check.json:53
x-pack/platform/plugins/shared/ingest_pipelines/tsconfig.type_check.json:56
x-pack/platform/plugins/shared/ingest_pipelines/tsconfig.type_check.json:59
x-pack/platform/plugins/shared/ingest_pipelines/tsconfig.type_check.json:62
x-pack/platform/plugins/shared/ingest_pipelines/tsconfig.type_check.json:65
x-pack/platform/plugins/shared/ingest_pipelines/tsconfig.type_check.json:68
x-pack/platform/plugins/shared/ingest_pipelines/tsconfig.type_check.json:71
x-pack/platform/plugins/shared/ingest_pipelines/tsconfig.type_check.json:74
x-pack/platform/plugins/shared/ingest_pipelines/tsconfig.type_check.json:77
x-pack/platform/plugins/shared/ingest_pipelines/tsconfig.type_check.json:80
x-pack/platform/plugins/shared/ingest_pipelines/tsconfig.type_check.json:83
x-pack/platform/plugins/shared/ingest_pipelines/tsconfig.type_check.json:86
x-pack/platform/plugins/shared/ingest_pipelines/tsconfig.type_check.json:89
x-pack/platform/plugins/shared/ingest_pipelines/tsconfig.type_check.json:92
x-pack/platform/plugins/shared/ingest_pipelines/tsconfig.type_check.json:95
```

</details>

---------

Co-authored-by: kibanamachine <[email protected]>
(cherry picked from commit 7460dc4)

# Conflicts:
#	.github/CODEOWNERS
#	x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/shared/stringify_value_description.test.ts
#	x-pack/platform/plugins/shared/ingest_pipelines/public/application/components/pipeline_editor/components/shared/stringify_value_description.ts
  • Loading branch information
mattkime committed Dec 16, 2024
1 parent 49f8fdd commit 0dc69fc
Show file tree
Hide file tree
Showing 324 changed files with 66 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,6 @@ x-pack/platform/packages/shared/ai-infra/inference-common @elastic/appex-ai-infr
x-pack/platform/plugins/shared/inference @elastic/appex-ai-infra
x-pack/platform/packages/private/kbn-infra-forge @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/ingest_pipelines @elastic/kibana-management
src/plugins/input_control_vis @elastic/kibana-presentation
src/plugins/inspector @elastic/kibana-presentation
x-pack/platform/plugins/shared/integration_assistant @elastic/security-scalability
Expand Down Expand Up @@ -576,6 +575,7 @@ x-pack/examples/lens_embeddable_inline_editing_example @elastic/kibana-visualiza
x-pack/plugins/lens @elastic/kibana-visualizations
x-pack/platform/plugins/private/license_api_guard @elastic/kibana-management
x-pack/platform/plugins/shared/license_management @elastic/kibana-management
x-pack/platform/plugins/shared/ingest_pipelines @elastic/kibana-management
x-pack/plugins/licensing @elastic/kibana-core
src/plugins/links @elastic/kibana-presentation
packages/kbn-lint-packages-cli @elastic/kibana-operations
Expand Down
2 changes: 1 addition & 1 deletion docs/developer/plugin-list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,7 @@ external LLM APIs. Its goals are:
the infrastructure monitoring use-case within Kibana.
|{kib-repo}blob/{branch}/x-pack/plugins/ingest_pipelines/README.md[ingestPipelines]
|{kib-repo}blob/{branch}/x-pack/platform/plugins/shared/ingest_pipelines/README.md[ingestPipelines]
|The ingest_pipelines plugin provides Kibana support for Elasticsearch's ingest pipelines.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@
"@kbn/inference_integration_flyout": "link:x-pack/platform/packages/private/ml/inference_integration_flyout",
"@kbn/infra-forge": "link:x-pack/platform/packages/private/kbn-infra-forge",
"@kbn/infra-plugin": "link:x-pack/plugins/observability_solution/infra",
"@kbn/ingest-pipelines-plugin": "link:x-pack/plugins/ingest_pipelines",
"@kbn/ingest-pipelines-plugin": "link:x-pack/platform/plugins/shared/ingest_pipelines",
"@kbn/input-control-vis-plugin": "link:src/plugins/input_control_vis",
"@kbn/inspector-plugin": "link:src/plugins/inspector",
"@kbn/integration-assistant-plugin": "link:x-pack/platform/plugins/shared/integration_assistant",
Expand Down
4 changes: 2 additions & 2 deletions tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -1068,8 +1068,8 @@
"@kbn/infra-forge/*": ["x-pack/platform/packages/private/kbn-infra-forge/*"],
"@kbn/infra-plugin": ["x-pack/plugins/observability_solution/infra"],
"@kbn/infra-plugin/*": ["x-pack/plugins/observability_solution/infra/*"],
"@kbn/ingest-pipelines-plugin": ["x-pack/plugins/ingest_pipelines"],
"@kbn/ingest-pipelines-plugin/*": ["x-pack/plugins/ingest_pipelines/*"],
"@kbn/ingest-pipelines-plugin": ["x-pack/platform/plugins/shared/ingest_pipelines"],
"@kbn/ingest-pipelines-plugin/*": ["x-pack/platform/plugins/shared/ingest_pipelines/*"],
"@kbn/input-control-vis-plugin": ["src/plugins/input_control_vis"],
"@kbn/input-control-vis-plugin/*": ["src/plugins/input_control_vis/*"],
"@kbn/inspector-plugin": ["src/plugins/inspector"],
Expand Down
2 changes: 1 addition & 1 deletion x-pack/.i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"xpack.logsExplorer": "plugins/observability_solution/logs_explorer",
"xpack.logsShared": "plugins/observability_solution/logs_shared",
"xpack.fleet": "plugins/fleet",
"xpack.ingestPipelines": "plugins/ingest_pipelines",
"xpack.ingestPipelines": "platform/plugins/shared/ingest_pipelines",
"xpack.integrationAssistant": "platform/plugins/shared/integration_assistant",
"xpack.inference": "platform/plugins/shared/inference",
"xpack.inventory": "plugins/observability_solution/inventory",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

// This interface doesn't cover a full ingest pipeline spec,
// just what's necessary to make it work in the transform creation wizard.
// The full interface can be found in x-pack/plugins/ingest_pipelines/common/types.ts
// The full interface can be found in x-pack/platform/plugins/shared/ingest_pipelines/common/types.ts
export interface EsIngestPipeline {
name: string;
}
File renamed without changes.
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/ingest_pipelines'],
coverageDirectory: '<rootDir>/target/kibana-coverage/jest/x-pack/plugins/ingest_pipelines',
rootDir: '../../../../..',
roots: ['<rootDir>/x-pack/platform/plugins/shared/ingest_pipelines'],
coverageDirectory:
'<rootDir>/target/kibana-coverage/jest/x-pack/platform/plugins/shared/ingest_pipelines',
coverageReporters: ['text', 'html'],
collectCoverageFrom: [
'<rootDir>/x-pack/plugins/ingest_pipelines/{common,public,server}/**/*.{ts,tsx}',
'<rootDir>/x-pack/platform/plugins/shared/ingest_pipelines/{common,public,server}/**/*.{ts,tsx}',
],
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* 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.
*/

import { stringifyValueDescription } from './stringify_value_description';

describe('StringifyValueDescription', () => {
it('works for a json object', () => {
expect(stringifyValueDescription({ test: 'test' })).toEqual('{"test":"test"}');
});
it('works for an array', () => {
expect(stringifyValueDescription(['a', 'b'])).toEqual('["a","b"]');
});
it('works for a string', () => {
expect(stringifyValueDescription('test')).toEqual('test');
});
it('works for a number', () => {
expect(stringifyValueDescription(123)).toEqual('123');
});
it('empty string for undefined', () => {
expect(stringifyValueDescription(undefined)).toEqual('');
});
it('empty string for null', () => {
expect(stringifyValueDescription(null)).toEqual('');
});
});
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.
*/

export const stringifyValueDescription = (value: unknown): string => {
if (!value) {
return '';
}
if (typeof value === 'object') {
try {
// if the value is a json object, it will be stringified as json
return JSON.stringify(value);
} catch (e) {
// ignore any errors
}
}
// otherwise just return a stringified value
return String(value);
};
Loading

0 comments on commit 0dc69fc

Please sign in to comment.