Sustainable Kibana Architecture: Move modules owned by @elastic/kibana-reporting-services (#202741)

## 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.




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

| Id | Target folder |
| -- | ------------- |
| `@kbn/screenshotting-plugin` |
`x-pack/platform/plugins/shared/screenshotting` |


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

```
./docs/developer/plugin-list.asciidoc
./package.json
./packages/kbn-cli-dev-mode/src/watcher.ts
./packages/kbn-repo-packages/package-map.json
./packages/kbn-ts-projects/config-paths.json
./src/dev/code_coverage/ingest_coverage/__tests__/enumerate_patterns.test.js
./src/dev/precommit_hook/casing_check_config.js
./tsconfig.base.json
./x-pack/.gitignore
./x-pack/.i18nrc.json
./x-pack/platform/plugins/shared/screenshotting/README.md
./x-pack/platform/plugins/shared/screenshotting/jest.config.js
./x-pack/platform/plugins/shared/screenshotting/jest.integration.config.js
./x-pack/platform/plugins/shared/screenshotting/server/screenshots/screenshots.test.ts
./x-pack/plugins/lens/public/app_plugin/share_action.ts
./yarn.lock
```
</details>
<details>
<summary>Updated relative paths</summary>

```
x-pack/platform/plugins/shared/screenshotting/jest.config.js:10
x-pack/platform/plugins/shared/screenshotting/jest.integration.config.js:10
x-pack/platform/plugins/shared/screenshotting/server/formats/pdf/pdf_maker/worker_src_harness.js:14
x-pack/platform/plugins/shared/screenshotting/tsconfig.json:10
x-pack/platform/plugins/shared/screenshotting/tsconfig.json:14
x-pack/platform/plugins/shared/screenshotting/tsconfig.json:2
```
</details>
<details>
<summary>Script errors</summary>

```

```
</details>

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Gerard Soldevila 2024-12-18 02:49:07 +01:00 committed by GitHub
parent 7f7d354dd1
commit 0e2fc8f4e2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
133 changed files with 33 additions and 31 deletions

2
.github/CODEOWNERS vendored
View file

@ -864,6 +864,7 @@ x-pack/platform/plugins/shared/license_management @elastic/kibana-management
x-pack/platform/plugins/shared/ml @elastic/ml-ui
x-pack/platform/plugins/shared/observability_solution/observability_ai_assistant @elastic/obs-ai-assistant
x-pack/platform/plugins/shared/osquery @elastic/security-defend-workflows
x-pack/platform/plugins/shared/screenshotting @elastic/kibana-reporting-services
x-pack/platform/plugins/shared/searchprofiler @elastic/kibana-management
x-pack/plugins/actions @elastic/response-ops
x-pack/plugins/alerting @elastic/response-ops
@ -920,7 +921,6 @@ x-pack/plugins/observability_solution/profiling_data_access @elastic/obs-ux-infr
x-pack/plugins/reporting @elastic/appex-sharedux
x-pack/plugins/rule_registry @elastic/response-ops @elastic/obs-ux-management-team
x-pack/plugins/saved_objects_tagging @elastic/appex-sharedux
x-pack/plugins/screenshotting @elastic/kibana-reporting-services
x-pack/plugins/search_assistant @elastic/search-kibana
x-pack/plugins/search_connectors @elastic/search-kibana
x-pack/plugins/search_homepage @elastic/search-kibana

View file

@ -815,7 +815,7 @@ Elastic.
|Add tagging capability to saved objects
|{kib-repo}blob/{branch}/x-pack/plugins/screenshotting/README.md[screenshotting]
|{kib-repo}blob/{branch}/x-pack/platform/plugins/shared/screenshotting/README.md[screenshotting]
|This plugin provides functionality to take screenshots of the Kibana pages.
It uses Chromium and Puppeteer underneath to run the browser in headless mode.

View file

@ -796,7 +796,7 @@
"@kbn/screenshot-mode-example-plugin": "link:examples/screenshot_mode_example",
"@kbn/screenshot-mode-plugin": "link:src/plugins/screenshot_mode",
"@kbn/screenshotting-example-plugin": "link:x-pack/examples/screenshotting_example",
"@kbn/screenshotting-plugin": "link:x-pack/plugins/screenshotting",
"@kbn/screenshotting-plugin": "link:x-pack/platform/plugins/shared/screenshotting",
"@kbn/screenshotting-server": "link:packages/kbn-screenshotting-server",
"@kbn/search-api-keys-components": "link:packages/kbn-search-api-keys-components",
"@kbn/search-api-keys-server": "link:packages/kbn-search-api-keys-server",

View file

@ -19,7 +19,7 @@ import { Log } from './log';
const packageMatcher = makeMatcher([
'**/*',
'!**/.*',
'!x-pack/plugins/screenshotting/chromium/**',
'!x-pack/platform/plugins/shared/screenshotting/chromium/**',
'!x-pack/plugins/canvas/shareable_runtime/**',
]);

View file

@ -17,13 +17,13 @@ const log = new ToolingLog({
});
describe(`enumeratePatterns`, () => {
it(`should resolve x-pack/plugins/screenshotting/server/browsers/extract/unzip.ts to kibana-screenshotting`, () => {
it(`should resolve x-pack/platform/plugins/shared/screenshotting/server/browsers/extract/unzip.ts to kibana-screenshotting`, () => {
const actual = enumeratePatterns(REPO_ROOT)(log)(
new Map([['x-pack/plugins/screenshotting', ['kibana-screenshotting']]])
new Map([['x-pack/platform/plugins/shared/screenshotting', ['kibana-screenshotting']]])
);
expect(actual.flat()).toContain(
'x-pack/plugins/screenshotting/server/browsers/extract/unzip.ts kibana-screenshotting'
'x-pack/platform/plugins/shared/screenshotting/server/browsers/extract/unzip.ts kibana-screenshotting'
);
});
it(`should resolve src/plugins/charts/common/static/color_maps/color_maps.ts to kibana-app`, () => {

View file

@ -182,10 +182,10 @@ export const TEMPORARILY_IGNORED_PATHS = [
'x-pack/plugins/monitoring/public/icons/health-green.svg',
'x-pack/plugins/monitoring/public/icons/health-red.svg',
'x-pack/plugins/monitoring/public/icons/health-yellow.svg',
'x-pack/plugins/screenshotting/server/assets/fonts/noto/NotoSansCJKtc-Medium.ttf',
'x-pack/plugins/screenshotting/server/assets/fonts/noto/NotoSansCJKtc-Regular.ttf',
'x-pack/plugins/screenshotting/server/assets/fonts/roboto/Roboto-Italic.ttf',
'x-pack/plugins/screenshotting/server/assets/fonts/roboto/Roboto-Medium.ttf',
'x-pack/plugins/screenshotting/server/assets/fonts/roboto/Roboto-Regular.ttf',
'x-pack/plugins/screenshotting/server/assets/img/logo-grey.png',
'x-pack/platform/plugins/shared/screenshotting/server/assets/fonts/noto/NotoSansCJKtc-Medium.ttf',
'x-pack/platform/plugins/shared/screenshotting/server/assets/fonts/noto/NotoSansCJKtc-Regular.ttf',
'x-pack/platform/plugins/shared/screenshotting/server/assets/fonts/roboto/Roboto-Italic.ttf',
'x-pack/platform/plugins/shared/screenshotting/server/assets/fonts/roboto/Roboto-Medium.ttf',
'x-pack/platform/plugins/shared/screenshotting/server/assets/fonts/roboto/Roboto-Regular.ttf',
'x-pack/platform/plugins/shared/screenshotting/server/assets/img/logo-grey.png',
];

View file

@ -1568,8 +1568,8 @@
"@kbn/screenshot-mode-plugin/*": ["src/plugins/screenshot_mode/*"],
"@kbn/screenshotting-example-plugin": ["x-pack/examples/screenshotting_example"],
"@kbn/screenshotting-example-plugin/*": ["x-pack/examples/screenshotting_example/*"],
"@kbn/screenshotting-plugin": ["x-pack/plugins/screenshotting"],
"@kbn/screenshotting-plugin/*": ["x-pack/plugins/screenshotting/*"],
"@kbn/screenshotting-plugin": ["x-pack/platform/plugins/shared/screenshotting"],
"@kbn/screenshotting-plugin/*": ["x-pack/platform/plugins/shared/screenshotting/*"],
"@kbn/screenshotting-server": ["packages/kbn-screenshotting-server"],
"@kbn/screenshotting-server/*": ["packages/kbn-screenshotting-server/*"],
"@kbn/search-api-keys-components": ["packages/kbn-search-api-keys-components"],

2
x-pack/.gitignore vendored
View file

@ -6,7 +6,7 @@
/test/functional/apps/**/reports/session
/test/reporting/configs/failure_debug/
/plugins/reporting/.chromium/
/plugins/screenshotting/chromium/
/platform/plugins/shared/screenshotting/chromium/
/plugins/reporting/.phantom/
/.aws-config.json
/.env

View file

@ -128,7 +128,7 @@
"platform/plugins/private/rollup"
],
"xpack.runtimeFields": "platform/plugins/private/runtime_fields",
"xpack.screenshotting": "plugins/screenshotting",
"xpack.screenshotting": "platform/plugins/shared/screenshotting",
"xpack.searchSharedUI": "packages/search/shared_ui",
"xpack.searchHomepage": "plugins/search_homepage",
"xpack.searchIndices": "plugins/search_indices",

View file

@ -24,7 +24,7 @@ Here is an example of how you can take a screenshot of a Kibana URL.
```typescript
import { lastValueFrom } from 'rxjs';
import type { CoreSetup, Plugin } from 'src/core/server';
import type { ScreenshottingStart } from 'x-pack/plugins/screenshotting/server';
import type { ScreenshottingStart } from 'x-pack/platform/plugins/shared/screenshotting/server';
interface StartDeps {

View file

@ -7,9 +7,10 @@
module.exports = {
preset: '@kbn/test',
rootDir: '../../..',
roots: ['<rootDir>/x-pack/plugins/screenshotting'],
coverageDirectory: '<rootDir>/target/kibana-coverage/jest/x-pack/plugins/screenshotting',
rootDir: '../../../../..',
roots: ['<rootDir>/x-pack/platform/plugins/shared/screenshotting'],
coverageDirectory:
'<rootDir>/target/kibana-coverage/jest/x-pack/platform/plugins/shared/screenshotting',
coverageReporters: ['text', 'html'],
collectCoverageFrom: ['<rootDir>/x-pack/plugins/screenshotting/server/**/*.{ts}'],
collectCoverageFrom: ['<rootDir>/x-pack/platform/plugins/shared/screenshotting/server/**/*.{ts}'],
};

View file

@ -7,6 +7,6 @@
module.exports = {
preset: '@kbn/test/jest_integration',
rootDir: '../../..',
roots: ['<rootDir>/x-pack/plugins/screenshotting'],
rootDir: '../../../../..',
roots: ['<rootDir>/x-pack/platform/plugins/shared/screenshotting'],
};

View file

Before

Width:  |  Height:  |  Size: 8.1 KiB

After

Width:  |  Height:  |  Size: 8.1 KiB

Before After
Before After

View file

@ -11,6 +11,6 @@
*/
// eslint-disable-next-line @kbn/imports/no_boundary_crossing
require('../../../../../../../src/setup_node_env');
require('../../../../../../../../../src/setup_node_env');
// eslint-disable-next-line @kbn/imports/uniform_imports
require('./worker.ts');

Some files were not shown because too many files have changed in this diff Show more