diff --git a/.buildkite/scripts/steps/checks/saved_objects_definition_change.sh b/.buildkite/scripts/steps/checks/saved_objects_definition_change.sh index 175128d536fd5..ad3561b16907c 100755 --- a/.buildkite/scripts/steps/checks/saved_objects_definition_change.sh +++ b/.buildkite/scripts/steps/checks/saved_objects_definition_change.sh @@ -5,7 +5,7 @@ set -euo pipefail source .buildkite/scripts/common/util.sh echo --- Check SO definition changes -cmd="node scripts/jest_integration -u src/core/server/integration_tests/ci_checks" +cmd="node scripts/jest_integration -u src/core/packages/core/server/integration_tests/ci_checks" eval "$cmd" check_for_changed_files "$cmd" true diff --git a/.eslintrc.js b/.eslintrc.js index b0db71e492bbe..3224c3f249f04 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1915,7 +1915,7 @@ module.exports = { { files: [ // core-team owned code - 'src/core/**', + 'src/core/packages/core/**', 'x-pack/plugins/features/**', 'x-pack/plugins/licensing/**', 'x-pack/plugins/global_search/**', diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 9051c3580057a..624e33ba09bb5 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1822,7 +1822,7 @@ packages/kbn-monaco/src/esql @elastic/kibana-esql /x-pack/test_serverless/api_integration/test_suites/**/telemetry/ @elastic/kibana-core /x-pack/test/functional/es_archives/cases/migrations/8.8.0 @elastic/response-ops -#CC# /src/core/server/csp/ @elastic/kibana-core +#CC# /src/core/packages/core/server/csp/ @elastic/kibana-core #CC# /src/plugins/saved_objects/ @elastic/kibana-core #CC# /x-pack/plugins/cloud/ @elastic/kibana-core #CC# /x-pack/plugins/features/ @elastic/kibana-core @@ -1848,7 +1848,7 @@ x-pack/plugins/cloud_integrations/cloud_full_story/server/config.ts @elastic/kib # Kibana Localization /src/dev/i18n_tools/ @elastic/kibana-localization @elastic/kibana-core -/src/core/public/i18n/ @elastic/kibana-localization @elastic/kibana-core +/src/core/packages/core/public/i18n/ @elastic/kibana-localization @elastic/kibana-core #CC# /x-pack/platform/plugins/private/translations/ @elastic/kibana-localization @elastic/kibana-core # Kibana Platform Security @@ -1887,7 +1887,7 @@ x-pack/plugins/cloud_integrations/cloud_full_story/server/config.ts @elastic/kib /.github/workflows/codeql.yml @elastic/kibana-security /.github/workflows/codeql-stats.yml @elastic/kibana-security /src/dev/eslint/security_eslint_rule_tests.ts @elastic/kibana-security -/src/core/server/integration_tests/config/check_dynamic_config.test.ts @elastic/kibana-security +/src/core/packages/core/server/integration_tests/config/check_dynamic_config.test.ts @elastic/kibana-security /src/plugins/telemetry/server/config/telemetry_labels.ts @elastic/kibana-security /packages/kbn-std/src/is_internal_url.test.ts @elastic/kibana-core @elastic/kibana-security /packages/kbn-std/src/is_internal_url.ts @elastic/kibana-core @elastic/kibana-security diff --git a/STYLEGUIDE.mdx b/STYLEGUIDE.mdx index 10815b1f0002c..e45ca068268d1 100644 --- a/STYLEGUIDE.mdx +++ b/STYLEGUIDE.mdx @@ -630,7 +630,7 @@ Doing so ensures the styles are never separated or lost on import and allows for better modularization (smaller individual plugin asset footprint). All SASS (.scss) files will automatically build with the [EUI](https://elastic.github.io/eui/#/guidelines/sass) -& Kibana invisibles (SASS variables, mixins, functions) from the [`globals_[theme].scss` file](src/core/public/styles/core_app/_globals_v8light.scss). +& Kibana invisibles (SASS variables, mixins, functions) from the [`globals_[theme].scss` file](src/core/packages/core/public/styles/core_app/_globals_v8light.scss). While the styles for this component will only be loaded if the component exists on the page, the styles **will** be global and so it is recommended to use a three letter prefix on your diff --git a/dev_docs/getting_started/hello_world_plugin.mdx b/dev_docs/getting_started/hello_world_plugin.mdx index 29e6944f88150..1ff408606564b 100644 --- a/dev_docs/getting_started/hello_world_plugin.mdx +++ b/dev_docs/getting_started/hello_world_plugin.mdx @@ -72,7 +72,7 @@ And add the following to it: ], "exclude": [], "references": [ - { "path": "../../src/core/tsconfig.json" } + { "path": "../../src/core/packages/core/tsconfig.json" } ] } ``` diff --git a/dev_docs/key_concepts/anatomy_of_a_plugin.mdx b/dev_docs/key_concepts/anatomy_of_a_plugin.mdx index 6b90fa0b0c938..69252141cfb97 100644 --- a/dev_docs/key_concepts/anatomy_of_a_plugin.mdx +++ b/dev_docs/key_concepts/anatomy_of_a_plugin.mdx @@ -112,7 +112,7 @@ If you are developing in TypeScript (which we recommend), you will need to add a ], "exclude": [], // If you import another plugin's types, point to their `tsconfig.json` file. - "references": [{ "path": "../../src/core/tsconfig.json" }] + "references": [{ "path": "../../src/core/packages/core/tsconfig.json" }] } ``` diff --git a/dev_docs/tutorials/advanced_settings.mdx b/dev_docs/tutorials/advanced_settings.mdx index 6789e9d6af7ad..e4f15bbf1581e 100644 --- a/dev_docs/tutorials/advanced_settings.mdx +++ b/dev_docs/tutorials/advanced_settings.mdx @@ -204,7 +204,7 @@ To change or remove a `uiSetting`, you must migrate the whole `config` Saved Obj For example, in 7.9.0, `siem` as renamed to `securitySolution`, and in 8.0.0, `theme:version` was removed: -**src/core/server/ui_settings/saved_objects/migrations.ts** +**src/core/packages/core/server/ui_settings/saved_objects/migrations.ts** ```ts import { SavedObjectUnsanitizedDoc, SavedObjectSanitizedDoc } from '@kbn/core/server'; @@ -271,4 +271,4 @@ first upgraded. Note that you might need to add an extra attribute to verify tha applied again in the future. For example, we needed to transform the `defaultIndex` attribute, and we added an extra `isDefaultIndexMigrated` attribute for this purpose. -See `src/core/server/ui_settings/saved_objects/transforms.ts` and [#13339](https://github.com/elastic/kibana/pull/133339) for an example. +See `src/core/packages/core/server/ui_settings/saved_objects/transforms.ts` and [#13339](https://github.com/elastic/kibana/pull/133339) for an example. diff --git a/dev_docs/tutorials/saved_objects.mdx b/dev_docs/tutorials/saved_objects.mdx index 71b99e2ae5e7e..f2eef18981674 100644 --- a/dev_docs/tutorials/saved_objects.mdx +++ b/dev_docs/tutorials/saved_objects.mdx @@ -14,7 +14,7 @@ The folder should contain a file per type, named after the snake_case name of th **src/plugins/my_plugin/server/saved_objects/dashboard_visualization.ts** ```ts -import { SavedObjectsType } from 'src/core/server'; +import { SavedObjectsType } from 'src/core/packages/core/server'; export const dashboardVisualization: SavedObjectsType = { name: 'dashboard_visualization', [1] @@ -79,7 +79,7 @@ For example, the mappings defined by the dashboard_visualization Saved Object ty **src/plugins/my_plugin/server/saved_objects/dashboard_visualization.ts** ```ts -import { SavedObjectsType } from 'src/core/server'; +import { SavedObjectsType } from 'src/core/packages/core/server'; export const dashboardVisualization: SavedObjectsType = { name: 'dashboard_visualization', @@ -126,8 +126,8 @@ Do not use field mappings like you would use data types for the columns of a SQL SQL index. Only specify field mappings for the fields you wish to search on or query. By specifying `dynamic: false` in any level of your mappings, Elasticsearch will accept and store any other fields even if they are not specified in your mappings. -Never use `enabled: false` or `index: false` in your mappings. Elasticsearch does not support toggling these mapping options, so if -your plugin ever needs to query the data, you will not be able to do so. Since these fields cannot be queried, they would require +Never use `enabled: false` or `index: false` in your mappings. Elasticsearch does not support toggling these mapping options, so if +your plugin ever needs to query the data, you will not be able to do so. Since these fields cannot be queried, they would require migrating to a new field and making associated code changes. Instead, use `dynamic: false` which provides the same flexibility while maintaining the future ability to query fields if necessary. @@ -233,7 +233,7 @@ The first version must be numbered as version 1, incrementing by one for each ne ```ts import { schema } from '@kbn/config-schema'; -import { SavedObjectsType } from 'src/core/server'; +import { SavedObjectsType } from 'src/core/packages/core/server'; const schemaV1 = schema.object({ title: schema.string({ maxLength: 50, minLength: 1 }) }); @@ -339,7 +339,7 @@ For complete control over your HTTP APIs and custom handling, declare your type The other option that allows you to build your own HTTP APIs and still use the client as-is is to declare your type as hidden from the global saved objects HTTP APIs as `hiddenFromHttpApis: true` ```ts -import { SavedObjectsType } from 'src/core/server'; +import { SavedObjectsType } from 'src/core/packages/core/server'; export const foo: SavedObjectsType = { name: 'foo', diff --git a/dev_docs/tutorials/screenshotting/screenshotting.mdx b/dev_docs/tutorials/screenshotting/screenshotting.mdx index 5d506e2cb13b4..bbca05057ef95 100644 --- a/dev_docs/tutorials/screenshotting/screenshotting.mdx +++ b/dev_docs/tutorials/screenshotting/screenshotting.mdx @@ -33,7 +33,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 { CoreSetup, Plugin } from 'src/core/packages/core/server'; import type { ScreenshottingStart } from 'x-pack/plugins/screenshotting/server'; diff --git a/dev_docs/tutorials/testing_plugins.mdx b/dev_docs/tutorials/testing_plugins.mdx index e4756472499ec..0cdb5607644e7 100644 --- a/dev_docs/tutorials/testing_plugins.mdx +++ b/dev_docs/tutorials/testing_plugins.mdx @@ -12,24 +12,24 @@ This document outlines best practices and patterns for testing Kibana Plugins. ## Strategy In general, we recommend three tiers of tests: -- Unit tests: small, fast, exhaustive, make heavy use of mocks for external dependencies +- Unit tests: small, fast, exhaustive, make heavy use of mocks for external dependencies - Integration tests: higher-level tests that verify interactions between systems (eg. HTTP APIs, Elasticsearch API calls, calling other plugin contracts). - End-to-end tests (e2e): tests that verify user-facing behavior through the browser -These tiers should roughly follow the traditional ["testing pyramid"](https://martinfowler.com/articles/practical-test-pyramid.html), where there are more exhaustive testing at the unit level, fewer at the integration level, and very few at the functional level. +These tiers should roughly follow the traditional ["testing pyramid"](https://martinfowler.com/articles/practical-test-pyramid.html), where there are more exhaustive testing at the unit level, fewer at the integration level, and very few at the functional level. ## Core Integrations ### Core Mocks -When testing a plugin's integration points with Core APIs, it is heavily recommended to utilize the mocks provided in `src/core/server/mocks` and `src/core/public/mocks`. The majority of these mocks are dumb `jest` mocks that mimic the interface of their respective Core APIs, however they do not return realistic return values. +When testing a plugin's integration points with Core APIs, it is heavily recommended to utilize the mocks provided in `src/core/packages/core/server/mocks` and `src/core/packages/core/public/mocks`. The majority of these mocks are dumb `jest` mocks that mimic the interface of their respective Core APIs, however they do not return realistic return values. If the unit under test expects a particular response from a Core API, the test will need to set this return value explicitly. The return values are type checked to match the Core API where possible to ensure that mocks are updated when Core APIs changed. #### Example ```typescript -import { elasticsearchServiceMock } from 'src/core/server/mocks'; +import { elasticsearchServiceMock } from 'src/core/packages/core/server/mocks'; test('my test', async () => { // Setup mock and faked response @@ -60,7 +60,7 @@ The plugin has *thin* route controllers isolating all the network layer dependen class TextFormatter { public static async format(text: string, sanitizer: Deps['sanitizer']) { // sanitizer.sanitize throws MisformedTextError when passed text contains HTML markup - const sanitizedText = await sanitizer.sanitize(text); + const sanitizedText = await sanitizer.sanitize(text); return sanitizedText; } @@ -146,7 +146,7 @@ router.get( ``` #### Unit testing -Unit tests provide the simplest and fastest way to test the logic in your route controllers and plugin models. +Unit tests provide the simplest and fastest way to test the logic in your route controllers and plugin models. Use them whenever adding an integration test is hard and slow due to complex setup or the number of logic permutations. Since all external core and plugin dependencies are mocked, you don't have the guarantee that the whole system works as expected. @@ -192,7 +192,7 @@ describe('TextFormatter', () => { ``` #### Integration tests -Depending on the number of external dependencies, you can consider implementing several high-level integration tests. +Depending on the number of external dependencies, you can consider implementing several high-level integration tests. They would work as a set of [smoke tests](https://en.wikipedia.org/wiki/Smoke_testing_(software)) for the most important functionality. Main subjects for tests should be: @@ -202,7 +202,7 @@ Main subjects for tests should be: - dependencies on other plugins. ##### Functional Test Runner -If your plugin relies on the elasticsearch server to store data and supports additional configuration, you can leverage the Functional Test Runner(FTR) to implement integration tests. +If your plugin relies on the elasticsearch server to store data and supports additional configuration, you can leverage the Functional Test Runner(FTR) to implement integration tests. FTR bootstraps an elasticsearch and a Kibana instance and runs the test suite against it. Pros: @@ -236,7 +236,7 @@ export default function({ getService }: FtrProviderContext) { .get('/myPlugin/health') .set('content-type', 'application/json') .expect(200); - + expect(response.body).to.have.property('basicInfo'); expect(response.body).not.to.have.property('detailedInfo'); }); @@ -247,7 +247,7 @@ export default function({ getService }: FtrProviderContext) { .get('/myPlugin/health') .set('content-type', 'application/json') .expect(200); - + expect(response.body).to.have.property('basicInfo'); expect(response.body).to.have.property('detailedInfo'); }); @@ -325,7 +325,7 @@ Cons: To have access to Kibana TestUtils, you should create `integration_tests` folder and import `test_utils` within a test file: ```typescript // src/plugins/my_plugin/server/integration_tests/formatter.test.ts -import * as kbnTestServer from 'src/core/test_helpers/kbn_server'; +import * as kbnTestServer from 'src/core/packages/core/test_helpers/kbn_server'; describe('myPlugin', () => { describe('GET /myPlugin/formatter', () => { @@ -365,7 +365,7 @@ describe('myPlugin', () => { }); }); ``` -Sometimes we want to test a route controller logic and don't rely on the internal logic of the platform or a third-party plugin. +Sometimes we want to test a route controller logic and don't rely on the internal logic of the platform or a third-party plugin. Then we can apply a hybrid approach and mock the necessary method of `TextFormatter` model to test how `MisformedTextError` handled in the route handler without calling `sanitizer` dependency directly. ```typescript @@ -398,7 +398,7 @@ describe('myPlugin', () => { ### Applications -Kibana Platform applications have less control over the page than legacy applications did. It is important that your app is built to handle it's co-habitance with other plugins in the browser. Applications are mounted and unmounted from the DOM as the user navigates between them, without full-page refreshes, as a single-page application (SPA). +Kibana Platform applications have less control over the page than legacy applications did. It is important that your app is built to handle it's co-habitance with other plugins in the browser. Applications are mounted and unmounted from the DOM as the user navigates between them, without full-page refreshes, as a single-page application (SPA). These long-lived sessions make cleanup more important than before. It's entirely possible a user has a single browsing session open for weeks at a time, without ever doing a full-page refresh. Common things that need to be cleaned up (and tested!) when your application is unmounted: - Subscriptions and polling (eg. `uiSettings.get$()`) @@ -438,7 +438,7 @@ We _could_ still write tests for this logic, but you may find that you're just a ```typescript /** public/plugin.test.ts */ jest.mock('./application', () => ({ renderApp: jest.fn() })); -import { coreMock } from 'src/core/public/mocks'; +import { coreMock } from 'src/core/packages/core/public/mocks'; import { renderApp: renderAppMock } from './application'; import { Plugin } from './plugin'; @@ -481,7 +481,7 @@ import React from 'react'; import ReactDOM from 'react-dom'; import { switchMap } from 'rxjs'; -import { AppMountParameters, CoreStart } from 'src/core/public'; +import { AppMountParameters, CoreStart } from 'src/core/packages/core/public'; import { AppRoot } from './components/app_root'; export const renderApp = ( @@ -523,8 +523,8 @@ In testing `renderApp` you should be verifying that: ```typescript /** public/application.test.ts */ import { createMemoryHistory } from 'history'; -import { ScopedHistory } from 'src/core/public'; -import { coreMock } from 'src/core/public/mocks'; +import { ScopedHistory } from 'src/core/packages/core/public'; +import { coreMock } from 'src/core/packages/core/public/mocks'; import { renderApp } from './application'; describe('renderApp', () => { @@ -690,7 +690,7 @@ reflected in the mock. import { SavedObjectsClientContract, SimpleSavedObject, -} from 'src/core/public'; +} from 'src/core/packages/core/public'; export type SavedQueryAttributes = { title: string; @@ -805,32 +805,32 @@ with model version and their associated transformations. #### Tooling for unit tests -For unit tests, the package exposes utilities to easily test the impact of transforming documents +For unit tests, the package exposes utilities to easily test the impact of transforming documents from a model version to another one, either upward or backward. ##### Model version test migrator -The `createModelVersionTestMigrator` helper allows to create a test migrator that can be used to +The `createModelVersionTestMigrator` helper allows to create a test migrator that can be used to test model version changes between versions, by transforming documents the same way the migration algorithm would during an upgrade. **Example:** ```ts -import { - createModelVersionTestMigrator, - type ModelVersionTestMigrator +import { + createModelVersionTestMigrator, + type ModelVersionTestMigrator } from '@kbn/core-test-helpers-model-versions'; const mySoTypeDefinition = someSoType(); describe('mySoTypeDefinition model version transformations', () => { let migrator: ModelVersionTestMigrator; - + beforeEach(() => { migrator = createModelVersionTestMigrator({ type: mySoTypeDefinition }); }); - + describe('Model version 2', () => { it('properly backfill the expected fields when converting from v1 to v2', () => { const obj = createSomeSavedObject(); @@ -864,7 +864,7 @@ describe('mySoTypeDefinition model version transformations', () => { During integration tests, we can boot a real Elasticsearch cluster, allowing us to manipulate SO documents in a way almost similar to how it would be done on production runtime. With integration tests, we can even simulate the cohabitation of two Kibana instances with different model versions -to assert the behavior of their interactions. +to assert the behavior of their interactions. ##### Model version test bed @@ -875,7 +875,7 @@ and to initiate the migration between the two versions we're testing. **Example:** ```ts -import { +import { createModelVersionTestBed, type ModelVersionTestKit } from '@kbn/core-test-helpers-model-versions'; @@ -941,7 +941,7 @@ test bed currently has some limitations: ## Limitations and edge cases in serverless environments The serverless environment, and the fact that upgrade in such environments are performed in a way -where, at some point, the old and new version of the application are living in cohabitation, leads +where, at some point, the old and new version of the application are living in cohabitation, leads to some particularities regarding the way the SO APIs works, and to some limitations / edge case that we need to document @@ -980,16 +980,16 @@ _How to test ES clients_ ## Plugin integrations In the Kibana Platform, all plugin's dependencies to other plugins are explicitly declared in their `kibana.json` -manifest. As for `core`, the dependencies `setup` and `start` contracts are injected in your plugin's respective +manifest. As for `core`, the dependencies `setup` and `start` contracts are injected in your plugin's respective `setup` and `start` phases. One of the upsides with testing is that every usage of the dependencies is explicit, -and that the plugin's contracts must be propagated to the parts of the code using them, meaning that isolating a +and that the plugin's contracts must be propagated to the parts of the code using them, meaning that isolating a specific logical component for unit testing is way easier than in legacy. The approach to test parts of a plugin's code that is relying on other plugins is quite similar to testing code using `core` APIs: it's expected to mock the dependency, and make it return the value the test is expecting. -Most plugins are defining mocks for their contracts. The convention is to expose them in a `mocks` file in -`my_plugin/server` and/or `my_plugin/public`. For example for the `data` plugin, the client-side mocks are located in +Most plugins are defining mocks for their contracts. The convention is to expose them in a `mocks` file in +`my_plugin/server` and/or `my_plugin/public`. For example for the `data` plugin, the client-side mocks are located in `src/plugins/data/public/mocks.ts`. When such mocks are present, it's strongly recommended to use them when testing against dependencies. Otherwise, one should create it's own mocked implementation of the dependency's contract (and should probably ping the plugin's owner to ask them to add proper contract mocks). @@ -997,8 +997,8 @@ contract (and should probably ping the plugin's owner to ask them to add proper ### Preconditions For these examples, we are going to see how we should test the `myPlugin` plugin. - -This plugin declares the `data` plugin as a `required` dependency and the `usageCollection` plugin as an `optional` + +This plugin declares the `data` plugin as a `required` dependency and the `usageCollection` plugin as an `optional` one. It also exposes a `getSpecialSuggestions` API in it's start contract, which relies on the `data` plugin to retrieve data. @@ -1101,8 +1101,8 @@ A plugin should test expected usage and calls on it's dependency plugins' API. Some calls, such as 'registration' APIs exposed from dependency plugins, should be checked, to ensure both that they are actually executed, and performed with the correct parameters. -For our example plugin's `SuggestionsService`, we should assert that the suggestion provider is correctly -registered to the `data` plugin during the `setup` phase, and that `getSuggestions` calls +For our example plugin's `SuggestionsService`, we should assert that the suggestion provider is correctly +registered to the `data` plugin during the `setup` phase, and that `getSuggestions` calls `autocomplete.getQuerySuggestions` with the correct parameters. ```typescript @@ -1162,7 +1162,7 @@ describe('SuggestionsService', () => { When testing parts of your plugin code that depends on the dependency plugin's data, the best approach is to mock the dependency to be able to get the behavior expected for the test. -In this example, we are going to mock the results of `autocomplete.getQuerySuggestions` to be able to test +In this example, we are going to mock the results of `autocomplete.getQuerySuggestions` to be able to test the service's `getSuggestions` method. ```typescript @@ -1229,12 +1229,12 @@ describe('Plugin', () => { data: dataPluginMock.createSetupContract(), // optional usageCollector dependency is not available }; - + const coreStart = coreMock.createStart(); const startDeps = { data: dataPluginMock.createStartContract(), }; - + expect(() => { plugin.setup(coreSetup, setupDeps); }).not.toThrow(); @@ -1281,7 +1281,7 @@ describe('Plugin', () => { ### Testing RXJS observables with marble -Testing observable based APIs can be challenging, specially when asynchronous operators or sources are used, +Testing observable based APIs can be challenging, specially when asynchronous operators or sources are used, or when trying to assert against emission's timing. Fortunately, RXJS comes with it's own `marble` testing module to greatly facilitate that kind of testing. @@ -1363,7 +1363,7 @@ Marble testing would allow to get rid of these limitations. An equivalent and im Notes: - the test is now synchronous -- the second parameter of `expectObservable` (`'301ms !'`) is used to perform manual unsubscription to the observable, as +- the second parameter of `expectObservable` (`'301ms !'`) is used to perform manual unsubscription to the observable, as `interval` never ends. - an emission is considered a time frame, meaning that after the initial `a` emission, we are at the frame `101`, not `100` which is why we are then only using a `99ms` gap between a->b and b->c. @@ -1381,7 +1381,7 @@ class FooService { // is, most of the time, a better solution. This is only used for the example purpose. getUpdate$: ({ abort$ = EMPTY }: { abort$?: Observable } = {}) => { return interval(100).pipe( - takeUntil(abort$), + takeUntil(abort$), map((count) => `update-${count + 1}`) ); }, @@ -1408,8 +1408,8 @@ it('getUpdate$ completes when `abort$` emits', () => { Notes: - the `|` symbol represents the completion of the observable. - we are here using the `hot` testing utility to create the `abort$` observable to ensure correct emission timing. - -#### Testing observable errors + +#### Testing observable errors Testing errors thrown by the observable is very close to the previous examples and is done using the third parameter of `expectObservable`. @@ -1441,9 +1441,9 @@ class BarService { } } ``` - + We could write a test that asserts the service properly emit processed results until an invalid data is encountered: - + ```typescript it('processDataStream throw an error when processing invalid data', () => { getTestScheduler().run(({ expectObservable, hot }) => { @@ -1472,7 +1472,7 @@ Notes: - the `#` symbol represents an error. - when throwing custom `Error` classes, the assertion can be against an error instance, but this doesn't work with base errors. - + #### Testing promise based observables In some cases, the observable we want to test is based on a Promise (like `of(somePromise).pipe(...)`). This can occur @@ -1507,7 +1507,7 @@ Testing that kind of promise based observable does not work out of the box with is not handled by the test scheduler's 'sandbox'. Fortunately, there are workarounds for this problem. The most common one being to mock the promise-returning API to return -an observable instead for testing, as `of(observable)` also works and returns the input observable. +an observable instead for testing, as `of(observable)` also works and returns the input observable. Note that when doing so, the test suite must also include tests using a real promise value to ensure correct behavior in real situation. diff --git a/docs/developer/architecture/core/saved-objects-service.asciidoc b/docs/developer/architecture/core/saved-objects-service.asciidoc index 71ece4ae3d735..6524ccc50ebd5 100644 --- a/docs/developer/architecture/core/saved-objects-service.asciidoc +++ b/docs/developer/architecture/core/saved-objects-service.asciidoc @@ -11,7 +11,7 @@ each type. By using Saved Objects your plugin can take advantage of the following features: - + * Migrations can evolve your document's schema by transforming documents and ensuring that the field mappings on the index are always up to date. * a <> is automatically exposed for each type (unless @@ -41,7 +41,7 @@ The folder should contain a file per type, named after the snake_case name of th .src/plugins/my_plugin/server/saved_objects/dashboard_visualization.ts [source,typescript] ---- -import { SavedObjectsType } from 'src/core/server'; +import { SavedObjectsType } from 'src/core/packages/core/server'; export const dashboardVisualization: SavedObjectsType = { name: 'dashboard_visualization', // <1> @@ -76,7 +76,7 @@ that objects of this type can only exist in a single space. See < name: 'search', diff --git a/docs/developer/architecture/core/uisettings-service.asciidoc b/docs/developer/architecture/core/uisettings-service.asciidoc index f70180b72d928..2c8ba39347250 100644 --- a/docs/developer/architecture/core/uisettings-service.asciidoc +++ b/docs/developer/architecture/core/uisettings-service.asciidoc @@ -45,7 +45,7 @@ In the interest of performance, `uiSettings` are cached. Any changes that requir [source,typescript] ---- -import { CoreSetup, Plugin } from 'src/core/public'; +import { CoreSetup, Plugin } from 'src/core/packages/core/public'; export class MyPlugin implements Plugin { public setup(core: CoreSetup): MyPluginSetup { @@ -60,7 +60,7 @@ export class MyPlugin implements Plugin { }); … } - + public start(core: CoreStart): MyPluginStart { return { … @@ -88,7 +88,7 @@ import type { CoreSetup,Plugin } from '@kbn/core/server'; export class MyPlugin implements Plugin { public setup(core: CoreSetup) { core.uiSettings.register({ - custom: { + custom: { value: '42', schema: schema.string(), }, @@ -128,7 +128,7 @@ export const migrations = { ...(doc.attributes && { attributes: Object.keys(doc.attributes).reduce( (acc, key) => - [ + [ // other settings to remove for 8.1.0... 'custom', ].includes(key) diff --git a/legacy_rfcs/text/0005_route_handler.md b/legacy_rfcs/text/0005_route_handler.md index d154d918448b6..49dca261e52c2 100644 --- a/legacy_rfcs/text/0005_route_handler.md +++ b/legacy_rfcs/text/0005_route_handler.md @@ -33,7 +33,7 @@ type RequestHandler = ( ``` and accepts next Kibana specific parameters as arguments: - context: [Context](https://github.com/elastic/kibana/blob/main/rfcs/text/0003_handler_interface.md#handler-context). A handler context contains core service and plugin functionality already scoped to the incoming request. -- request: [KibanaRequest](https://github.com/elastic/kibana/blob/main/src/core/server/http/router/request.ts). An immutable representation of the incoming request details, such as body, parameters, query, url and route information. Note: you **must** to specify route schema during route declaration to have access to `body, parameters, query` in the request object. You cannot extend KibanaRequest with arbitrary data nor remove any properties from it. +- request: [KibanaRequest](https://github.com/elastic/kibana/blob/main/src/core/packages/core/server/http/router/request.ts). An immutable representation of the incoming request details, such as body, parameters, query, url and route information. Note: you **must** to specify route schema during route declaration to have access to `body, parameters, query` in the request object. You cannot extend KibanaRequest with arbitrary data nor remove any properties from it. ```typescript interface KibanaRequest { url: url.Url; @@ -50,7 +50,7 @@ interface KibanaRequest { } } ``` -- t: [KibanaResponseToolkit](https://github.com/elastic/kibana/blob/main/src/core/server/http/router/response.ts#L27) +- t: [KibanaResponseToolkit](https://github.com/elastic/kibana/blob/main/src/core/packages/core/server/http/router/response.ts#L27) Provides a set of pre-configured methods to respond to an incoming request. It is expected that handler **always** returns a result of one of `KibanaResponseToolkit` methods as an output: ```typescript interface KibanaResponseToolkit { @@ -67,7 +67,7 @@ router.get(..., ``` *KibanaResponseToolkit* methods allow an end user to adjust the next response parameters: - Body. Supported values:`undefined | string | JSONValue | Buffer | Stream`. -- Status code. +- Status code. - Headers. Supports adjusting [known values](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/node/v10/http.d.ts#L8) and attaching [custom values as well](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/node/v10/http.d.ts#L67) Other response parameters, such as `etag`, `MIME-type`, `bytes` that used in the Legacy platform could be adjusted via Headers. @@ -162,7 +162,7 @@ export const kibanaResponseToolkit = { - `Handler` doesn't cover **all** functionality of the Legacy server at the current moment. For example, we cannot render a view in New platform yet and in this case, we have to proxy the request to the Legacy platform endpoint to perform rendering. All such cases should be considered in an individual order. - `KibanaResponseToolkit` may not cover all use cases and requires an extension for specific use-cases. - `KibanaResponseToolkit` operates low-level Http primitives, such as Headers e.g., and it is not always handy to work with them directly. -- `KibanaResponse` cannot be extended with arbitrary data. +- `KibanaResponse` cannot be extended with arbitrary data. # Alternatives diff --git a/legacy_rfcs/text/0015_bazel.md b/legacy_rfcs/text/0015_bazel.md index 390a2d68eb7ab..eb059050c848f 100644 --- a/legacy_rfcs/text/0015_bazel.md +++ b/legacy_rfcs/text/0015_bazel.md @@ -28,7 +28,7 @@ Kibana has grown substantially over the years and now includes more than 2,100,0 ### Installation of NPM dependencies -Yarn Package Manager handles the installation of NPM dependencies, and the migration to Bazel will not immediately affect the time this step takes. +Yarn Package Manager handles the installation of NPM dependencies, and the migration to Bazel will not immediately affect the time this step takes. ### Building packages @@ -40,7 +40,7 @@ The size of the project and the amount of TypeScript has created scaling issues, ### Building client-side plugins -The [@kbn/optimizer](https://github.com/elastic/kibana/tree/main/packages/kbn-optimizer) package is responsible for building client-side plugins and is initiated during `yarn start`. Without any cache, it takes between three and four minutes, but is highly dependent on the amount of CPU cores available. The caching works similar to packages and requires a rebuild if any files change. Under the hood, this package is managing a set number of workers to run individual Webpack instances. When we first introduced Webpack back in [June of 2015](https://github.com/elastic/kibana/pull/4335), it was responsible for bundling all client-side code within a single process. As the Kibana project continued to grow over time, this Webpack process continued to impact the developer experience. A common theme to address these issues was through reducing the responsibilities of Webpack by separating [SCSS](https://github.com/elastic/kibana/pull/19643) and [vendor code](https://github.com/elastic/kibana/pull/22618). Knowing we would need to continue to scale, one of the new platform’s core objectives was to be able to build each plugin independently. This work paved the way for what we are proposing here and led to the [creation of @kbn/optimizer](https://github.com/elastic/kibana/pull/53976), which improved performance by separating and parallelizing Webpack builds. +The [@kbn/optimizer](https://github.com/elastic/kibana/tree/main/packages/kbn-optimizer) package is responsible for building client-side plugins and is initiated during `yarn start`. Without any cache, it takes between three and four minutes, but is highly dependent on the amount of CPU cores available. The caching works similar to packages and requires a rebuild if any files change. Under the hood, this package is managing a set number of workers to run individual Webpack instances. When we first introduced Webpack back in [June of 2015](https://github.com/elastic/kibana/pull/4335), it was responsible for bundling all client-side code within a single process. As the Kibana project continued to grow over time, this Webpack process continued to impact the developer experience. A common theme to address these issues was through reducing the responsibilities of Webpack by separating [SCSS](https://github.com/elastic/kibana/pull/19643) and [vendor code](https://github.com/elastic/kibana/pull/22618). Knowing we would need to continue to scale, one of the new platform’s core objectives was to be able to build each plugin independently. This work paved the way for what we are proposing here and led to the [creation of @kbn/optimizer](https://github.com/elastic/kibana/pull/53976), which improved performance by separating and parallelizing Webpack builds. ### Compiling server-side code @@ -65,9 +65,9 @@ To avoid adding Bazel as a dependency that developers need to manage, we will be ## Typescript -The [NodeJS](https://bazelbuild.github.io/rules_nodejs/TypeScript.html) rules for Bazel contain two different methods for handling TypeScript; `ts_library` and `ts_project`. We will be using `ts_project`, as it provides a wrapper around `tsc` where `ts_library` is an open-sourced version of the rule used to compile TypeScript at Google. While there are advantages to `ts_library`, it’s very opinionated and hard to migrate an existing project to while also locking us into a specific version of TypeScript. Over time, it’s expected that `ts_project` will catch up to that of `ts_library`. +The [NodeJS](https://bazelbuild.github.io/rules_nodejs/TypeScript.html) rules for Bazel contain two different methods for handling TypeScript; `ts_library` and `ts_project`. We will be using `ts_project`, as it provides a wrapper around `tsc` where `ts_library` is an open-sourced version of the rule used to compile TypeScript at Google. While there are advantages to `ts_library`, it’s very opinionated and hard to migrate an existing project to while also locking us into a specific version of TypeScript. Over time, it’s expected that `ts_project` will catch up to that of `ts_library`. -Bazel maintains a persistent worker which `ts_project` takes advantage of by keeping the AST in memory and providing incremental updates. This should improve the time it takes for changes to be represented. +Bazel maintains a persistent worker which `ts_project` takes advantage of by keeping the AST in memory and providing incremental updates. This should improve the time it takes for changes to be represented. A Bazel [macro](https://docs.bazel.build/versions/master/skylark/macros.html) will be created to centralize the usage of `ts_project`. The macro will, at minimum, accept a TypeScript configuration file, supply the base `tsconfig.js` file as a source and ensure incremental builds are enabled. @@ -76,7 +76,7 @@ A Bazel [macro](https://docs.bazel.build/versions/master/skylark/macros.html) wi A Bazel [macro](https://docs.bazel.build/versions/master/skylark/macros.html) will be created to centralize the usage of Webpack. The macro will, at minimum, accept a configuration file and supply a base `webpack.config.js` file. Currently, all plugins share the same Webpack configuration. Allowing a plugin to provide additional configuration will allow plugins the ability to add loaders without affecting the performance of others. -While running Kibana from source in development, the proxy server will ensure that client-side code for plugins is compiled and available. This is currently handled by the [basePathProxy](https://github.com/elastic/kibana/blob/main/src/core/server/http/base_path_proxy_server.ts), where server restarts and optimizer builds are observed and cause the proxy to pause requests. With Bazel, we will utilize [iBazel](https://github.com/bazelbuild/bazel-watche) to watch for file changes and re-build the plugin targets when necessary. The watcher will emit [events](https://github.com/bazelbuild/bazel-watcher#remote-events) that we will use to block requests and provide feedback to the logs. +While running Kibana from source in development, the proxy server will ensure that client-side code for plugins is compiled and available. This is currently handled by the [basePathProxy](https://github.com/elastic/kibana/blob/main/src/core/packages/core/server/http/base_path_proxy_server.ts), where server restarts and optimizer builds are observed and cause the proxy to pause requests. With Bazel, we will utilize [iBazel](https://github.com/bazelbuild/bazel-watche) to watch for file changes and re-build the plugin targets when necessary. The watcher will emit [events](https://github.com/bazelbuild/bazel-watcher#remote-events) that we will use to block requests and provide feedback to the logs. While there are a few proofs of concepts for a Webpack 5 Bazel rule, none currently exist which are deemed production-ready. In the meantime, we can use the Webpack CLI directly. One of the main advantages being explored in these rules will be the support for using the Bazel worker to provide incremental builds similar to what `@kbn/optimizer` is doing today. @@ -85,7 +85,7 @@ We are aware there are quite a few alternatives to Webpack, but our plan is to c ### Unit Testing -A Bazel macro will be created to centralize the usage of Jest unit testing. The macro will, at minimum, accept a Jest configuration file, add the [Jest preset](https://github.com/elastic/kibana/blob/main/packages/kbn-test/jest-preset.js) and its dependencies as sources, then use the Jest CLI to execute tests. +A Bazel macro will be created to centralize the usage of Jest unit testing. The macro will, at minimum, accept a Jest configuration file, add the [Jest preset](https://github.com/elastic/kibana/blob/main/packages/kbn-test/jest-preset.js) and its dependencies as sources, then use the Jest CLI to execute tests. Developers currently use `yarn test:jest` to efficiently run tests in a given directory without remembering the command or path. This command will continue to work as it does today, but will begin running tests through Bazel for packages or plugins which have been migrated. @@ -137,13 +137,13 @@ Bazel outputs are created in a folder relative to the monorepo at `./bazel`. How ## Build Packaging -One of the additional benefits to Bazel is that it is multi-platform. While it runs on Linux, macOS, and Windows, it can build binaries across platforms. +One of the additional benefits to Bazel is that it is multi-platform. While it runs on Linux, macOS, and Windows, it can build binaries across platforms. Bazel provides a [pkg](https://github.com/bazelbuild/rules_pkg/tree/main/pkg) rule providing tar, deb, and rpm support. To facilitate cross-platform tar support in the distributable build, we are currently using tar through Node, which is slow. The pkg tar rule will provide an improvement in performance. For deb and RPM builds, Kibana is currently using a Ruby package called [fpm](https://github.com/jordansissel/fpm) created by a former Elastic employee. For Docker, we currently create the images during the build using Docker then extract the image as a tar to provide the Release Manager which publishes it to our repository. For ARM, we only create a Docker context which Release Manager uses to create the image on ARM hardware. Bazel has a [docker](https://github.com/bazelbuild/rules_docker) rule, which should allow us to cross-build, and do so without actually using Docker. -The current build is fairly procedural and has little caching where subsequent builds take almost as long as the previous. When working on a step later in the build system, one ultimately ends up commenting out previously completed steps to save time when testing. With Bazel, each target consumes sources or dependencies which could be other targets. Conceivably, we will have a target called release, which is dependent on another target for each of the assets in the distribution (Windows zip, Linux 64-bit tar, Darwin tar, RPM 64-bit, Deb 64-bit, Bed Aarch64, etc). Each one of these assets will then depend on the Kibana core and the rest of the plugins. The entire dependency tree for this will be resolved and rebuilt only when necessary. +The current build is fairly procedural and has little caching where subsequent builds take almost as long as the previous. When working on a step later in the build system, one ultimately ends up commenting out previously completed steps to save time when testing. With Bazel, each target consumes sources or dependencies which could be other targets. Conceivably, we will have a target called release, which is dependent on another target for each of the assets in the distribution (Windows zip, Linux 64-bit tar, Darwin tar, RPM 64-bit, Deb 64-bit, Bed Aarch64, etc). Each one of these assets will then depend on the Kibana core and the rest of the plugins. The entire dependency tree for this will be resolved and rebuilt only when necessary. ## scripts/* @@ -165,10 +165,10 @@ We have created a proof of concept using persistent storage on Google Cloud and ## Packages Build Outline Within Bazel, the packages will have new overall rules: - + * It cannot contain build scripts. Every package build will be written using a Bazel `BUILD.bazel` file * It cannot have side effects. Every package build should be cacheable and reproducible and can not produce any side effects -* Each package should define three major public target rules in `BUILD.bazel` files: `build`, `jest`, and a js_library target with the same name of the folder where the package is living. +* Each package should define three major public target rules in `BUILD.bazel` files: `build`, `jest`, and a js_library target with the same name of the folder where the package is living. * In order to output its targets in the most Bazel friendly way, each package will output its target according to the following folder structure: for node targets, it will be `target_server`, for web target it will be `target_web` and for types, it will be `target_types`. @@ -244,7 +244,7 @@ The `BUILD.bazel` files will look similar to that of packages, there will be a t Plugins are built in a sandbox, so they will no longer be able to use relative imports from one another. For Typescript, relative imports will be replaced with a path reference to the `bazel/bin`. -Static imports across plugins are a concern that would affect the developer experience due to cascading re-builds. For example, if every plugin has static imports from `src/core`, any changes to `src/core` would cause all those plugins to re-build. There are a few options to address this; the first would be to minimize or eliminate these imports. Most plugins are importing types, so we can also ensure that only type-level changes actually trigger a re-build. Additionally, these types of dependencies could be further broken down into smaller packages to reduce the times further this is necessary. +Static imports across plugins are a concern that would affect the developer experience due to cascading re-builds. For example, if every plugin has static imports from `src/core`, any changes to `src/core` would cause all those plugins to re-build. There are a few options to address this; the first would be to minimize or eliminate these imports. Most plugins are importing types, so we can also ensure that only type-level changes actually trigger a re-build. Additionally, these types of dependencies could be further broken down into smaller packages to reduce the times further this is necessary. ``` "compilerOptions": { diff --git a/legacy_rfcs/text/0016_ols_phase_1.md b/legacy_rfcs/text/0016_ols_phase_1.md index c1f65111df328..785f66f9a7a30 100644 --- a/legacy_rfcs/text/0016_ols_phase_1.md +++ b/legacy_rfcs/text/0016_ols_phase_1.md @@ -38,7 +38,7 @@ Public (non-private) saved object types are not impacted by this RFC. This propo ## 3.1 Saved Objects Service ### 3.1.1 Type registry -The [saved objects type registry](https://github.com/elastic/kibana/blob/701697cc4a34d07c0508c3bdf01dca6f9d40a636/src/core/server/saved_objects/saved_objects_type_registry.ts) will allow consumers to register "private" saved object types via a new `accessClassification` property: +The [saved objects type registry](https://github.com/elastic/kibana/blob/701697cc4a34d07c0508c3bdf01dca6f9d40a636/src/core/packages/core/server/saved_objects/saved_objects_type_registry.ts) will allow consumers to register "private" saved object types via a new `accessClassification` property: ```ts /** @@ -170,7 +170,7 @@ This overhead does not impact deleting "public" objects. We only need to retriev ### `find` -The security wrapper will supply or augment a [KQL `filter`](https://github.com/elastic/kibana/blob/701697cc4a34d07c0508c3bdf01dca6f9d40a636/src/core/server/saved_objects/types.ts#L118) which describes the objects the current user is authorized to see. +The security wrapper will supply or augment a [KQL `filter`](https://github.com/elastic/kibana/blob/701697cc4a34d07c0508c3bdf01dca6f9d40a636/src/core/packages/core/server/saved_objects/types.ts#L118) which describes the objects the current user is authorized to see. ```ts // Sample KQL filter @@ -255,7 +255,7 @@ Now that we no longer ship an OSS distribution, we could move the audit logging If we take this approach, then we will need a way to create a repository without audit logging. Certain features rely on the fact that the repository does not perform its own audit logging (such as Alerting, and the background repair jobs for ML). -Core originally provided an [`audit_trail_service`](https://github.com/elastic/kibana/blob/v7.9.3/src/core/server/audit_trail/audit_trail_service.ts) for this type of functionality, with the thinking that OSS features could take advantage of this if needed. This was abandoned when we discovered that we had no such usages at the time, so we simplified the architecture. We could re-introduce this if desired, in order to support this initiative. +Core originally provided an [`audit_trail_service`](https://github.com/elastic/kibana/blob/v7.9.3/src/core/packages/core/server/audit_trail/audit_trail_service.ts) for this type of functionality, with the thinking that OSS features could take advantage of this if needed. This was abandoned when we discovered that we had no such usages at the time, so we simplified the architecture. We could re-introduce this if desired, in order to support this initiative. Not all saved object audit events can be recorded by the repository. When users are not authorized at the type level (e.g., user can't `create` `dashboards`), then the wrapper will record this and not allow the operation to proceed. This shared-responsibility model will likely be even more confusing to reason about, so I'm not sure it's worth the small performance optimization we would get in return. @@ -320,4 +320,4 @@ Additionally, we will introduce a sub-feature privilege which will allow adminis ## 9.3 Behavior when security is disabled -When security is disabled, `private` objects will still be accessible via the Saved Objects Client. \ No newline at end of file +When security is disabled, `private` objects will still be accessible via the Saved Objects Client. diff --git a/package.json b/package.json index b0d9f7c093c1f..0272ce1371dad 100644 --- a/package.json +++ b/package.json @@ -244,7 +244,7 @@ "@kbn/content-management-utils": "link:packages/kbn-content-management-utils", "@kbn/controls-example-plugin": "link:examples/controls_example", "@kbn/controls-plugin": "link:src/plugins/controls", - "@kbn/core": "link:src/core", + "@kbn/core": "link:src/core/packages/core", "@kbn/core-analytics-browser": "link:packages/core/analytics/core-analytics-browser", "@kbn/core-analytics-browser-internal": "link:packages/core/analytics/core-analytics-browser-internal", "@kbn/core-analytics-server": "link:packages/core/analytics/core-analytics-server", diff --git a/packages/core/application/core-application-browser/src/app_mount.ts b/packages/core/application/core-application-browser/src/app_mount.ts index 4fb38b10a3704..0ef651b53403a 100644 --- a/packages/core/application/core-application-browser/src/app_mount.ts +++ b/packages/core/application/core-application-browser/src/app_mount.ts @@ -67,7 +67,7 @@ export interface AppMountParameters { * import ReactDOM from 'react-dom'; * import { Router, Route } from 'react-router-dom'; * - * import { CoreStart, AppMountParameters } from 'src/core/public'; + * import { CoreStart, AppMountParameters } from 'src/core/packages/core/public'; * import { MyPluginDepsStart } from './plugin'; * * export renderApp = ({ element, history }: AppMountParameters) => { @@ -117,7 +117,7 @@ export interface AppMountParameters { * import ReactDOM from 'react-dom'; * import { BrowserRouter, Route } from 'react-router-dom'; * - * import { CoreStart, AppMountParameters } from 'src/core/public'; + * import { CoreStart, AppMountParameters } from 'src/core/packages/core/public'; * import { MyPluginDepsStart } from './plugin'; * * export renderApp = ({ appBasePath, element }: AppMountParameters) => { @@ -152,7 +152,7 @@ export interface AppMountParameters { * import ReactDOM from 'react-dom'; * import { BrowserRouter, Route } from 'react-router-dom'; * - * import { CoreStart, AppMountParameters } from 'src/core/public'; + * import { CoreStart, AppMountParameters } from 'src/core/packages/core/public'; * import { MyPluginDepsStart } from './plugin'; * * export renderApp = ({ element, history, onAppLeave }: AppMountParameters) => { @@ -190,7 +190,7 @@ export interface AppMountParameters { * import ReactDOM from 'react-dom'; * import { BrowserRouter, Route } from 'react-router-dom'; * - * import { CoreStart, AppMountParameters } from 'src/core/public'; + * import { CoreStart, AppMountParameters } from 'src/core/packages/core/public'; * import { MyPluginDepsStart } from './plugin'; * * export renderApp = ({ element, history, setHeaderActionMenu }: AppMountParameters) => { @@ -216,7 +216,7 @@ export interface AppMountParameters { * import React from 'react'; * import ReactDOM from 'react-dom'; * - * import { AppMountParameters } from 'src/core/public'; + * import { AppMountParameters } from 'src/core/packages/core/public'; * import { wrapWithTheme } from 'src/plugins/kibana_react'; * import { MyApp } from './app'; * diff --git a/packages/core/deprecations/core-deprecations-common/src/types.ts b/packages/core/deprecations/core-deprecations-common/src/types.ts index 45f93aa5ba921..d8c1dcd6e7403 100644 --- a/packages/core/deprecations/core-deprecations-common/src/types.ts +++ b/packages/core/deprecations/core-deprecations-common/src/types.ts @@ -20,12 +20,12 @@ export interface DeprecationDetailsMessage { export interface BaseDeprecationDetails { /** * The title of the deprecation. - * Check the README for writing deprecations in `src/core/server/deprecations/README.mdx` + * Check the README for writing deprecations in `src/core/packages/core/server/deprecations/README.mdx` */ title: string; /** * The description message to be displayed for the deprecation. - * Check the README for writing deprecations in `src/core/server/deprecations/README.mdx` + * Check the README for writing deprecations in `src/core/packages/core/server/deprecations/README.mdx` */ message: string | DeprecationDetailsMessage | Array; /** @@ -72,7 +72,7 @@ export interface BaseDeprecationDetails { * Specify a list of manual steps users need to follow to * fix the deprecation before upgrade. Required even if an API * corrective action is set in case the API fails. - * Check the README for writing deprecations in `src/core/server/deprecations/README.mdx` + * Check the README for writing deprecations in `src/core/packages/core/server/deprecations/README.mdx` */ manualSteps: string[]; /** diff --git a/packages/core/deprecations/core-deprecations-server/src/contracts.ts b/packages/core/deprecations/core-deprecations-server/src/contracts.ts index 4391ac2c1f68f..ebe9d16573e56 100644 --- a/packages/core/deprecations/core-deprecations-server/src/contracts.ts +++ b/packages/core/deprecations/core-deprecations-server/src/contracts.ts @@ -28,7 +28,7 @@ import type { KibanaRequest } from '@kbn/core-http-server'; * * @example * ```ts - * import { DeprecationsDetails, GetDeprecationsContext, CoreSetup } from 'src/core/server'; + * import { DeprecationsDetails, GetDeprecationsContext, CoreSetup } from 'src/core/packages/core/server'; * import { i18n } from '@kbn/i18n'; * * async function getDeprecations({ esClient, savedObjectsClient }: GetDeprecationsContext): Promise { diff --git a/packages/core/http/core-http-server/src/router/route.ts b/packages/core/http/core-http-server/src/router/route.ts index c8d0683234dc7..38b680e6cca85 100644 --- a/packages/core/http/core-http-server/src/router/route.ts +++ b/packages/core/http/core-http-server/src/router/route.ts @@ -128,7 +128,7 @@ export interface RouteDeprecationInfo { documentationUrl: string; /** * The description message to be displayed for the deprecation. - * Check the README for writing deprecations in `src/core/server/deprecations/README.mdx` + * Check the README for writing deprecations in `src/core/packages/core/server/deprecations/README.mdx` */ message?: string; /** diff --git a/packages/core/root/core-root-server-internal/src/bootstrap.ts b/packages/core/root/core-root-server-internal/src/bootstrap.ts index 0e91f368dc448..fe3097298c99d 100644 --- a/packages/core/root/core-root-server-internal/src/bootstrap.ts +++ b/packages/core/root/core-root-server-internal/src/bootstrap.ts @@ -31,7 +31,7 @@ export async function bootstrap({ configs, cliArgs, applyConfigOverrides }: Boot return; } - // `bootstrap` is exported from the `src/core/server/index` module, + // `bootstrap` is exported from the `src/core/packages/core/server/index` module, // meaning that any test importing, implicitly or explicitly, anything concrete // from `core/server` will load `dev-utils`. As some tests are mocking the `fs` package, // and as `REPO_ROOT` is initialized on the fly when importing `dev-utils` and requires diff --git a/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/document_migrator/internal_transforms.ts b/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/document_migrator/internal_transforms.ts index 8413c39d2cde1..bd890fb9fe136 100644 --- a/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/document_migrator/internal_transforms.ts +++ b/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/document_migrator/internal_transforms.ts @@ -127,7 +127,7 @@ function convertNamespaceType(doc: SavedObjectUnsanitizedDoc) { id: `${namespace}:${type}:${originId}`, type: LEGACY_URL_ALIAS_TYPE, attributes: { - // NOTE TO MAINTAINERS: If a saved object migration is added in `src/core/server/saved_objects/object_types/registration.ts`, these + // NOTE TO MAINTAINERS: If a saved object migration is added in `src/core/packages/core/server/saved_objects/object_types/registration.ts`, these // values must be updated accordingly. That's because a user can upgrade Kibana from 7.17 to 8.x, and any defined migrations will not // be applied to aliases that are created during the conversion process. sourceId: originId, diff --git a/packages/core/saved-objects/core-saved-objects-server-internal/src/object_types/registration.ts b/packages/core/saved-objects/core-saved-objects-server-internal/src/object_types/registration.ts index 2ab7d1ae5b86d..f04345403330a 100644 --- a/packages/core/saved-objects/core-saved-objects-server-internal/src/object_types/registration.ts +++ b/packages/core/saved-objects/core-saved-objects-server-internal/src/object_types/registration.ts @@ -32,7 +32,7 @@ const legacyUrlAliasType: SavedObjectsType = { hidden: false, migrations: { // NOTE TO MAINTAINERS: If you add a migration here, be sure to update the alias creation code in the document migrator accordingly, - // see: `src/core/server/saved_objects/migrations/core/document_migrator.ts` + // see: `src/core/packages/core/server/saved_objects/migrations/core/document_migrator.ts` '8.2.0': (doc) => { // In version 8.2.0 we added the "purpose" field. Any aliases created before this were created because of saved object conversion. const purpose: LegacyUrlAlias['purpose'] = 'savedObjectConversion'; diff --git a/packages/core/saved-objects/core-saved-objects-server/src/contracts.ts b/packages/core/saved-objects/core-saved-objects-server/src/contracts.ts index 9afa4b33754fa..2d39ed2f19a7a 100644 --- a/packages/core/saved-objects/core-saved-objects-server/src/contracts.ts +++ b/packages/core/saved-objects/core-saved-objects-server/src/contracts.ts @@ -37,7 +37,7 @@ import type { SavedObjectsExtensions } from './extensions/extensions'; * * @example * ```ts - * import { SavedObjectsClient, CoreSetup } from 'src/core/server'; + * import { SavedObjectsClient, CoreSetup } from 'src/core/packages/core/server'; * * export class Plugin() { * setup: (core: CoreSetup) => { @@ -50,7 +50,7 @@ import type { SavedObjectsExtensions } from './extensions/extensions'; * * @example * ```ts - * import { SavedObjectsClient, CoreSetup } from 'src/core/server'; + * import { SavedObjectsClient, CoreSetup } from 'src/core/packages/core/server'; * import { mySoType } from './saved_objects' * * export class Plugin() { @@ -93,7 +93,7 @@ export interface SavedObjectsServiceSetup { * @example * ```ts * // src/plugins/my_plugin/server/saved_objects/my_type.ts - * import { SavedObjectsType } from 'src/core/server'; + * import { SavedObjectsType } from 'src/core/packages/core/server'; * import * as migrations from './migrations'; * import * as schemas from './schemas'; * @@ -122,7 +122,7 @@ export interface SavedObjectsServiceSetup { * }; * * // src/plugins/my_plugin/server/plugin.ts - * import { SavedObjectsClient, CoreSetup } from 'src/core/server'; + * import { SavedObjectsClient, CoreSetup } from 'src/core/packages/core/server'; * import { myType } from './saved_objects'; * * export class Plugin() { diff --git a/packages/core/status/core-status-common/src/service_status.ts b/packages/core/status/core-status-common/src/service_status.ts index 9e2dfb6cbc322..1bdc09993534b 100644 --- a/packages/core/status/core-status-common/src/service_status.ts +++ b/packages/core/status/core-status-common/src/service_status.ts @@ -55,7 +55,7 @@ export type ServiceStatusLevelId = 'available' | 'degraded' | 'unavailable' | 'c * represent higher severities. Note that the default `Array.prototype.sort` implementation does not correctly sort * these values. * - * A snapshot serializer is available in `src/core/server/test_utils` to ease testing of these values with Jest. + * A snapshot serializer is available in `src/core/packages/core/server/test_utils` to ease testing of these values with Jest. * * @public */ diff --git a/packages/core/usage-data/core-usage-data-server-internal/src/core_usage_data_service.ts b/packages/core/usage-data/core-usage-data-server-internal/src/core_usage_data_service.ts index 7ac7cbb7fbb57..801c03f1eabb8 100644 --- a/packages/core/usage-data/core-usage-data-server-internal/src/core_usage_data_service.ts +++ b/packages/core/usage-data/core-usage-data-server-internal/src/core_usage_data_service.ts @@ -176,7 +176,7 @@ export class CoreUsageDataService private async getSavedObjectAliasUsageData(elasticsearch: ElasticsearchServiceStart) { // Note: this agg can be changed to use `savedObjectsRepository.find` in the future after `filters` is supported. - // See src/core/server/saved_objects/service/lib/aggregations/aggs_types/bucket_aggs.ts for supported aggregations. + // See src/core/packages/core/server/saved_objects/service/lib/aggregations/aggs_types/bucket_aggs.ts for supported aggregations. const resp = await elasticsearch.client.asInternalUser.search< unknown, { aliases: UsageDataAggs } diff --git a/packages/kbn-import-resolver/src/import_resolver.ts b/packages/kbn-import-resolver/src/import_resolver.ts index 9ca16981b2afc..6f5e51dbf2ec4 100644 --- a/packages/kbn-import-resolver/src/import_resolver.ts +++ b/packages/kbn-import-resolver/src/import_resolver.ts @@ -136,10 +136,10 @@ export class ImportResolver { private adaptReq(req: string, dirname: string): string | undefined { // handle typescript aliases if (req === 'kibana/public') { - return this.adaptReq('src/core/public', dirname); + return this.adaptReq('src/core/packages/core/public', dirname); } if (req === 'kibana/server') { - return this.adaptReq('src/core/server', dirname); + return this.adaptReq('src/core/packages/core/server', dirname); } // turn root-relative paths into relative paths diff --git a/packages/kbn-import-resolver/src/integration_tests/import_resolver.test.ts b/packages/kbn-import-resolver/src/integration_tests/import_resolver.test.ts index 1089f811b6e98..fe046248030da 100644 --- a/packages/kbn-import-resolver/src/integration_tests/import_resolver.test.ts +++ b/packages/kbn-import-resolver/src/integration_tests/import_resolver.test.ts @@ -55,9 +55,9 @@ describe('#resolve()', () => { }); it('resolves requests to src/', () => { - expect(resolver.resolve('src/core/public', FIXTURES_DIR)).toMatchInlineSnapshot(` + expect(resolver.resolve('src/core/packages/core/public', FIXTURES_DIR)).toMatchInlineSnapshot(` Object { - "absolute": /src/core/public/index.ts, + "absolute": /src/core/packages/core/public/index.ts, "type": "file", } `); diff --git a/packages/kbn-optimizer/src/worker/webpack.config.ts b/packages/kbn-optimizer/src/worker/webpack.config.ts index 98549d7ec745a..efc35c636d668 100644 --- a/packages/kbn-optimizer/src/worker/webpack.config.ts +++ b/packages/kbn-optimizer/src/worker/webpack.config.ts @@ -204,7 +204,7 @@ export function getWebpackConfig( loaderContext, Path.resolve( worker.repoRoot, - `src/core/public/styles/core_app/_globals_${theme}.scss` + `src/core/packages/core/public/styles/core_app/_globals_${theme}.scss` ) )};\n${content}`; }, @@ -307,7 +307,7 @@ export function getWebpackConfig( alias: { core_app_image_assets: Path.resolve( worker.repoRoot, - 'src/core/public/styles/core_app/images' + 'src/core/packages/core/public/styles/core_app/images' ), vega: Path.resolve(worker.repoRoot, 'node_modules/vega/build-es5/vega.js'), 'react-dom$': diff --git a/packages/kbn-storybook/src/webpack.config.ts b/packages/kbn-storybook/src/webpack.config.ts index fad795a1e4619..f702efa3a1c6a 100644 --- a/packages/kbn-storybook/src/webpack.config.ts +++ b/packages/kbn-storybook/src/webpack.config.ts @@ -113,7 +113,10 @@ export default ({ config: storybookConfig }: { config: Configuration }) => { additionalData(content: string, loaderContext: any) { return `@import ${stringifyRequest( loaderContext, - resolve(REPO_ROOT, 'src/core/public/styles/core_app/_globals_v8light.scss') + resolve( + REPO_ROOT, + 'src/core/packages/core/public/styles/core_app/_globals_v8light.scss' + ) )};\n${content}`; }, implementation: require('sass-embedded'), @@ -162,8 +165,11 @@ export default ({ config: storybookConfig }: { config: Configuration }) => { extensions: ['.js', '.ts', '.tsx', '.json', '.mdx'], mainFields: ['browser', 'main'], alias: { - core_app_image_assets: resolve(REPO_ROOT, 'src/core/public/styles/core_app/images'), - core_styles: resolve(REPO_ROOT, 'src/core/public/index.scss'), + core_app_image_assets: resolve( + REPO_ROOT, + 'src/core/packages/core/public/styles/core_app/images' + ), + core_styles: resolve(REPO_ROOT, 'src/core/packages/core/public/index.scss'), vega: resolve(REPO_ROOT, 'node_modules/vega/build-es5/vega.js'), }, }, diff --git a/packages/kbn-test/src/jest/run.ts b/packages/kbn-test/src/jest/run.ts index e82a34a2fe82a..a1fda9449acb4 100644 --- a/packages/kbn-test/src/jest/run.ts +++ b/packages/kbn-test/src/jest/run.ts @@ -29,9 +29,9 @@ import { map } from 'lodash'; import getopts from 'getopts'; import jestFlags from './jest_flags.json'; -// yarn test:jest src/core/server/saved_objects -// yarn test:jest src/core/public/core_system.test.ts -// :kibana/src/core/server/saved_objects yarn test:jest +// yarn test:jest src/core/packages/core/server/saved_objects +// yarn test:jest src/core/packages/core/public/core_system.test.ts +// :kibana/src/core/packages/core/server/saved_objects yarn test:jest export function runJest(configName = 'jest.config.js') { const unknownFlag: string[] = []; diff --git a/src/core/CONVENTIONS.md b/src/core/CONVENTIONS.md index 67476af87b6de..e0fc631f33156 100644 --- a/src/core/CONVENTIONS.md +++ b/src/core/CONVENTIONS.md @@ -88,7 +88,7 @@ my_plugin/ ```ts // my_plugin/public/index.ts -import { PluginInitializer } from '../../src/core/public'; +import { PluginInitializer } from '../../src/core/packages/core/public'; import { MyPlugin, MyPluginSetup, MyPluginStart } from './plugin'; export const plugin: PluginInitializer = () => new MyPlugin(); @@ -103,7 +103,7 @@ export { ```ts // my_plugin/public/plugin.ts -import { CoreSetup, CoreStart, Plugin } from '../../src/core/public'; +import { CoreSetup, CoreStart, Plugin } from '../../src/core/packages/core/public'; import { OtherPluginSetup, OtherPluginStart } from '../other_plugin'; import { ThirdPluginSetup, ThirdPluginStart } from '../third_plugin'; @@ -164,7 +164,7 @@ leverage this pattern. import React from 'react'; import ReactDOM from 'react-dom'; -import { CoreStart, AppMountParameters } from 'src/core/public'; +import { CoreStart, AppMountParameters } from 'src/core/packages/core/public'; import { MyAppRoot } from './components/app.ts'; @@ -184,7 +184,7 @@ export const renderApp = ( ```ts // my_plugin/public/plugin.ts -import { Plugin } from '../../src/core/public'; +import { Plugin } from '../../src/core/packages/core/public'; export class MyPlugin implements Plugin { public setup(core) { @@ -328,7 +328,7 @@ The folder should contain a file per type, named after the snake_case name of th ```typescript // src/plugins/my-plugin/server/saved_objects/my_type.ts -import { SavedObjectsType } from 'src/core/server'; +import { SavedObjectsType } from 'src/core/packages/core/server'; export const myType: SavedObjectsType = { name: 'my-type', diff --git a/src/core/CORE_CONVENTIONS.md b/src/core/CORE_CONVENTIONS.md index 9571be679ce57..f0ee9c0f20a17 100644 --- a/src/core/CORE_CONVENTIONS.md +++ b/src/core/CORE_CONVENTIONS.md @@ -18,10 +18,10 @@ area of Core API's and does not apply to internal types. ```ts // -- good -- - import { IRouter } from 'src/core/server'; + import { IRouter } from 'src/core/packages/core/server'; // -- bad -- - import { IRouter } from 'src/core/server/http/router.ts'; + import { IRouter } from 'src/core/packages/core/server/http/router.ts'; ``` > Why? This is required for generating documentation from our inline diff --git a/src/core/kibana.jsonc b/src/core/packages/core/kibana.jsonc similarity index 100% rename from src/core/kibana.jsonc rename to src/core/packages/core/kibana.jsonc diff --git a/src/core/public/_css_variables.scss b/src/core/packages/core/public/_css_variables.scss similarity index 100% rename from src/core/public/_css_variables.scss rename to src/core/packages/core/public/_css_variables.scss diff --git a/src/core/public/_mixins.scss b/src/core/packages/core/public/_mixins.scss similarity index 100% rename from src/core/public/_mixins.scss rename to src/core/packages/core/public/_mixins.scss diff --git a/src/core/public/index.scss b/src/core/packages/core/public/index.scss similarity index 100% rename from src/core/public/index.scss rename to src/core/packages/core/public/index.scss diff --git a/src/core/public/index.ts b/src/core/packages/core/public/index.ts similarity index 100% rename from src/core/public/index.ts rename to src/core/packages/core/public/index.ts diff --git a/src/core/public/jest.config.js b/src/core/packages/core/public/jest.config.js similarity index 90% rename from src/core/public/jest.config.js rename to src/core/packages/core/public/jest.config.js index bd4750e9f6466..435d2d923c552 100644 --- a/src/core/public/jest.config.js +++ b/src/core/packages/core/public/jest.config.js @@ -10,5 +10,5 @@ module.exports = { preset: '@kbn/test', rootDir: '../../..', - roots: ['/src/core/public'], + roots: ['/src/core/packages/core/public'], }; diff --git a/src/core/public/jest.integration.config.js b/src/core/packages/core/public/jest.integration.config.js similarity index 91% rename from src/core/public/jest.integration.config.js rename to src/core/packages/core/public/jest.integration.config.js index 01fc419de4bab..6be7f5fff4405 100644 --- a/src/core/public/jest.integration.config.js +++ b/src/core/packages/core/public/jest.integration.config.js @@ -10,5 +10,5 @@ module.exports = { preset: '@kbn/test/jest_integration', rootDir: '../../..', - roots: ['/src/core/public'], + roots: ['/src/core/packages/core/public'], }; diff --git a/src/core/public/mocks.ts b/src/core/packages/core/public/mocks.ts similarity index 100% rename from src/core/public/mocks.ts rename to src/core/packages/core/public/mocks.ts diff --git a/src/core/public/styles/_base.scss b/src/core/packages/core/public/styles/_base.scss similarity index 100% rename from src/core/public/styles/_base.scss rename to src/core/packages/core/public/styles/_base.scss diff --git a/src/core/public/styles/_index.scss b/src/core/packages/core/public/styles/_index.scss similarity index 100% rename from src/core/public/styles/_index.scss rename to src/core/packages/core/public/styles/_index.scss diff --git a/src/core/public/styles/core_app/README.txt b/src/core/packages/core/public/styles/core_app/README.txt similarity index 100% rename from src/core/public/styles/core_app/README.txt rename to src/core/packages/core/public/styles/core_app/README.txt diff --git a/src/core/public/styles/core_app/_globals_borealisdark.scss b/src/core/packages/core/public/styles/core_app/_globals_borealisdark.scss similarity index 100% rename from src/core/public/styles/core_app/_globals_borealisdark.scss rename to src/core/packages/core/public/styles/core_app/_globals_borealisdark.scss diff --git a/src/core/public/styles/core_app/_globals_borealislight.scss b/src/core/packages/core/public/styles/core_app/_globals_borealislight.scss similarity index 100% rename from src/core/public/styles/core_app/_globals_borealislight.scss rename to src/core/packages/core/public/styles/core_app/_globals_borealislight.scss diff --git a/src/core/public/styles/core_app/_globals_v8dark.scss b/src/core/packages/core/public/styles/core_app/_globals_v8dark.scss similarity index 100% rename from src/core/public/styles/core_app/_globals_v8dark.scss rename to src/core/packages/core/public/styles/core_app/_globals_v8dark.scss diff --git a/src/core/public/styles/core_app/_globals_v8light.scss b/src/core/packages/core/public/styles/core_app/_globals_v8light.scss similarity index 100% rename from src/core/public/styles/core_app/_globals_v8light.scss rename to src/core/packages/core/public/styles/core_app/_globals_v8light.scss diff --git a/src/core/public/styles/core_app/_mixins.scss b/src/core/packages/core/public/styles/core_app/_mixins.scss similarity index 100% rename from src/core/public/styles/core_app/_mixins.scss rename to src/core/packages/core/public/styles/core_app/_mixins.scss diff --git a/src/core/public/styles/core_app/images/bg_bottom_branded.svg b/src/core/packages/core/public/styles/core_app/images/bg_bottom_branded.svg similarity index 100% rename from src/core/public/styles/core_app/images/bg_bottom_branded.svg rename to src/core/packages/core/public/styles/core_app/images/bg_bottom_branded.svg diff --git a/src/core/public/styles/core_app/images/bg_bottom_branded_dark.svg b/src/core/packages/core/public/styles/core_app/images/bg_bottom_branded_dark.svg similarity index 100% rename from src/core/public/styles/core_app/images/bg_bottom_branded_dark.svg rename to src/core/packages/core/public/styles/core_app/images/bg_bottom_branded_dark.svg diff --git a/src/core/public/styles/core_app/images/bg_top_branded.svg b/src/core/packages/core/public/styles/core_app/images/bg_top_branded.svg similarity index 100% rename from src/core/public/styles/core_app/images/bg_top_branded.svg rename to src/core/packages/core/public/styles/core_app/images/bg_top_branded.svg diff --git a/src/core/public/styles/core_app/images/bg_top_branded_dark.svg b/src/core/packages/core/public/styles/core_app/images/bg_top_branded_dark.svg similarity index 100% rename from src/core/public/styles/core_app/images/bg_top_branded_dark.svg rename to src/core/packages/core/public/styles/core_app/images/bg_top_branded_dark.svg diff --git a/src/core/server/docs/kib_core_deprecations_service.mdx b/src/core/packages/core/server/docs/kib_core_deprecations_service.mdx similarity index 96% rename from src/core/server/docs/kib_core_deprecations_service.mdx rename to src/core/packages/core/server/docs/kib_core_deprecations_service.mdx index 1cf5fd50869f1..548bbe7572408 100644 --- a/src/core/server/docs/kib_core_deprecations_service.mdx +++ b/src/core/packages/core/server/docs/kib_core_deprecations_service.mdx @@ -33,7 +33,7 @@ To display deprecations in the UA set `xpack.upgrade_assistant.readonly: false` The UA is in read-only mode and will be enabled up until the last minor before the next major release. ## How do I use this service for deprecated plugin configurations? -The deprecations service automatically hooks deprecated configs with the deprecations service. +The deprecations service automatically hooks deprecated configs with the deprecations service. All the config deprecation functions (`unused`, `unusedFromRoot`, `rename`, `renameFromRoot`) accept an optional parameter to customize the deprecation details. @@ -139,7 +139,7 @@ Plugins are responsible for registering any deprecations during the `setup` life the deprecations service. Examples of non-config deprecations include things like -- kibana_user security roles +- kibana_user security roles This service is not intended to be used for non-user facing deprecations or cases where the deprecation cannot be 'detected' by this mechanism. @@ -155,14 +155,14 @@ The `getDeprecations` function is invoked when the user requests to see the depr The function provides a context object which contains a scoped Elasticsearch client and a Saved Objects client. ⚠️When using the Saved Objects client, bear in mind that all Spaces must be checked for deprecations: -By default, the Saved Objects client retrieves data from the current Space only. To override this behavior, add the -option `namespaces: ['*']` to search in all Spaces. When getting by ID, it's best to loop through all the spaces and get with `namespaces: [mySpaceOverride]`. +By default, the Saved Objects client retrieves data from the current Space only. To override this behavior, add the +option `namespaces: ['*']` to search in all Spaces. When getting by ID, it's best to loop through all the spaces and get with `namespaces: [mySpaceOverride]`. To check the full TS types of the service please check the [generated core docs](https://docs.elastic.dev/kibana-dev-docs/api/kbn-core-deprecations-server). ### Example ```ts -import { DeprecationsDetails, GetDeprecationsContext } from 'src/core/server'; +import { DeprecationsDetails, GetDeprecationsContext } from 'src/core/packages/core/server'; import { i18n } from '@kbn/i18n'; async function getDeprecations({ esClient, savedObjectsClient }: GetDeprecationsContext): Promise { @@ -249,14 +249,14 @@ Provide as much context as possible for what triggered the deprecation warning. If action is not required (for example the default behavior is changing), describe the impact of doing nothing. Examples: -- > Setting `xpack.reporting.roles.enabled` is deprecated. Use feature controls to grant reporting privileges. +- > Setting `xpack.reporting.roles.enabled` is deprecated. Use feature controls to grant reporting privileges. - > The Joda Time century-of era-formatter (C) is deprecated. Use a `java.time` formatter instead. - > The default for the `cluster.routing.allocation.disk.watermark` setting is changing from false to true. > If you do not explicitly configure this setting when you upgrade, indices in this one node cluster will - > become read-only if disk usage reaches 95%. + > become read-only if disk usage reaches 95%. ## Note on i18n -All deprecation titles, messages, and manual steps should be wrapped in `i18n.translate`. This +All deprecation titles, messages, and manual steps should be wrapped in `i18n.translate`. This provides a better user experience using different locales. Follow the writing guidelines below for best practices to writing the i18n messages and ids. @@ -288,7 +288,7 @@ message: i18n.translate('xpack.reporting.deprecations.reportingRoleMessage', { ``` #### Documentation URL -Don’t link to the Migration guide/breaking changes. +Don’t link to the Migration guide/breaking changes. Only specify a doc URL if the user truly needs to “learn more” to understand what actions they need to take. Example: @@ -315,7 +315,7 @@ manualSteps: [ #### General Guidelines ##### What is deprecated -Use the present tense: +Use the present tense: - Types are deprecated in geo_shape queries. - Sorting is deprecated in reindex requests. @@ -325,7 +325,7 @@ Avoid: ##### What action the user needs to take Use the imperative voice: -- Do not specify a type in the indexed_shape section. +- Do not specify a type in the indexed_shape section. - Use query filtering to reindex a subset of documents. Avoid: @@ -343,18 +343,18 @@ Others are more nuanced and don’t necessarily require any changes. In this cas the impact of not taking action: - The default for the `cluster.routing.allocation.disk.watermark` setting is changing from false to true. If you do not explicitly configure this setting when you upgrade, indices in this one node cluster will - become read-only if disk usage reaches 95%. + become read-only if disk usage reaches 95%. ##### Version You do not need to include any form of "and will be removed in a future release". The assumption is that deprecated things are going to be removed, and the standard schedule for removal -is the next major version. +is the next major version. If things are targeted for removal in a specific minor release, the message should include that information: - Abc is deprecated. Use Xyz to do the thing. Support for Abc will be removed in n.n. If an item is deprecated, but won’t be removed in the next major version, the message should indicate that: -- Abc is deprecated. Use Xyz to do the thing. Support for Abc will be removed following the release of n.0. +- Abc is deprecated. Use Xyz to do the thing. Support for Abc will be removed following the release of n.0. Avoid: - Xyz is deprecated and will be removed in 8.0. @@ -362,5 +362,5 @@ Avoid: - Xyz is deprecated and will not be supported in the next major version of Elasticsearch. ##### Formatting -- Sentence style capitalization and punctuation. +- Sentence style capitalization and punctuation. - Avoid quotes for emphasis. diff --git a/src/core/server/docs/kib_core_logging.mdx b/src/core/packages/core/server/docs/kib_core_logging.mdx similarity index 100% rename from src/core/server/docs/kib_core_logging.mdx rename to src/core/packages/core/server/docs/kib_core_logging.mdx diff --git a/src/core/server/docs/kib_core_reviewing_so_type_pr.mdx b/src/core/packages/core/server/docs/kib_core_reviewing_so_type_pr.mdx similarity index 89% rename from src/core/server/docs/kib_core_reviewing_so_type_pr.mdx rename to src/core/packages/core/server/docs/kib_core_reviewing_so_type_pr.mdx index 95dc466109543..24ff50f926ac8 100644 --- a/src/core/server/docs/kib_core_reviewing_so_type_pr.mdx +++ b/src/core/packages/core/server/docs/kib_core_reviewing_so_type_pr.mdx @@ -12,10 +12,10 @@ tags: ['kibana','dev', 'contributor', 'api docs'] ## How does automatic review assignment work when SO types are changed? PRs modifying / adding / deleting any SO type registration will be flagged by the integration -test located at `src/core/server/integration_tests/saved_objects/migrations/check_registered_types.test.ts`. +test located at `src/core/packages/core/server/integration_tests/saved_objects/migrations/check_registered_types.test.ts`. -This test will fail any time a change is performed on an SO type registration that could risk having an impact on -upgrades/migrations, and will force the PR's author to update the test's snapshot, which will trigger a review +This test will fail any time a change is performed on an SO type registration that could risk having an impact on +upgrades/migrations, and will force the PR's author to update the test's snapshot, which will trigger a review from the Core team. ## What and how to review? @@ -35,23 +35,23 @@ Note: reviews will **not** automatically be triggered in these scenarios: ### A new type was added -We have another integration test detecting this scenario (`src/core/server/integration_tests/saved_objects/migrations/type_registrations.test.ts`) +We have another integration test detecting this scenario (`src/core/packages/core/server/integration_tests/saved_objects/migrations/type_registrations.test.ts`) In that scenario, we should: - check the initial mappings of the type to spot potential issues: - fields being defined explicitly in the mappings but not directly used for search - overall amount of fields is high - use of `dynamic: true` (this can lead to mapping explosions) -- check if the type is registered as `hidden: true` and encourage to do so otherwise. - - this avoids polluting the global SO HTTP APIs with another type, and instead requires plugin developers to build +- check if the type is registered as `hidden: true` and encourage to do so otherwise. + - this avoids polluting the global SO HTTP APIs with another type, and instead requires plugin developers to build their own HTTP APIs to access this type of SO if they truly need to. ### A type was removed -The integration test mentioned in the previous section also detects those scenarios. +The integration test mentioned in the previous section also detects those scenarios. Here, we need to check: -- that `REMOVED_TYPES` (`packages/core/saved-objects/core-saved-objects-migration-server-internal/src/core/unused_types.ts`) was properly updated +- that `REMOVED_TYPES` (`packages/core/saved-objects/core-saved-objects-migration-server-internal/src/core/unused_types.ts`) was properly updated - (but, again, the integration test will fail otherwise) - that no other existing SO types may be referencing this type - can't really be automated, will likely need to ask the owning team directly @@ -60,7 +60,7 @@ Here, we need to check: - Review the migration function - owners are supposed to do it, but an additional review never hurts - - make sure they are typing their migration function using `SavedObjectMigrationFn` and supplying arguments for the generics + - make sure they are typing their migration function using `SavedObjectMigrationFn` and supplying arguments for the generics e.g. `SavedObjectMigrationFn`. - Make sure that the migration function is properly tested - by unit tests @@ -81,4 +81,4 @@ Here, we need to check: - Make sure the associated mapping changes were performed, and that a migration function was added accordingly. - Ideally schemas are validated with unit tests as well, especially for more complex ones. -- Refer to prior sections to see what to check. \ No newline at end of file +- Refer to prior sections to see what to check. diff --git a/src/core/server/index.ts b/src/core/packages/core/server/index.ts similarity index 100% rename from src/core/server/index.ts rename to src/core/packages/core/server/index.ts diff --git a/src/core/server/integration_tests/capabilities/capabilities_service.test.ts b/src/core/packages/core/server/integration_tests/capabilities/capabilities_service.test.ts similarity index 100% rename from src/core/server/integration_tests/capabilities/capabilities_service.test.ts rename to src/core/packages/core/server/integration_tests/capabilities/capabilities_service.test.ts diff --git a/src/core/packages/core/server/integration_tests/capabilities/jest.integration.config.js b/src/core/packages/core/server/integration_tests/capabilities/jest.integration.config.js new file mode 100644 index 0000000000000..feb868802f71a --- /dev/null +++ b/src/core/packages/core/server/integration_tests/capabilities/jest.integration.config.js @@ -0,0 +1,20 @@ +/* + * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +module.exports = { + // TODO replace the line below with + // preset: '@kbn/test/jest_integration_node + // to do so, we must fix all integration tests first + // see https://github.com/elastic/kibana/pull/130255/ + preset: '@kbn/test/jest_integration', + rootDir: '../../../../..', + roots: ['/src/core/packages/core/server/integration_tests/capabilities'], + // must override to match all test given there is no `integration_tests` subfolder + testMatch: ['**/*.test.{js,mjs,ts,tsx}'], +}; diff --git a/src/core/server/integration_tests/ci_checks/jest.integration.config.js b/src/core/packages/core/server/integration_tests/ci_checks/jest.integration.config.js similarity index 91% rename from src/core/server/integration_tests/ci_checks/jest.integration.config.js rename to src/core/packages/core/server/integration_tests/ci_checks/jest.integration.config.js index 9cdb0e5c986f7..30bb3fec7675c 100644 --- a/src/core/server/integration_tests/ci_checks/jest.integration.config.js +++ b/src/core/packages/core/server/integration_tests/ci_checks/jest.integration.config.js @@ -15,7 +15,7 @@ module.exports = { // see https://github.com/elastic/kibana/pull/130255/ preset: '@kbn/test/jest_integration', rootDir: '../../../../..', - roots: ['/src/core/server/integration_tests/ci_checks'], + roots: ['/src/core/packages/core/server/integration_tests/ci_checks'], // must override to match all test given there is no `integration_tests` subfolder testMatch: ['**/*.test.{js,mjs,ts,tsx}'], }; diff --git a/src/core/server/integration_tests/ci_checks/saved_objects/check_registered_types.test.ts b/src/core/packages/core/server/integration_tests/ci_checks/saved_objects/check_registered_types.test.ts similarity index 100% rename from src/core/server/integration_tests/ci_checks/saved_objects/check_registered_types.test.ts rename to src/core/packages/core/server/integration_tests/ci_checks/saved_objects/check_registered_types.test.ts diff --git a/src/core/server/integration_tests/config/check_dynamic_config.test.ts b/src/core/packages/core/server/integration_tests/config/check_dynamic_config.test.ts similarity index 100% rename from src/core/server/integration_tests/config/check_dynamic_config.test.ts rename to src/core/packages/core/server/integration_tests/config/check_dynamic_config.test.ts diff --git a/src/core/server/integration_tests/config/config_deprecation.test.mocks.ts b/src/core/packages/core/server/integration_tests/config/config_deprecation.test.mocks.ts similarity index 100% rename from src/core/server/integration_tests/config/config_deprecation.test.mocks.ts rename to src/core/packages/core/server/integration_tests/config/config_deprecation.test.mocks.ts diff --git a/src/core/server/integration_tests/config/config_deprecation.test.ts b/src/core/packages/core/server/integration_tests/config/config_deprecation.test.ts similarity index 100% rename from src/core/server/integration_tests/config/config_deprecation.test.ts rename to src/core/packages/core/server/integration_tests/config/config_deprecation.test.ts diff --git a/src/core/server/integration_tests/elasticsearch/jest.integration.config.js b/src/core/packages/core/server/integration_tests/config/jest.integration.config.js similarity index 91% rename from src/core/server/integration_tests/elasticsearch/jest.integration.config.js rename to src/core/packages/core/server/integration_tests/config/jest.integration.config.js index 5706ce8b1bd57..9c26a71183096 100644 --- a/src/core/server/integration_tests/elasticsearch/jest.integration.config.js +++ b/src/core/packages/core/server/integration_tests/config/jest.integration.config.js @@ -14,7 +14,7 @@ module.exports = { // see https://github.com/elastic/kibana/pull/130255/ preset: '@kbn/test/jest_integration', rootDir: '../../../../..', - roots: ['/src/core/server/integration_tests/elasticsearch'], + roots: ['/src/core/packages/core/server/integration_tests/config'], // must override to match all test given there is no `integration_tests` subfolder testMatch: ['**/*.test.{js,mjs,ts,tsx}'], }; diff --git a/src/core/server/integration_tests/core_app/__fixtures__/outside_output.js b/src/core/packages/core/server/integration_tests/core_app/__fixtures__/outside_output.js similarity index 100% rename from src/core/server/integration_tests/core_app/__fixtures__/outside_output.js rename to src/core/packages/core/server/integration_tests/core_app/__fixtures__/outside_output.js diff --git a/src/core/server/integration_tests/core_app/__fixtures__/plugin/foo/gzip_chunk.js b/src/core/packages/core/server/integration_tests/core_app/__fixtures__/plugin/foo/gzip_chunk.js similarity index 100% rename from src/core/server/integration_tests/core_app/__fixtures__/plugin/foo/gzip_chunk.js rename to src/core/packages/core/server/integration_tests/core_app/__fixtures__/plugin/foo/gzip_chunk.js diff --git a/src/core/server/integration_tests/core_app/__fixtures__/plugin/foo/gzip_chunk.js.gz b/src/core/packages/core/server/integration_tests/core_app/__fixtures__/plugin/foo/gzip_chunk.js.gz similarity index 100% rename from src/core/server/integration_tests/core_app/__fixtures__/plugin/foo/gzip_chunk.js.gz rename to src/core/packages/core/server/integration_tests/core_app/__fixtures__/plugin/foo/gzip_chunk.js.gz diff --git a/src/core/server/integration_tests/core_app/__fixtures__/plugin/foo/image.png b/src/core/packages/core/server/integration_tests/core_app/__fixtures__/plugin/foo/image.png similarity index 100% rename from src/core/server/integration_tests/core_app/__fixtures__/plugin/foo/image.png rename to src/core/packages/core/server/integration_tests/core_app/__fixtures__/plugin/foo/image.png diff --git a/src/core/server/integration_tests/core_app/__fixtures__/plugin/foo/plugin.js b/src/core/packages/core/server/integration_tests/core_app/__fixtures__/plugin/foo/plugin.js similarity index 100% rename from src/core/server/integration_tests/core_app/__fixtures__/plugin/foo/plugin.js rename to src/core/packages/core/server/integration_tests/core_app/__fixtures__/plugin/foo/plugin.js diff --git a/src/core/server/integration_tests/core_app/bundle_routes.test.ts b/src/core/packages/core/server/integration_tests/core_app/bundle_routes.test.ts similarity index 100% rename from src/core/server/integration_tests/core_app/bundle_routes.test.ts rename to src/core/packages/core/server/integration_tests/core_app/bundle_routes.test.ts diff --git a/src/core/server/integration_tests/core_app/core_app_routes.test.ts b/src/core/packages/core/server/integration_tests/core_app/core_app_routes.test.ts similarity index 100% rename from src/core/server/integration_tests/core_app/core_app_routes.test.ts rename to src/core/packages/core/server/integration_tests/core_app/core_app_routes.test.ts diff --git a/src/core/server/integration_tests/core_app/default_route_provider_config.test.ts b/src/core/packages/core/server/integration_tests/core_app/default_route_provider_config.test.ts similarity index 100% rename from src/core/server/integration_tests/core_app/default_route_provider_config.test.ts rename to src/core/packages/core/server/integration_tests/core_app/default_route_provider_config.test.ts diff --git a/src/core/packages/core/server/integration_tests/core_app/jest.integration.config.js b/src/core/packages/core/server/integration_tests/core_app/jest.integration.config.js new file mode 100644 index 0000000000000..f307627d40321 --- /dev/null +++ b/src/core/packages/core/server/integration_tests/core_app/jest.integration.config.js @@ -0,0 +1,20 @@ +/* + * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +module.exports = { + // TODO replace the line below with + // preset: '@kbn/test/jest_integration_node + // to do so, we must fix all integration tests first + // see https://github.com/elastic/kibana/pull/130255/ + preset: '@kbn/test/jest_integration', + rootDir: '../../../../..', + roots: ['/src/core/packages/core/server/integration_tests/core_app'], + // must override to match all test given there is no `integration_tests` subfolder + testMatch: ['**/*.test.{js,mjs,ts,tsx}'], +}; diff --git a/src/core/server/integration_tests/core_app/static_assets.test.ts b/src/core/packages/core/server/integration_tests/core_app/static_assets.test.ts similarity index 100% rename from src/core/server/integration_tests/core_app/static_assets.test.ts rename to src/core/packages/core/server/integration_tests/core_app/static_assets.test.ts diff --git a/src/core/server/integration_tests/elasticsearch/capabilities.test.ts b/src/core/packages/core/server/integration_tests/elasticsearch/capabilities.test.ts similarity index 100% rename from src/core/server/integration_tests/elasticsearch/capabilities.test.ts rename to src/core/packages/core/server/integration_tests/elasticsearch/capabilities.test.ts diff --git a/src/core/server/integration_tests/elasticsearch/capabilities_serverless.test.ts b/src/core/packages/core/server/integration_tests/elasticsearch/capabilities_serverless.test.ts similarity index 100% rename from src/core/server/integration_tests/elasticsearch/capabilities_serverless.test.ts rename to src/core/packages/core/server/integration_tests/elasticsearch/capabilities_serverless.test.ts diff --git a/src/core/server/integration_tests/elasticsearch/client.test.ts b/src/core/packages/core/server/integration_tests/elasticsearch/client.test.ts similarity index 100% rename from src/core/server/integration_tests/elasticsearch/client.test.ts rename to src/core/packages/core/server/integration_tests/elasticsearch/client.test.ts diff --git a/src/core/server/integration_tests/elasticsearch/error_logging.test.ts b/src/core/packages/core/server/integration_tests/elasticsearch/error_logging.test.ts similarity index 96% rename from src/core/server/integration_tests/elasticsearch/error_logging.test.ts rename to src/core/packages/core/server/integration_tests/elasticsearch/error_logging.test.ts index c51560f9cfdb4..81efea6176b5d 100644 --- a/src/core/server/integration_tests/elasticsearch/error_logging.test.ts +++ b/src/core/packages/core/server/integration_tests/elasticsearch/error_logging.test.ts @@ -95,7 +95,7 @@ describe('Error logging', () => { }); // it contains the offending line for troubleshooting. expect(parsedLine.stack).toContain( - 'src/core/server/integration_tests/elasticsearch/error_logging.test.ts:64:9' + 'src/core/packages/core/server/integration_tests/elasticsearch/error_logging.test.ts:64:9' ); } }); diff --git a/src/core/server/integration_tests/elasticsearch/errors.test.ts b/src/core/packages/core/server/integration_tests/elasticsearch/errors.test.ts similarity index 94% rename from src/core/server/integration_tests/elasticsearch/errors.test.ts rename to src/core/packages/core/server/integration_tests/elasticsearch/errors.test.ts index 55b9e446e1c91..f916b5baad5df 100644 --- a/src/core/server/integration_tests/elasticsearch/errors.test.ts +++ b/src/core/packages/core/server/integration_tests/elasticsearch/errors.test.ts @@ -48,7 +48,7 @@ describe('elasticsearch clients errors', () => { `{"name":"ResponseError","message":"parsing_exception\\n\\tCaused by:\\n\\t\\tnamed_object_not_found_exception: [1:30] unknown field [someInvalidQuery]\\n\\tRoot causes:\\n\\t\\tparsing_exception: unknown query [someInvalidQuery]","stack":"ResponseError: parsing_exception` ); // it contains the offending line for troubleshooting. - expect(str).toContain('src/core/server/integration_tests/elasticsearch/errors.test.ts:39:7'); + expect(str).toContain('src/core/packages/core/server/integration_tests/elasticsearch/errors.test.ts:39:7'); } }); @@ -99,7 +99,7 @@ describe('elasticsearch clients errors', () => { '\\t\\tparsing_exception: unknown query [someInvalidQuery]\\n' + ' at KibanaTransport._request (`); // it contains the offending line for troubleshooting. - expect(str).toContain('src/core/server/integration_tests/elasticsearch/errors.test.ts:80:7'); + expect(str).toContain('src/core/packages/core/server/integration_tests/elasticsearch/errors.test.ts:80:7'); } }); }); diff --git a/src/core/server/integration_tests/elasticsearch/is_scripting_enabled.test.ts b/src/core/packages/core/server/integration_tests/elasticsearch/is_scripting_enabled.test.ts similarity index 100% rename from src/core/server/integration_tests/elasticsearch/is_scripting_enabled.test.ts rename to src/core/packages/core/server/integration_tests/elasticsearch/is_scripting_enabled.test.ts diff --git a/src/core/packages/core/server/integration_tests/elasticsearch/jest.integration.config.js b/src/core/packages/core/server/integration_tests/elasticsearch/jest.integration.config.js new file mode 100644 index 0000000000000..7db8a18481c28 --- /dev/null +++ b/src/core/packages/core/server/integration_tests/elasticsearch/jest.integration.config.js @@ -0,0 +1,20 @@ +/* + * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +module.exports = { + // TODO replace the line below with + // preset: '@kbn/test/jest_integration_node + // to do so, we must fix all integration tests first + // see https://github.com/elastic/kibana/pull/130255/ + preset: '@kbn/test/jest_integration', + rootDir: '../../../../..', + roots: ['/src/core/packages/core/server/integration_tests/elasticsearch'], + // must override to match all test given there is no `integration_tests` subfolder + testMatch: ['**/*.test.{js,mjs,ts,tsx}'], +}; diff --git a/src/core/server/integration_tests/elasticsearch/max_response_size_logging.test.ts b/src/core/packages/core/server/integration_tests/elasticsearch/max_response_size_logging.test.ts similarity index 100% rename from src/core/server/integration_tests/elasticsearch/max_response_size_logging.test.ts rename to src/core/packages/core/server/integration_tests/elasticsearch/max_response_size_logging.test.ts diff --git a/src/core/server/integration_tests/elasticsearch/user_agent.test.ts b/src/core/packages/core/server/integration_tests/elasticsearch/user_agent.test.ts similarity index 100% rename from src/core/server/integration_tests/elasticsearch/user_agent.test.ts rename to src/core/packages/core/server/integration_tests/elasticsearch/user_agent.test.ts diff --git a/src/core/server/integration_tests/elasticsearch/version_compatibility.test.ts b/src/core/packages/core/server/integration_tests/elasticsearch/version_compatibility.test.ts similarity index 100% rename from src/core/server/integration_tests/elasticsearch/version_compatibility.test.ts rename to src/core/packages/core/server/integration_tests/elasticsearch/version_compatibility.test.ts diff --git a/src/core/packages/core/server/integration_tests/execution_context/jest.integration.config.js b/src/core/packages/core/server/integration_tests/execution_context/jest.integration.config.js new file mode 100644 index 0000000000000..777661388f402 --- /dev/null +++ b/src/core/packages/core/server/integration_tests/execution_context/jest.integration.config.js @@ -0,0 +1,20 @@ +/* + * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +module.exports = { + // TODO replace the line below with + // preset: '@kbn/test/jest_integration_node + // to do so, we must fix all integration tests first + // see https://github.com/elastic/kibana/pull/130255/ + preset: '@kbn/test/jest_integration', + rootDir: '../../../../..', + roots: ['/src/core/packages/core/server/integration_tests/execution_context'], + // must override to match all test given there is no `integration_tests` subfolder + testMatch: ['**/*.test.{js,mjs,ts,tsx}'], +}; diff --git a/src/core/server/integration_tests/execution_context/tracing.test.ts b/src/core/packages/core/server/integration_tests/execution_context/tracing.test.ts similarity index 100% rename from src/core/server/integration_tests/execution_context/tracing.test.ts rename to src/core/packages/core/server/integration_tests/execution_context/tracing.test.ts diff --git a/src/core/server/integration_tests/http/cookie_session_storage.test.ts b/src/core/packages/core/server/integration_tests/http/cookie_session_storage.test.ts similarity index 100% rename from src/core/server/integration_tests/http/cookie_session_storage.test.ts rename to src/core/packages/core/server/integration_tests/http/cookie_session_storage.test.ts diff --git a/src/core/server/integration_tests/http/core_service.test.mocks.ts b/src/core/packages/core/server/integration_tests/http/core_service.test.mocks.ts similarity index 100% rename from src/core/server/integration_tests/http/core_service.test.mocks.ts rename to src/core/packages/core/server/integration_tests/http/core_service.test.mocks.ts diff --git a/src/core/server/integration_tests/http/core_services.test.ts b/src/core/packages/core/server/integration_tests/http/core_services.test.ts similarity index 100% rename from src/core/server/integration_tests/http/core_services.test.ts rename to src/core/packages/core/server/integration_tests/http/core_services.test.ts diff --git a/src/core/server/integration_tests/http/fixtures/static/compression_available.json b/src/core/packages/core/server/integration_tests/http/fixtures/static/compression_available.json similarity index 100% rename from src/core/server/integration_tests/http/fixtures/static/compression_available.json rename to src/core/packages/core/server/integration_tests/http/fixtures/static/compression_available.json diff --git a/src/core/server/integration_tests/http/fixtures/static/compression_available.json.gz b/src/core/packages/core/server/integration_tests/http/fixtures/static/compression_available.json.gz similarity index 100% rename from src/core/server/integration_tests/http/fixtures/static/compression_available.json.gz rename to src/core/packages/core/server/integration_tests/http/fixtures/static/compression_available.json.gz diff --git a/src/core/server/integration_tests/http/fixtures/static/some_json.json b/src/core/packages/core/server/integration_tests/http/fixtures/static/some_json.json similarity index 100% rename from src/core/server/integration_tests/http/fixtures/static/some_json.json rename to src/core/packages/core/server/integration_tests/http/fixtures/static/some_json.json diff --git a/src/core/server/integration_tests/http/http2_protocol.test.ts b/src/core/packages/core/server/integration_tests/http/http2_protocol.test.ts similarity index 100% rename from src/core/server/integration_tests/http/http2_protocol.test.ts rename to src/core/packages/core/server/integration_tests/http/http2_protocol.test.ts diff --git a/src/core/server/integration_tests/http/http_auth.test.ts b/src/core/packages/core/server/integration_tests/http/http_auth.test.ts similarity index 100% rename from src/core/server/integration_tests/http/http_auth.test.ts rename to src/core/packages/core/server/integration_tests/http/http_auth.test.ts diff --git a/src/core/server/integration_tests/http/http_server.test.ts b/src/core/packages/core/server/integration_tests/http/http_server.test.ts similarity index 100% rename from src/core/server/integration_tests/http/http_server.test.ts rename to src/core/packages/core/server/integration_tests/http/http_server.test.ts diff --git a/src/core/server/integration_tests/config/jest.integration.config.js b/src/core/packages/core/server/integration_tests/http/jest.integration.config.js similarity index 91% rename from src/core/server/integration_tests/config/jest.integration.config.js rename to src/core/packages/core/server/integration_tests/http/jest.integration.config.js index ff7e9e0a3f6ca..5000f9ac60740 100644 --- a/src/core/server/integration_tests/config/jest.integration.config.js +++ b/src/core/packages/core/server/integration_tests/http/jest.integration.config.js @@ -14,7 +14,7 @@ module.exports = { // see https://github.com/elastic/kibana/pull/130255/ preset: '@kbn/test/jest_integration', rootDir: '../../../../..', - roots: ['/src/core/server/integration_tests/config'], + roots: ['/src/core/packages/core/server/integration_tests/http'], // must override to match all test given there is no `integration_tests` subfolder testMatch: ['**/*.test.{js,mjs,ts,tsx}'], }; diff --git a/src/core/server/integration_tests/http/lifecycle.test.ts b/src/core/packages/core/server/integration_tests/http/lifecycle.test.ts similarity index 100% rename from src/core/server/integration_tests/http/lifecycle.test.ts rename to src/core/packages/core/server/integration_tests/http/lifecycle.test.ts diff --git a/src/core/server/integration_tests/http/lifecycle_handlers.test.ts b/src/core/packages/core/server/integration_tests/http/lifecycle_handlers.test.ts similarity index 100% rename from src/core/server/integration_tests/http/lifecycle_handlers.test.ts rename to src/core/packages/core/server/integration_tests/http/lifecycle_handlers.test.ts diff --git a/src/core/server/integration_tests/http/logging.test.ts b/src/core/packages/core/server/integration_tests/http/logging.test.ts similarity index 100% rename from src/core/server/integration_tests/http/logging.test.ts rename to src/core/packages/core/server/integration_tests/http/logging.test.ts diff --git a/src/core/server/integration_tests/http/oas.test.ts b/src/core/packages/core/server/integration_tests/http/oas.test.ts similarity index 100% rename from src/core/server/integration_tests/http/oas.test.ts rename to src/core/packages/core/server/integration_tests/http/oas.test.ts diff --git a/src/core/server/integration_tests/http/preboot.test.ts b/src/core/packages/core/server/integration_tests/http/preboot.test.ts similarity index 100% rename from src/core/server/integration_tests/http/preboot.test.ts rename to src/core/packages/core/server/integration_tests/http/preboot.test.ts diff --git a/src/core/server/integration_tests/http/request.test.ts b/src/core/packages/core/server/integration_tests/http/request.test.ts similarity index 100% rename from src/core/server/integration_tests/http/request.test.ts rename to src/core/packages/core/server/integration_tests/http/request.test.ts diff --git a/src/core/server/integration_tests/http/request_representation.test.ts b/src/core/packages/core/server/integration_tests/http/request_representation.test.ts similarity index 100% rename from src/core/server/integration_tests/http/request_representation.test.ts rename to src/core/packages/core/server/integration_tests/http/request_representation.test.ts diff --git a/src/core/server/integration_tests/http/router.test.mocks.ts b/src/core/packages/core/server/integration_tests/http/router.test.mocks.ts similarity index 100% rename from src/core/server/integration_tests/http/router.test.mocks.ts rename to src/core/packages/core/server/integration_tests/http/router.test.mocks.ts diff --git a/src/core/server/integration_tests/http/router.test.ts b/src/core/packages/core/server/integration_tests/http/router.test.ts similarity index 100% rename from src/core/server/integration_tests/http/router.test.ts rename to src/core/packages/core/server/integration_tests/http/router.test.ts diff --git a/src/core/server/integration_tests/http/set_tls_config.test.ts b/src/core/packages/core/server/integration_tests/http/set_tls_config.test.ts similarity index 100% rename from src/core/server/integration_tests/http/set_tls_config.test.ts rename to src/core/packages/core/server/integration_tests/http/set_tls_config.test.ts diff --git a/src/core/server/integration_tests/http/tls_config_reload.test.ts b/src/core/packages/core/server/integration_tests/http/tls_config_reload.test.ts similarity index 100% rename from src/core/server/integration_tests/http/tls_config_reload.test.ts rename to src/core/packages/core/server/integration_tests/http/tls_config_reload.test.ts diff --git a/src/core/server/integration_tests/http/tls_utils.ts b/src/core/packages/core/server/integration_tests/http/tls_utils.ts similarity index 100% rename from src/core/server/integration_tests/http/tls_utils.ts rename to src/core/packages/core/server/integration_tests/http/tls_utils.ts diff --git a/src/core/server/integration_tests/http/versioned_router.test.mocks.ts b/src/core/packages/core/server/integration_tests/http/versioned_router.test.mocks.ts similarity index 100% rename from src/core/server/integration_tests/http/versioned_router.test.mocks.ts rename to src/core/packages/core/server/integration_tests/http/versioned_router.test.mocks.ts diff --git a/src/core/server/integration_tests/http/versioned_router.test.ts b/src/core/packages/core/server/integration_tests/http/versioned_router.test.ts similarity index 100% rename from src/core/server/integration_tests/http/versioned_router.test.ts rename to src/core/packages/core/server/integration_tests/http/versioned_router.test.ts diff --git a/src/core/server/integration_tests/http_resources/http_resources_service.test.ts b/src/core/packages/core/server/integration_tests/http_resources/http_resources_service.test.ts similarity index 100% rename from src/core/server/integration_tests/http_resources/http_resources_service.test.ts rename to src/core/packages/core/server/integration_tests/http_resources/http_resources_service.test.ts diff --git a/src/core/packages/core/server/integration_tests/http_resources/jest.integration.config.js b/src/core/packages/core/server/integration_tests/http_resources/jest.integration.config.js new file mode 100644 index 0000000000000..4803a89925566 --- /dev/null +++ b/src/core/packages/core/server/integration_tests/http_resources/jest.integration.config.js @@ -0,0 +1,20 @@ +/* + * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +module.exports = { + // TODO replace the line below with + // preset: '@kbn/test/jest_integration_node + // to do so, we must fix all integration tests first + // see https://github.com/elastic/kibana/pull/130255/ + preset: '@kbn/test/jest_integration', + rootDir: '../../../../..', + roots: ['/src/core/packages/core/server/integration_tests/http_resources'], + // must override to match all test given there is no `integration_tests` subfolder + testMatch: ['**/*.test.{js,mjs,ts,tsx}'], +}; diff --git a/src/core/packages/core/server/integration_tests/logging/jest.integration.config.js b/src/core/packages/core/server/integration_tests/logging/jest.integration.config.js new file mode 100644 index 0000000000000..2f8001c94c70b --- /dev/null +++ b/src/core/packages/core/server/integration_tests/logging/jest.integration.config.js @@ -0,0 +1,20 @@ +/* + * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +module.exports = { + // TODO replace the line below with + // preset: '@kbn/test/jest_integration_node + // to do so, we must fix all integration tests first + // see https://github.com/elastic/kibana/pull/130255/ + preset: '@kbn/test/jest_integration', + rootDir: '../../../../..', + roots: ['/src/core/packages/core/server/integration_tests/logging'], + // must override to match all test given there is no `integration_tests` subfolder + testMatch: ['**/*.test.{js,mjs,ts,tsx}'], +}; diff --git a/src/core/server/integration_tests/logging/logging.test.ts b/src/core/packages/core/server/integration_tests/logging/logging.test.ts similarity index 100% rename from src/core/server/integration_tests/logging/logging.test.ts rename to src/core/packages/core/server/integration_tests/logging/logging.test.ts diff --git a/src/core/server/integration_tests/logging/rolling_file_appender.test.ts b/src/core/packages/core/server/integration_tests/logging/rolling_file_appender.test.ts similarity index 100% rename from src/core/server/integration_tests/logging/rolling_file_appender.test.ts rename to src/core/packages/core/server/integration_tests/logging/rolling_file_appender.test.ts diff --git a/src/core/server/integration_tests/logging/utils.ts b/src/core/packages/core/server/integration_tests/logging/utils.ts similarity index 100% rename from src/core/server/integration_tests/logging/utils.ts rename to src/core/packages/core/server/integration_tests/logging/utils.ts diff --git a/src/core/server/integration_tests/metrics/elu_load.test.ts b/src/core/packages/core/server/integration_tests/metrics/elu_load.test.ts similarity index 100% rename from src/core/server/integration_tests/metrics/elu_load.test.ts rename to src/core/packages/core/server/integration_tests/metrics/elu_load.test.ts diff --git a/src/core/packages/core/server/integration_tests/metrics/jest.integration.config.js b/src/core/packages/core/server/integration_tests/metrics/jest.integration.config.js new file mode 100644 index 0000000000000..8c160a3a7c4ca --- /dev/null +++ b/src/core/packages/core/server/integration_tests/metrics/jest.integration.config.js @@ -0,0 +1,20 @@ +/* + * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +module.exports = { + // TODO replace the line below with + // preset: '@kbn/test/jest_integration_node + // to do so, we must fix all integration tests first + // see https://github.com/elastic/kibana/pull/130255/ + preset: '@kbn/test/jest_integration', + rootDir: '../../../../..', + roots: ['/src/core/packages/core/server/integration_tests/metrics'], + // must override to match all test given there is no `integration_tests` subfolder + testMatch: ['**/*.test.{js,mjs,ts,tsx}'], +}; diff --git a/src/core/server/integration_tests/metrics/server_collector.test.ts b/src/core/packages/core/server/integration_tests/metrics/server_collector.test.ts similarity index 100% rename from src/core/server/integration_tests/metrics/server_collector.test.ts rename to src/core/packages/core/server/integration_tests/metrics/server_collector.test.ts diff --git a/src/core/server/integration_tests/core_app/jest.integration.config.js b/src/core/packages/core/server/integration_tests/node/jest.integration.config.js similarity index 91% rename from src/core/server/integration_tests/core_app/jest.integration.config.js rename to src/core/packages/core/server/integration_tests/node/jest.integration.config.js index 94a633419a9ab..140efd8cae510 100644 --- a/src/core/server/integration_tests/core_app/jest.integration.config.js +++ b/src/core/packages/core/server/integration_tests/node/jest.integration.config.js @@ -14,7 +14,7 @@ module.exports = { // see https://github.com/elastic/kibana/pull/130255/ preset: '@kbn/test/jest_integration', rootDir: '../../../../..', - roots: ['/src/core/server/integration_tests/core_app'], + roots: ['/src/core/packages/core/server/integration_tests/node'], // must override to match all test given there is no `integration_tests` subfolder testMatch: ['**/*.test.{js,mjs,ts,tsx}'], }; diff --git a/src/core/server/integration_tests/node/logging.test.ts b/src/core/packages/core/server/integration_tests/node/logging.test.ts similarity index 100% rename from src/core/server/integration_tests/node/logging.test.ts rename to src/core/packages/core/server/integration_tests/node/logging.test.ts diff --git a/src/core/server/integration_tests/node/migrator.test.ts b/src/core/packages/core/server/integration_tests/node/migrator.test.ts similarity index 100% rename from src/core/server/integration_tests/node/migrator.test.ts rename to src/core/packages/core/server/integration_tests/node/migrator.test.ts diff --git a/src/core/server/integration_tests/root/disable_preboot.test.ts b/src/core/packages/core/server/integration_tests/root/disable_preboot.test.ts similarity index 100% rename from src/core/server/integration_tests/root/disable_preboot.test.ts rename to src/core/packages/core/server/integration_tests/root/disable_preboot.test.ts diff --git a/src/core/server/integration_tests/capabilities/jest.integration.config.js b/src/core/packages/core/server/integration_tests/root/jest.integration.config.js similarity index 91% rename from src/core/server/integration_tests/capabilities/jest.integration.config.js rename to src/core/packages/core/server/integration_tests/root/jest.integration.config.js index 72f2adefe525c..68fc987bb892a 100644 --- a/src/core/server/integration_tests/capabilities/jest.integration.config.js +++ b/src/core/packages/core/server/integration_tests/root/jest.integration.config.js @@ -14,7 +14,7 @@ module.exports = { // see https://github.com/elastic/kibana/pull/130255/ preset: '@kbn/test/jest_integration', rootDir: '../../../../..', - roots: ['/src/core/server/integration_tests/capabilities'], + roots: ['/src/core/packages/core/server/integration_tests/root'], // must override to match all test given there is no `integration_tests` subfolder testMatch: ['**/*.test.{js,mjs,ts,tsx}'], }; diff --git a/src/core/server/integration_tests/saved_objects/jest.integration.config.js b/src/core/packages/core/server/integration_tests/saved_objects/jest.integration.config.js similarity index 78% rename from src/core/server/integration_tests/saved_objects/jest.integration.config.js rename to src/core/packages/core/server/integration_tests/saved_objects/jest.integration.config.js index 842eeb6e9d19d..d5deae6a1a528 100644 --- a/src/core/server/integration_tests/saved_objects/jest.integration.config.js +++ b/src/core/packages/core/server/integration_tests/saved_objects/jest.integration.config.js @@ -16,9 +16,9 @@ module.exports = { preset: '@kbn/test/jest_integration', rootDir: '../../../../..', roots: [ - '/src/core/server/integration_tests/saved_objects/routes', - '/src/core/server/integration_tests/saved_objects/service', - '/src/core/server/integration_tests/saved_objects/validation', + '/src/core/packages/core/server/integration_tests/saved_objects/routes', + '/src/core/packages/core/server/integration_tests/saved_objects/service', + '/src/core/packages/core/server/integration_tests/saved_objects/validation', ], // must override to match all test given there is no `integration_tests` subfolder testMatch: ['**/*.test.{js,mjs,ts,tsx}'], diff --git a/src/core/server/integration_tests/saved_objects/migrations/archives/7.13.0_5k_so_node_01.zip b/src/core/packages/core/server/integration_tests/saved_objects/migrations/archives/7.13.0_5k_so_node_01.zip similarity index 100% rename from src/core/server/integration_tests/saved_objects/migrations/archives/7.13.0_5k_so_node_01.zip rename to src/core/packages/core/server/integration_tests/saved_objects/migrations/archives/7.13.0_5k_so_node_01.zip diff --git a/src/core/server/integration_tests/saved_objects/migrations/archives/7.13.0_5k_so_node_02.zip b/src/core/packages/core/server/integration_tests/saved_objects/migrations/archives/7.13.0_5k_so_node_02.zip similarity index 100% rename from src/core/server/integration_tests/saved_objects/migrations/archives/7.13.0_5k_so_node_02.zip rename to src/core/packages/core/server/integration_tests/saved_objects/migrations/archives/7.13.0_5k_so_node_02.zip diff --git a/src/core/server/integration_tests/saved_objects/migrations/archives/8.4.0_with_sample_data_logs.zip b/src/core/packages/core/server/integration_tests/saved_objects/migrations/archives/8.4.0_with_sample_data_logs.zip similarity index 100% rename from src/core/server/integration_tests/saved_objects/migrations/archives/8.4.0_with_sample_data_logs.zip rename to src/core/packages/core/server/integration_tests/saved_objects/migrations/archives/8.4.0_with_sample_data_logs.zip diff --git a/src/core/server/integration_tests/saved_objects/migrations/archives/9.0.0_baseline_1k_docs.zip b/src/core/packages/core/server/integration_tests/saved_objects/migrations/archives/9.0.0_baseline_1k_docs.zip similarity index 100% rename from src/core/server/integration_tests/saved_objects/migrations/archives/9.0.0_baseline_1k_docs.zip rename to src/core/packages/core/server/integration_tests/saved_objects/migrations/archives/9.0.0_baseline_1k_docs.zip diff --git a/src/core/server/integration_tests/saved_objects/migrations/archives/9.0.0_baseline_500k_docs.zip b/src/core/packages/core/server/integration_tests/saved_objects/migrations/archives/9.0.0_baseline_500k_docs.zip similarity index 100% rename from src/core/server/integration_tests/saved_objects/migrations/archives/9.0.0_baseline_500k_docs.zip rename to src/core/packages/core/server/integration_tests/saved_objects/migrations/archives/9.0.0_baseline_500k_docs.zip diff --git a/src/core/server/integration_tests/saved_objects/migrations/elasticsearch_client_wrapper.ts b/src/core/packages/core/server/integration_tests/saved_objects/migrations/elasticsearch_client_wrapper.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/migrations/elasticsearch_client_wrapper.ts rename to src/core/packages/core/server/integration_tests/saved_objects/migrations/elasticsearch_client_wrapper.ts diff --git a/src/core/server/integration_tests/saved_objects/migrations/fixtures/zdt_base.fixtures.ts b/src/core/packages/core/server/integration_tests/saved_objects/migrations/fixtures/zdt_base.fixtures.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/migrations/fixtures/zdt_base.fixtures.ts rename to src/core/packages/core/server/integration_tests/saved_objects/migrations/fixtures/zdt_base.fixtures.ts diff --git a/src/core/server/integration_tests/saved_objects/migrations/group1/.gitignore b/src/core/packages/core/server/integration_tests/saved_objects/migrations/group1/.gitignore similarity index 100% rename from src/core/server/integration_tests/saved_objects/migrations/group1/.gitignore rename to src/core/packages/core/server/integration_tests/saved_objects/migrations/group1/.gitignore diff --git a/src/core/server/integration_tests/saved_objects/migrations/group1/__snapshots__/v2_migration.test.ts.snap b/src/core/packages/core/server/integration_tests/saved_objects/migrations/group1/__snapshots__/v2_migration.test.ts.snap similarity index 100% rename from src/core/server/integration_tests/saved_objects/migrations/group1/__snapshots__/v2_migration.test.ts.snap rename to src/core/packages/core/server/integration_tests/saved_objects/migrations/group1/__snapshots__/v2_migration.test.ts.snap diff --git a/src/core/server/integration_tests/saved_objects/migrations/group1/create_test_archives.test.ts b/src/core/packages/core/server/integration_tests/saved_objects/migrations/group1/create_test_archives.test.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/migrations/group1/create_test_archives.test.ts rename to src/core/packages/core/server/integration_tests/saved_objects/migrations/group1/create_test_archives.test.ts diff --git a/src/core/server/integration_tests/saved_objects/migrations/group3/jest.integration.config.js b/src/core/packages/core/server/integration_tests/saved_objects/migrations/group1/jest.integration.config.js similarity index 89% rename from src/core/server/integration_tests/saved_objects/migrations/group3/jest.integration.config.js rename to src/core/packages/core/server/integration_tests/saved_objects/migrations/group1/jest.integration.config.js index 10c784104f93c..5af07bae2a06e 100644 --- a/src/core/server/integration_tests/saved_objects/migrations/group3/jest.integration.config.js +++ b/src/core/packages/core/server/integration_tests/saved_objects/migrations/group1/jest.integration.config.js @@ -14,7 +14,7 @@ module.exports = { // see https://github.com/elastic/kibana/pull/130255/ preset: '@kbn/test/jest_integration', rootDir: '../../../../../../..', - roots: ['/src/core/server/integration_tests/saved_objects/migrations/group3'], + roots: ['/src/core/packages/core/server/integration_tests/saved_objects/migrations/group1'], // must override to match all test given there is no `integration_tests` subfolder testMatch: ['**/*.test.{js,mjs,ts,tsx}'], }; diff --git a/src/core/server/integration_tests/saved_objects/migrations/group1/v2_migration.test.ts b/src/core/packages/core/server/integration_tests/saved_objects/migrations/group1/v2_migration.test.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/migrations/group1/v2_migration.test.ts rename to src/core/packages/core/server/integration_tests/saved_objects/migrations/group1/v2_migration.test.ts diff --git a/src/core/server/integration_tests/saved_objects/migrations/group2/.gitignore b/src/core/packages/core/server/integration_tests/saved_objects/migrations/group2/.gitignore similarity index 100% rename from src/core/server/integration_tests/saved_objects/migrations/group2/.gitignore rename to src/core/packages/core/server/integration_tests/saved_objects/migrations/group2/.gitignore diff --git a/src/core/server/integration_tests/saved_objects/migrations/group4/jest.integration.config.js b/src/core/packages/core/server/integration_tests/saved_objects/migrations/group2/jest.integration.config.js similarity index 89% rename from src/core/server/integration_tests/saved_objects/migrations/group4/jest.integration.config.js rename to src/core/packages/core/server/integration_tests/saved_objects/migrations/group2/jest.integration.config.js index f315ac5a26af4..3c4e93e2b10fe 100644 --- a/src/core/server/integration_tests/saved_objects/migrations/group4/jest.integration.config.js +++ b/src/core/packages/core/server/integration_tests/saved_objects/migrations/group2/jest.integration.config.js @@ -14,7 +14,7 @@ module.exports = { // see https://github.com/elastic/kibana/pull/130255/ preset: '@kbn/test/jest_integration', rootDir: '../../../../../../..', - roots: ['/src/core/server/integration_tests/saved_objects/migrations/group4'], + roots: ['/src/core/packages/core/server/integration_tests/saved_objects/migrations/group2'], // must override to match all test given there is no `integration_tests` subfolder testMatch: ['**/*.test.{js,mjs,ts,tsx}'], }; diff --git a/src/core/server/integration_tests/saved_objects/migrations/group2/multiple_kb_nodes.test.ts b/src/core/packages/core/server/integration_tests/saved_objects/migrations/group2/multiple_kb_nodes.test.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/migrations/group2/multiple_kb_nodes.test.ts rename to src/core/packages/core/server/integration_tests/saved_objects/migrations/group2/multiple_kb_nodes.test.ts diff --git a/src/core/server/integration_tests/saved_objects/migrations/group3/.gitignore b/src/core/packages/core/server/integration_tests/saved_objects/migrations/group3/.gitignore similarity index 100% rename from src/core/server/integration_tests/saved_objects/migrations/group3/.gitignore rename to src/core/packages/core/server/integration_tests/saved_objects/migrations/group3/.gitignore diff --git a/src/core/server/integration_tests/saved_objects/migrations/group3/actions/actions.test.ts b/src/core/packages/core/server/integration_tests/saved_objects/migrations/group3/actions/actions.test.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/migrations/group3/actions/actions.test.ts rename to src/core/packages/core/server/integration_tests/saved_objects/migrations/group3/actions/actions.test.ts diff --git a/src/core/server/integration_tests/saved_objects/migrations/group3/actions/actions_test_suite.ts b/src/core/packages/core/server/integration_tests/saved_objects/migrations/group3/actions/actions_test_suite.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/migrations/group3/actions/actions_test_suite.ts rename to src/core/packages/core/server/integration_tests/saved_objects/migrations/group3/actions/actions_test_suite.ts diff --git a/src/core/server/integration_tests/saved_objects/migrations/group3/actions/es_errors.test.ts b/src/core/packages/core/server/integration_tests/saved_objects/migrations/group3/actions/es_errors.test.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/migrations/group3/actions/es_errors.test.ts rename to src/core/packages/core/server/integration_tests/saved_objects/migrations/group3/actions/es_errors.test.ts diff --git a/src/core/server/integration_tests/saved_objects/migrations/group3/default_search_fields.test.ts b/src/core/packages/core/server/integration_tests/saved_objects/migrations/group3/default_search_fields.test.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/migrations/group3/default_search_fields.test.ts rename to src/core/packages/core/server/integration_tests/saved_objects/migrations/group3/default_search_fields.test.ts diff --git a/src/core/server/integration_tests/saved_objects/migrations/group3/deferred_migrations.test.ts b/src/core/packages/core/server/integration_tests/saved_objects/migrations/group3/deferred_migrations.test.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/migrations/group3/deferred_migrations.test.ts rename to src/core/packages/core/server/integration_tests/saved_objects/migrations/group3/deferred_migrations.test.ts diff --git a/src/core/server/integration_tests/saved_objects/migrations/group3/fail_on_rollback.test.ts b/src/core/packages/core/server/integration_tests/saved_objects/migrations/group3/fail_on_rollback.test.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/migrations/group3/fail_on_rollback.test.ts rename to src/core/packages/core/server/integration_tests/saved_objects/migrations/group3/fail_on_rollback.test.ts diff --git a/src/core/server/integration_tests/saved_objects/migrations/group3/incompatible_cluster_routing_allocation.test.ts b/src/core/packages/core/server/integration_tests/saved_objects/migrations/group3/incompatible_cluster_routing_allocation.test.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/migrations/group3/incompatible_cluster_routing_allocation.test.ts rename to src/core/packages/core/server/integration_tests/saved_objects/migrations/group3/incompatible_cluster_routing_allocation.test.ts diff --git a/src/core/packages/core/server/integration_tests/saved_objects/migrations/group3/jest.integration.config.js b/src/core/packages/core/server/integration_tests/saved_objects/migrations/group3/jest.integration.config.js new file mode 100644 index 0000000000000..d6e449dde3b49 --- /dev/null +++ b/src/core/packages/core/server/integration_tests/saved_objects/migrations/group3/jest.integration.config.js @@ -0,0 +1,20 @@ +/* + * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +module.exports = { + // TODO replace the line below with + // preset: '@kbn/test/jest_integration_node + // to do so, we must fix all integration tests first + // see https://github.com/elastic/kibana/pull/130255/ + preset: '@kbn/test/jest_integration', + rootDir: '../../../../../../..', + roots: ['/src/core/packages/core/server/integration_tests/saved_objects/migrations/group3'], + // must override to match all test given there is no `integration_tests` subfolder + testMatch: ['**/*.test.{js,mjs,ts,tsx}'], +}; diff --git a/src/core/server/integration_tests/saved_objects/migrations/group3/multiple_es_nodes.test.ts b/src/core/packages/core/server/integration_tests/saved_objects/migrations/group3/multiple_es_nodes.test.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/migrations/group3/multiple_es_nodes.test.ts rename to src/core/packages/core/server/integration_tests/saved_objects/migrations/group3/multiple_es_nodes.test.ts diff --git a/src/core/server/integration_tests/saved_objects/migrations/group3/read_batch_size.test.ts b/src/core/packages/core/server/integration_tests/saved_objects/migrations/group3/read_batch_size.test.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/migrations/group3/read_batch_size.test.ts rename to src/core/packages/core/server/integration_tests/saved_objects/migrations/group3/read_batch_size.test.ts diff --git a/src/core/server/integration_tests/saved_objects/migrations/group3/skip_migration.test.ts b/src/core/packages/core/server/integration_tests/saved_objects/migrations/group3/skip_migration.test.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/migrations/group3/skip_migration.test.ts rename to src/core/packages/core/server/integration_tests/saved_objects/migrations/group3/skip_migration.test.ts diff --git a/src/core/server/integration_tests/saved_objects/migrations/group3/split_failed_to_clone.test.ts b/src/core/packages/core/server/integration_tests/saved_objects/migrations/group3/split_failed_to_clone.test.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/migrations/group3/split_failed_to_clone.test.ts rename to src/core/packages/core/server/integration_tests/saved_objects/migrations/group3/split_failed_to_clone.test.ts diff --git a/src/core/server/integration_tests/saved_objects/migrations/group3/type_registrations.test.ts b/src/core/packages/core/server/integration_tests/saved_objects/migrations/group3/type_registrations.test.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/migrations/group3/type_registrations.test.ts rename to src/core/packages/core/server/integration_tests/saved_objects/migrations/group3/type_registrations.test.ts diff --git a/src/core/server/integration_tests/saved_objects/migrations/group3/wait_for_migration_completion.test.ts b/src/core/packages/core/server/integration_tests/saved_objects/migrations/group3/wait_for_migration_completion.test.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/migrations/group3/wait_for_migration_completion.test.ts rename to src/core/packages/core/server/integration_tests/saved_objects/migrations/group3/wait_for_migration_completion.test.ts diff --git a/src/core/packages/core/server/integration_tests/saved_objects/migrations/group4/jest.integration.config.js b/src/core/packages/core/server/integration_tests/saved_objects/migrations/group4/jest.integration.config.js new file mode 100644 index 0000000000000..9f32428afd067 --- /dev/null +++ b/src/core/packages/core/server/integration_tests/saved_objects/migrations/group4/jest.integration.config.js @@ -0,0 +1,20 @@ +/* + * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +module.exports = { + // TODO replace the line below with + // preset: '@kbn/test/jest_integration_node + // to do so, we must fix all integration tests first + // see https://github.com/elastic/kibana/pull/130255/ + preset: '@kbn/test/jest_integration', + rootDir: '../../../../../../..', + roots: ['/src/core/packages/core/server/integration_tests/saved_objects/migrations/group4'], + // must override to match all test given there is no `integration_tests` subfolder + testMatch: ['**/*.test.{js,mjs,ts,tsx}'], +}; diff --git a/src/core/server/integration_tests/saved_objects/migrations/group4/v2_md5_to_mv.test.ts b/src/core/packages/core/server/integration_tests/saved_objects/migrations/group4/v2_md5_to_mv.test.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/migrations/group4/v2_md5_to_mv.test.ts rename to src/core/packages/core/server/integration_tests/saved_objects/migrations/group4/v2_md5_to_mv.test.ts diff --git a/src/core/server/integration_tests/saved_objects/migrations/group4/v2_with_mv_same_stack_version.test.ts b/src/core/packages/core/server/integration_tests/saved_objects/migrations/group4/v2_with_mv_same_stack_version.test.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/migrations/group4/v2_with_mv_same_stack_version.test.ts rename to src/core/packages/core/server/integration_tests/saved_objects/migrations/group4/v2_with_mv_same_stack_version.test.ts diff --git a/src/core/server/integration_tests/saved_objects/migrations/group4/v2_with_mv_stack_version_bump.test.ts b/src/core/packages/core/server/integration_tests/saved_objects/migrations/group4/v2_with_mv_stack_version_bump.test.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/migrations/group4/v2_with_mv_stack_version_bump.test.ts rename to src/core/packages/core/server/integration_tests/saved_objects/migrations/group4/v2_with_mv_stack_version_bump.test.ts diff --git a/src/core/server/integration_tests/saved_objects/migrations/group5/active_delete.test.ts b/src/core/packages/core/server/integration_tests/saved_objects/migrations/group5/active_delete.test.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/migrations/group5/active_delete.test.ts rename to src/core/packages/core/server/integration_tests/saved_objects/migrations/group5/active_delete.test.ts diff --git a/src/core/server/integration_tests/saved_objects/migrations/group5/active_delete_multiple_instances.test.ts b/src/core/packages/core/server/integration_tests/saved_objects/migrations/group5/active_delete_multiple_instances.test.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/migrations/group5/active_delete_multiple_instances.test.ts rename to src/core/packages/core/server/integration_tests/saved_objects/migrations/group5/active_delete_multiple_instances.test.ts diff --git a/src/core/packages/core/server/integration_tests/saved_objects/migrations/group5/jest.integration.config.js b/src/core/packages/core/server/integration_tests/saved_objects/migrations/group5/jest.integration.config.js new file mode 100644 index 0000000000000..3d6c9dda91dfa --- /dev/null +++ b/src/core/packages/core/server/integration_tests/saved_objects/migrations/group5/jest.integration.config.js @@ -0,0 +1,20 @@ +/* + * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +module.exports = { + // TODO replace the line below with + // preset: '@kbn/test/jest_integration_node + // to do so, we must fix all integration tests first + // see https://github.com/elastic/kibana/pull/130255/ + preset: '@kbn/test/jest_integration', + rootDir: '../../../../../../..', + roots: ['/src/core/packages/core/server/integration_tests/saved_objects/migrations/group5'], + // must override to match all test given there is no `integration_tests` subfolder + testMatch: ['**/*.test.{js,mjs,ts,tsx}'], +}; diff --git a/src/core/server/integration_tests/saved_objects/migrations/group5/pickup_updated_types_only.test.ts b/src/core/packages/core/server/integration_tests/saved_objects/migrations/group5/pickup_updated_types_only.test.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/migrations/group5/pickup_updated_types_only.test.ts rename to src/core/packages/core/server/integration_tests/saved_objects/migrations/group5/pickup_updated_types_only.test.ts diff --git a/src/core/server/integration_tests/saved_objects/migrations/group5/skip_reindex.test.ts b/src/core/packages/core/server/integration_tests/saved_objects/migrations/group5/skip_reindex.test.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/migrations/group5/skip_reindex.test.ts rename to src/core/packages/core/server/integration_tests/saved_objects/migrations/group5/skip_reindex.test.ts diff --git a/src/core/packages/core/server/integration_tests/saved_objects/migrations/group6/jest.integration.config.js b/src/core/packages/core/server/integration_tests/saved_objects/migrations/group6/jest.integration.config.js new file mode 100644 index 0000000000000..31953d911227e --- /dev/null +++ b/src/core/packages/core/server/integration_tests/saved_objects/migrations/group6/jest.integration.config.js @@ -0,0 +1,20 @@ +/* + * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +module.exports = { + // TODO replace the line below with + // preset: '@kbn/test/jest_integration_node + // to do so, we must fix all integration tests first + // see https://github.com/elastic/kibana/pull/130255/ + preset: '@kbn/test/jest_integration', + rootDir: '../../../../../../..', + roots: ['/src/core/packages/core/server/integration_tests/saved_objects/migrations/group6'], + // must override to match all test given there is no `integration_tests` subfolder + testMatch: ['**/*.test.{js,mjs,ts,tsx}'], +}; diff --git a/src/core/server/integration_tests/saved_objects/migrations/group6/single_migrator_failures.test.ts b/src/core/packages/core/server/integration_tests/saved_objects/migrations/group6/single_migrator_failures.test.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/migrations/group6/single_migrator_failures.test.ts rename to src/core/packages/core/server/integration_tests/saved_objects/migrations/group6/single_migrator_failures.test.ts diff --git a/src/core/server/integration_tests/saved_objects/migrations/jest_matchers.ts b/src/core/packages/core/server/integration_tests/saved_objects/migrations/jest_matchers.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/migrations/jest_matchers.ts rename to src/core/packages/core/server/integration_tests/saved_objects/migrations/jest_matchers.ts diff --git a/src/core/server/integration_tests/saved_objects/migrations/kibana_migrator_archive_utils.ts b/src/core/packages/core/server/integration_tests/saved_objects/migrations/kibana_migrator_archive_utils.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/migrations/kibana_migrator_archive_utils.ts rename to src/core/packages/core/server/integration_tests/saved_objects/migrations/kibana_migrator_archive_utils.ts diff --git a/src/core/server/integration_tests/saved_objects/migrations/kibana_migrator_test_kit.expect.ts b/src/core/packages/core/server/integration_tests/saved_objects/migrations/kibana_migrator_test_kit.expect.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/migrations/kibana_migrator_test_kit.expect.ts rename to src/core/packages/core/server/integration_tests/saved_objects/migrations/kibana_migrator_test_kit.expect.ts diff --git a/src/core/server/integration_tests/saved_objects/migrations/kibana_migrator_test_kit.fixtures.ts b/src/core/packages/core/server/integration_tests/saved_objects/migrations/kibana_migrator_test_kit.fixtures.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/migrations/kibana_migrator_test_kit.fixtures.ts rename to src/core/packages/core/server/integration_tests/saved_objects/migrations/kibana_migrator_test_kit.fixtures.ts diff --git a/src/core/server/integration_tests/saved_objects/migrations/kibana_migrator_test_kit.ts b/src/core/packages/core/server/integration_tests/saved_objects/migrations/kibana_migrator_test_kit.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/migrations/kibana_migrator_test_kit.ts rename to src/core/packages/core/server/integration_tests/saved_objects/migrations/kibana_migrator_test_kit.ts diff --git a/src/core/server/integration_tests/saved_objects/migrations/shared_suites/zdt/basic_document_migration.ts b/src/core/packages/core/server/integration_tests/saved_objects/migrations/shared_suites/zdt/basic_document_migration.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/migrations/shared_suites/zdt/basic_document_migration.ts rename to src/core/packages/core/server/integration_tests/saved_objects/migrations/shared_suites/zdt/basic_document_migration.ts diff --git a/src/core/server/integration_tests/saved_objects/migrations/shared_suites/zdt/standard_workflow.ts b/src/core/packages/core/server/integration_tests/saved_objects/migrations/shared_suites/zdt/standard_workflow.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/migrations/shared_suites/zdt/standard_workflow.ts rename to src/core/packages/core/server/integration_tests/saved_objects/migrations/shared_suites/zdt/standard_workflow.ts diff --git a/src/core/server/integration_tests/saved_objects/migrations/test_types.ts b/src/core/packages/core/server/integration_tests/saved_objects/migrations/test_types.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/migrations/test_types.ts rename to src/core/packages/core/server/integration_tests/saved_objects/migrations/test_types.ts diff --git a/src/core/server/integration_tests/saved_objects/migrations/test_utils.ts b/src/core/packages/core/server/integration_tests/saved_objects/migrations/test_utils.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/migrations/test_utils.ts rename to src/core/packages/core/server/integration_tests/saved_objects/migrations/test_utils.ts diff --git a/src/core/server/integration_tests/saved_objects/migrations/zdt_1/basic_document_migration.test.ts b/src/core/packages/core/server/integration_tests/saved_objects/migrations/zdt_1/basic_document_migration.test.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/migrations/zdt_1/basic_document_migration.test.ts rename to src/core/packages/core/server/integration_tests/saved_objects/migrations/zdt_1/basic_document_migration.test.ts diff --git a/src/core/server/integration_tests/saved_objects/migrations/zdt_1/basic_downgrade.test.ts b/src/core/packages/core/server/integration_tests/saved_objects/migrations/zdt_1/basic_downgrade.test.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/migrations/zdt_1/basic_downgrade.test.ts rename to src/core/packages/core/server/integration_tests/saved_objects/migrations/zdt_1/basic_downgrade.test.ts diff --git a/src/core/server/integration_tests/saved_objects/migrations/zdt_1/conversion_failures.test.ts b/src/core/packages/core/server/integration_tests/saved_objects/migrations/zdt_1/conversion_failures.test.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/migrations/zdt_1/conversion_failures.test.ts rename to src/core/packages/core/server/integration_tests/saved_objects/migrations/zdt_1/conversion_failures.test.ts diff --git a/src/core/server/integration_tests/saved_objects/migrations/zdt_1/create_index.test.ts b/src/core/packages/core/server/integration_tests/saved_objects/migrations/zdt_1/create_index.test.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/migrations/zdt_1/create_index.test.ts rename to src/core/packages/core/server/integration_tests/saved_objects/migrations/zdt_1/create_index.test.ts diff --git a/src/core/server/integration_tests/saved_objects/migrations/zdt_1/document_cleanup.test.ts b/src/core/packages/core/server/integration_tests/saved_objects/migrations/zdt_1/document_cleanup.test.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/migrations/zdt_1/document_cleanup.test.ts rename to src/core/packages/core/server/integration_tests/saved_objects/migrations/zdt_1/document_cleanup.test.ts diff --git a/src/core/server/integration_tests/saved_objects/migrations/group1/jest.integration.config.js b/src/core/packages/core/server/integration_tests/saved_objects/migrations/zdt_1/jest.integration.config.js similarity index 89% rename from src/core/server/integration_tests/saved_objects/migrations/group1/jest.integration.config.js rename to src/core/packages/core/server/integration_tests/saved_objects/migrations/zdt_1/jest.integration.config.js index 9e01ffa7c207d..1d7dbf6d59a3e 100644 --- a/src/core/server/integration_tests/saved_objects/migrations/group1/jest.integration.config.js +++ b/src/core/packages/core/server/integration_tests/saved_objects/migrations/zdt_1/jest.integration.config.js @@ -14,7 +14,7 @@ module.exports = { // see https://github.com/elastic/kibana/pull/130255/ preset: '@kbn/test/jest_integration', rootDir: '../../../../../../..', - roots: ['/src/core/server/integration_tests/saved_objects/migrations/group1'], + roots: ['/src/core/packages/core/server/integration_tests/saved_objects/migrations/zdt_1'], // must override to match all test given there is no `integration_tests` subfolder testMatch: ['**/*.test.{js,mjs,ts,tsx}'], }; diff --git a/src/core/server/integration_tests/saved_objects/migrations/zdt_1/mapping_version_conflict.test.ts b/src/core/packages/core/server/integration_tests/saved_objects/migrations/zdt_1/mapping_version_conflict.test.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/migrations/zdt_1/mapping_version_conflict.test.ts rename to src/core/packages/core/server/integration_tests/saved_objects/migrations/zdt_1/mapping_version_conflict.test.ts diff --git a/src/core/server/integration_tests/saved_objects/migrations/zdt_1/rerun_same_version.test.ts b/src/core/packages/core/server/integration_tests/saved_objects/migrations/zdt_1/rerun_same_version.test.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/migrations/zdt_1/rerun_same_version.test.ts rename to src/core/packages/core/server/integration_tests/saved_objects/migrations/zdt_1/rerun_same_version.test.ts diff --git a/src/core/server/integration_tests/saved_objects/migrations/zdt_1/standard_workflow.test.ts b/src/core/packages/core/server/integration_tests/saved_objects/migrations/zdt_1/standard_workflow.test.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/migrations/zdt_1/standard_workflow.test.ts rename to src/core/packages/core/server/integration_tests/saved_objects/migrations/zdt_1/standard_workflow.test.ts diff --git a/src/core/server/integration_tests/saved_objects/migrations/zdt_1/update_mappings.test.ts b/src/core/packages/core/server/integration_tests/saved_objects/migrations/zdt_1/update_mappings.test.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/migrations/zdt_1/update_mappings.test.ts rename to src/core/packages/core/server/integration_tests/saved_objects/migrations/zdt_1/update_mappings.test.ts diff --git a/src/core/server/integration_tests/saved_objects/migrations/group2/jest.integration.config.js b/src/core/packages/core/server/integration_tests/saved_objects/migrations/zdt_2/jest.integration.config.js similarity index 89% rename from src/core/server/integration_tests/saved_objects/migrations/group2/jest.integration.config.js rename to src/core/packages/core/server/integration_tests/saved_objects/migrations/zdt_2/jest.integration.config.js index da6e9eb66c639..1d6e725c4fad3 100644 --- a/src/core/server/integration_tests/saved_objects/migrations/group2/jest.integration.config.js +++ b/src/core/packages/core/server/integration_tests/saved_objects/migrations/zdt_2/jest.integration.config.js @@ -14,7 +14,7 @@ module.exports = { // see https://github.com/elastic/kibana/pull/130255/ preset: '@kbn/test/jest_integration', rootDir: '../../../../../../..', - roots: ['/src/core/server/integration_tests/saved_objects/migrations/group2'], + roots: ['/src/core/packages/core/server/integration_tests/saved_objects/migrations/zdt_2'], // must override to match all test given there is no `integration_tests` subfolder testMatch: ['**/*.test.{js,mjs,ts,tsx}'], }; diff --git a/src/core/server/integration_tests/saved_objects/migrations/zdt_2/outdated_doc_query.test.ts b/src/core/packages/core/server/integration_tests/saved_objects/migrations/zdt_2/outdated_doc_query.test.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/migrations/zdt_2/outdated_doc_query.test.ts rename to src/core/packages/core/server/integration_tests/saved_objects/migrations/zdt_2/outdated_doc_query.test.ts diff --git a/src/core/server/integration_tests/saved_objects/migrations/zdt_2/root_field_addition.test.ts b/src/core/packages/core/server/integration_tests/saved_objects/migrations/zdt_2/root_field_addition.test.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/migrations/zdt_2/root_field_addition.test.ts rename to src/core/packages/core/server/integration_tests/saved_objects/migrations/zdt_2/root_field_addition.test.ts diff --git a/src/core/server/integration_tests/saved_objects/migrations/zdt_2/sor_higher_version_docs.test.ts b/src/core/packages/core/server/integration_tests/saved_objects/migrations/zdt_2/sor_higher_version_docs.test.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/migrations/zdt_2/sor_higher_version_docs.test.ts rename to src/core/packages/core/server/integration_tests/saved_objects/migrations/zdt_2/sor_higher_version_docs.test.ts diff --git a/src/core/server/integration_tests/saved_objects/migrations/zdt_2/type_addition.test.ts b/src/core/packages/core/server/integration_tests/saved_objects/migrations/zdt_2/type_addition.test.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/migrations/zdt_2/type_addition.test.ts rename to src/core/packages/core/server/integration_tests/saved_objects/migrations/zdt_2/type_addition.test.ts diff --git a/src/core/server/integration_tests/saved_objects/migrations/zdt_2/v2_to_zdt_partial_failure.test.ts b/src/core/packages/core/server/integration_tests/saved_objects/migrations/zdt_2/v2_to_zdt_partial_failure.test.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/migrations/zdt_2/v2_to_zdt_partial_failure.test.ts rename to src/core/packages/core/server/integration_tests/saved_objects/migrations/zdt_2/v2_to_zdt_partial_failure.test.ts diff --git a/src/core/server/integration_tests/saved_objects/migrations/zdt_2/v2_to_zdt_switch.test.ts b/src/core/packages/core/server/integration_tests/saved_objects/migrations/zdt_2/v2_to_zdt_switch.test.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/migrations/zdt_2/v2_to_zdt_switch.test.ts rename to src/core/packages/core/server/integration_tests/saved_objects/migrations/zdt_2/v2_to_zdt_switch.test.ts diff --git a/src/core/server/integration_tests/saved_objects/migrations/zdt_v2_compat/basic_document_migration.test.ts b/src/core/packages/core/server/integration_tests/saved_objects/migrations/zdt_v2_compat/basic_document_migration.test.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/migrations/zdt_v2_compat/basic_document_migration.test.ts rename to src/core/packages/core/server/integration_tests/saved_objects/migrations/zdt_v2_compat/basic_document_migration.test.ts diff --git a/src/core/server/integration_tests/saved_objects/migrations/zdt_v2_compat/create_index.test.ts b/src/core/packages/core/server/integration_tests/saved_objects/migrations/zdt_v2_compat/create_index.test.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/migrations/zdt_v2_compat/create_index.test.ts rename to src/core/packages/core/server/integration_tests/saved_objects/migrations/zdt_v2_compat/create_index.test.ts diff --git a/src/core/packages/core/server/integration_tests/saved_objects/migrations/zdt_v2_compat/jest.integration.config.js b/src/core/packages/core/server/integration_tests/saved_objects/migrations/zdt_v2_compat/jest.integration.config.js new file mode 100644 index 0000000000000..5a8642c39340b --- /dev/null +++ b/src/core/packages/core/server/integration_tests/saved_objects/migrations/zdt_v2_compat/jest.integration.config.js @@ -0,0 +1,20 @@ +/* + * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +module.exports = { + // TODO replace the line below with + // preset: '@kbn/test/jest_integration_node + // to do so, we must fix all integration tests first + // see https://github.com/elastic/kibana/pull/130255/ + preset: '@kbn/test/jest_integration', + rootDir: '../../../../../../..', + roots: ['/src/core/packages/core/server/integration_tests/saved_objects/migrations/zdt_v2_compat'], + // must override to match all test given there is no `integration_tests` subfolder + testMatch: ['**/*.test.{js,mjs,ts,tsx}'], +}; diff --git a/src/core/server/integration_tests/saved_objects/migrations/zdt_v2_compat/switch_to_model_version.test.ts b/src/core/packages/core/server/integration_tests/saved_objects/migrations/zdt_v2_compat/switch_to_model_version.test.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/migrations/zdt_v2_compat/switch_to_model_version.test.ts rename to src/core/packages/core/server/integration_tests/saved_objects/migrations/zdt_v2_compat/switch_to_model_version.test.ts diff --git a/src/core/server/integration_tests/saved_objects/migrations/zdt_v2_compat/update_mappings.test.ts b/src/core/packages/core/server/integration_tests/saved_objects/migrations/zdt_v2_compat/update_mappings.test.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/migrations/zdt_v2_compat/update_mappings.test.ts rename to src/core/packages/core/server/integration_tests/saved_objects/migrations/zdt_v2_compat/update_mappings.test.ts diff --git a/src/core/server/integration_tests/saved_objects/routes/allow_api_access/bulk_create.test.ts b/src/core/packages/core/server/integration_tests/saved_objects/routes/allow_api_access/bulk_create.test.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/routes/allow_api_access/bulk_create.test.ts rename to src/core/packages/core/server/integration_tests/saved_objects/routes/allow_api_access/bulk_create.test.ts diff --git a/src/core/server/integration_tests/saved_objects/routes/allow_api_access/bulk_delete.test.ts b/src/core/packages/core/server/integration_tests/saved_objects/routes/allow_api_access/bulk_delete.test.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/routes/allow_api_access/bulk_delete.test.ts rename to src/core/packages/core/server/integration_tests/saved_objects/routes/allow_api_access/bulk_delete.test.ts diff --git a/src/core/server/integration_tests/saved_objects/routes/allow_api_access/bulk_get.test.ts b/src/core/packages/core/server/integration_tests/saved_objects/routes/allow_api_access/bulk_get.test.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/routes/allow_api_access/bulk_get.test.ts rename to src/core/packages/core/server/integration_tests/saved_objects/routes/allow_api_access/bulk_get.test.ts diff --git a/src/core/server/integration_tests/saved_objects/routes/allow_api_access/bulk_resolve.test.ts b/src/core/packages/core/server/integration_tests/saved_objects/routes/allow_api_access/bulk_resolve.test.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/routes/allow_api_access/bulk_resolve.test.ts rename to src/core/packages/core/server/integration_tests/saved_objects/routes/allow_api_access/bulk_resolve.test.ts diff --git a/src/core/server/integration_tests/saved_objects/routes/allow_api_access/bulk_update.test.ts b/src/core/packages/core/server/integration_tests/saved_objects/routes/allow_api_access/bulk_update.test.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/routes/allow_api_access/bulk_update.test.ts rename to src/core/packages/core/server/integration_tests/saved_objects/routes/allow_api_access/bulk_update.test.ts diff --git a/src/core/server/integration_tests/saved_objects/routes/allow_api_access/create.test.ts b/src/core/packages/core/server/integration_tests/saved_objects/routes/allow_api_access/create.test.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/routes/allow_api_access/create.test.ts rename to src/core/packages/core/server/integration_tests/saved_objects/routes/allow_api_access/create.test.ts diff --git a/src/core/server/integration_tests/saved_objects/routes/allow_api_access/delete.test.ts b/src/core/packages/core/server/integration_tests/saved_objects/routes/allow_api_access/delete.test.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/routes/allow_api_access/delete.test.ts rename to src/core/packages/core/server/integration_tests/saved_objects/routes/allow_api_access/delete.test.ts diff --git a/src/core/server/integration_tests/saved_objects/routes/allow_api_access/find.test.ts b/src/core/packages/core/server/integration_tests/saved_objects/routes/allow_api_access/find.test.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/routes/allow_api_access/find.test.ts rename to src/core/packages/core/server/integration_tests/saved_objects/routes/allow_api_access/find.test.ts diff --git a/src/core/server/integration_tests/saved_objects/routes/allow_api_access/get.test.ts b/src/core/packages/core/server/integration_tests/saved_objects/routes/allow_api_access/get.test.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/routes/allow_api_access/get.test.ts rename to src/core/packages/core/server/integration_tests/saved_objects/routes/allow_api_access/get.test.ts diff --git a/src/core/server/integration_tests/saved_objects/routes/allow_api_access/resolve.test.ts b/src/core/packages/core/server/integration_tests/saved_objects/routes/allow_api_access/resolve.test.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/routes/allow_api_access/resolve.test.ts rename to src/core/packages/core/server/integration_tests/saved_objects/routes/allow_api_access/resolve.test.ts diff --git a/src/core/server/integration_tests/saved_objects/routes/allow_api_access/update.test.ts b/src/core/packages/core/server/integration_tests/saved_objects/routes/allow_api_access/update.test.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/routes/allow_api_access/update.test.ts rename to src/core/packages/core/server/integration_tests/saved_objects/routes/allow_api_access/update.test.ts diff --git a/src/core/server/integration_tests/saved_objects/routes/bulk_create.test.ts b/src/core/packages/core/server/integration_tests/saved_objects/routes/bulk_create.test.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/routes/bulk_create.test.ts rename to src/core/packages/core/server/integration_tests/saved_objects/routes/bulk_create.test.ts diff --git a/src/core/server/integration_tests/saved_objects/routes/bulk_delete.test.ts b/src/core/packages/core/server/integration_tests/saved_objects/routes/bulk_delete.test.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/routes/bulk_delete.test.ts rename to src/core/packages/core/server/integration_tests/saved_objects/routes/bulk_delete.test.ts diff --git a/src/core/server/integration_tests/saved_objects/routes/bulk_get.test.ts b/src/core/packages/core/server/integration_tests/saved_objects/routes/bulk_get.test.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/routes/bulk_get.test.ts rename to src/core/packages/core/server/integration_tests/saved_objects/routes/bulk_get.test.ts diff --git a/src/core/server/integration_tests/saved_objects/routes/bulk_resolve.test.ts b/src/core/packages/core/server/integration_tests/saved_objects/routes/bulk_resolve.test.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/routes/bulk_resolve.test.ts rename to src/core/packages/core/server/integration_tests/saved_objects/routes/bulk_resolve.test.ts diff --git a/src/core/server/integration_tests/saved_objects/routes/bulk_update.test.ts b/src/core/packages/core/server/integration_tests/saved_objects/routes/bulk_update.test.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/routes/bulk_update.test.ts rename to src/core/packages/core/server/integration_tests/saved_objects/routes/bulk_update.test.ts diff --git a/src/core/server/integration_tests/saved_objects/routes/create.test.ts b/src/core/packages/core/server/integration_tests/saved_objects/routes/create.test.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/routes/create.test.ts rename to src/core/packages/core/server/integration_tests/saved_objects/routes/create.test.ts diff --git a/src/core/server/integration_tests/saved_objects/routes/delete.test.ts b/src/core/packages/core/server/integration_tests/saved_objects/routes/delete.test.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/routes/delete.test.ts rename to src/core/packages/core/server/integration_tests/saved_objects/routes/delete.test.ts diff --git a/src/core/server/integration_tests/saved_objects/routes/delete_unknown_types.test.ts b/src/core/packages/core/server/integration_tests/saved_objects/routes/delete_unknown_types.test.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/routes/delete_unknown_types.test.ts rename to src/core/packages/core/server/integration_tests/saved_objects/routes/delete_unknown_types.test.ts diff --git a/src/core/server/integration_tests/saved_objects/routes/export.test.ts b/src/core/packages/core/server/integration_tests/saved_objects/routes/export.test.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/routes/export.test.ts rename to src/core/packages/core/server/integration_tests/saved_objects/routes/export.test.ts diff --git a/src/core/server/integration_tests/saved_objects/routes/find.test.ts b/src/core/packages/core/server/integration_tests/saved_objects/routes/find.test.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/routes/find.test.ts rename to src/core/packages/core/server/integration_tests/saved_objects/routes/find.test.ts diff --git a/src/core/server/integration_tests/saved_objects/routes/get.test.ts b/src/core/packages/core/server/integration_tests/saved_objects/routes/get.test.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/routes/get.test.ts rename to src/core/packages/core/server/integration_tests/saved_objects/routes/get.test.ts diff --git a/src/core/server/integration_tests/saved_objects/routes/import.test.ts b/src/core/packages/core/server/integration_tests/saved_objects/routes/import.test.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/routes/import.test.ts rename to src/core/packages/core/server/integration_tests/saved_objects/routes/import.test.ts diff --git a/src/core/server/integration_tests/saved_objects/routes/legacy_import_export/export.test.ts b/src/core/packages/core/server/integration_tests/saved_objects/routes/legacy_import_export/export.test.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/routes/legacy_import_export/export.test.ts rename to src/core/packages/core/server/integration_tests/saved_objects/routes/legacy_import_export/export.test.ts diff --git a/src/core/server/integration_tests/saved_objects/routes/legacy_import_export/import.test.ts b/src/core/packages/core/server/integration_tests/saved_objects/routes/legacy_import_export/import.test.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/routes/legacy_import_export/import.test.ts rename to src/core/packages/core/server/integration_tests/saved_objects/routes/legacy_import_export/import.test.ts diff --git a/src/core/server/integration_tests/saved_objects/routes/migrate.test.mocks.ts b/src/core/packages/core/server/integration_tests/saved_objects/routes/migrate.test.mocks.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/routes/migrate.test.mocks.ts rename to src/core/packages/core/server/integration_tests/saved_objects/routes/migrate.test.mocks.ts diff --git a/src/core/server/integration_tests/saved_objects/routes/migrate.test.ts b/src/core/packages/core/server/integration_tests/saved_objects/routes/migrate.test.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/routes/migrate.test.ts rename to src/core/packages/core/server/integration_tests/saved_objects/routes/migrate.test.ts diff --git a/src/core/server/integration_tests/saved_objects/routes/resolve.test.ts b/src/core/packages/core/server/integration_tests/saved_objects/routes/resolve.test.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/routes/resolve.test.ts rename to src/core/packages/core/server/integration_tests/saved_objects/routes/resolve.test.ts diff --git a/src/core/server/integration_tests/saved_objects/routes/resolve_import_errors.test.ts b/src/core/packages/core/server/integration_tests/saved_objects/routes/resolve_import_errors.test.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/routes/resolve_import_errors.test.ts rename to src/core/packages/core/server/integration_tests/saved_objects/routes/resolve_import_errors.test.ts diff --git a/src/core/server/integration_tests/saved_objects/routes/routes_test_utils.ts b/src/core/packages/core/server/integration_tests/saved_objects/routes/routes_test_utils.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/routes/routes_test_utils.ts rename to src/core/packages/core/server/integration_tests/saved_objects/routes/routes_test_utils.ts diff --git a/src/core/server/integration_tests/saved_objects/routes/update.test.ts b/src/core/packages/core/server/integration_tests/saved_objects/routes/update.test.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/routes/update.test.ts rename to src/core/packages/core/server/integration_tests/saved_objects/routes/update.test.ts diff --git a/src/core/server/integration_tests/saved_objects/serverless/migrations/actions.test.ts b/src/core/packages/core/server/integration_tests/saved_objects/serverless/migrations/actions.test.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/serverless/migrations/actions.test.ts rename to src/core/packages/core/server/integration_tests/saved_objects/serverless/migrations/actions.test.ts diff --git a/src/core/server/integration_tests/saved_objects/serverless/migrations/basic_document_migration.test.ts b/src/core/packages/core/server/integration_tests/saved_objects/serverless/migrations/basic_document_migration.test.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/serverless/migrations/basic_document_migration.test.ts rename to src/core/packages/core/server/integration_tests/saved_objects/serverless/migrations/basic_document_migration.test.ts diff --git a/src/core/packages/core/server/integration_tests/saved_objects/serverless/migrations/jest.integration.config.js b/src/core/packages/core/server/integration_tests/saved_objects/serverless/migrations/jest.integration.config.js new file mode 100644 index 0000000000000..e4d2f83fa2de6 --- /dev/null +++ b/src/core/packages/core/server/integration_tests/saved_objects/serverless/migrations/jest.integration.config.js @@ -0,0 +1,20 @@ +/* + * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +module.exports = { + // TODO replace the line below with + // preset: '@kbn/test/jest_integration_node + // to do so, we must fix all integration tests first + // see https://github.com/elastic/kibana/pull/130255/ + preset: '@kbn/test/jest_integration', + rootDir: '../../../../../../..', + roots: ['/src/core/packages/core/server/integration_tests/saved_objects/serverless/migrations'], + // must override to match all test given there is no `integration_tests` subfolder + testMatch: ['**/*.test.{js,mjs,ts,tsx}'], +}; diff --git a/src/core/server/integration_tests/saved_objects/serverless/migrations/smoke.test.ts b/src/core/packages/core/server/integration_tests/saved_objects/serverless/migrations/smoke.test.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/serverless/migrations/smoke.test.ts rename to src/core/packages/core/server/integration_tests/saved_objects/serverless/migrations/smoke.test.ts diff --git a/src/core/server/integration_tests/saved_objects/serverless/migrations/standard_workflow.test.ts b/src/core/packages/core/server/integration_tests/saved_objects/serverless/migrations/standard_workflow.test.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/serverless/migrations/standard_workflow.test.ts rename to src/core/packages/core/server/integration_tests/saved_objects/serverless/migrations/standard_workflow.test.ts diff --git a/src/core/server/integration_tests/saved_objects/service/lib/bulk_update.test.ts b/src/core/packages/core/server/integration_tests/saved_objects/service/lib/bulk_update.test.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/service/lib/bulk_update.test.ts rename to src/core/packages/core/server/integration_tests/saved_objects/service/lib/bulk_update.test.ts diff --git a/src/core/server/integration_tests/saved_objects/service/lib/repository.test.ts b/src/core/packages/core/server/integration_tests/saved_objects/service/lib/repository.test.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/service/lib/repository.test.ts rename to src/core/packages/core/server/integration_tests/saved_objects/service/lib/repository.test.ts diff --git a/src/core/server/integration_tests/saved_objects/service/lib/repository_with_proxy.test.ts b/src/core/packages/core/server/integration_tests/saved_objects/service/lib/repository_with_proxy.test.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/service/lib/repository_with_proxy.test.ts rename to src/core/packages/core/server/integration_tests/saved_objects/service/lib/repository_with_proxy.test.ts diff --git a/src/core/server/integration_tests/saved_objects/service/lib/repository_with_proxy_utils.ts b/src/core/packages/core/server/integration_tests/saved_objects/service/lib/repository_with_proxy_utils.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/service/lib/repository_with_proxy_utils.ts rename to src/core/packages/core/server/integration_tests/saved_objects/service/lib/repository_with_proxy_utils.ts diff --git a/src/core/server/integration_tests/saved_objects/service/lib/update.test.ts b/src/core/packages/core/server/integration_tests/saved_objects/service/lib/update.test.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/service/lib/update.test.ts rename to src/core/packages/core/server/integration_tests/saved_objects/service/lib/update.test.ts diff --git a/src/core/server/integration_tests/saved_objects/validation/validator.test.ts b/src/core/packages/core/server/integration_tests/saved_objects/validation/validator.test.ts similarity index 100% rename from src/core/server/integration_tests/saved_objects/validation/validator.test.ts rename to src/core/packages/core/server/integration_tests/saved_objects/validation/validator.test.ts diff --git a/src/core/packages/core/server/integration_tests/status/jest.integration.config.js b/src/core/packages/core/server/integration_tests/status/jest.integration.config.js new file mode 100644 index 0000000000000..735858a749107 --- /dev/null +++ b/src/core/packages/core/server/integration_tests/status/jest.integration.config.js @@ -0,0 +1,20 @@ +/* + * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +module.exports = { + // TODO replace the line below with + // preset: '@kbn/test/jest_integration_node + // to do so, we must fix all integration tests first + // see https://github.com/elastic/kibana/pull/130255/ + preset: '@kbn/test/jest_integration', + rootDir: '../../../../..', + roots: ['/src/core/packages/core/server/integration_tests/status'], + // must override to match all test given there is no `integration_tests` subfolder + testMatch: ['**/*.test.{js,mjs,ts,tsx}'], +}; diff --git a/src/core/server/integration_tests/status/routes/preboot_status.test.ts b/src/core/packages/core/server/integration_tests/status/routes/preboot_status.test.ts similarity index 100% rename from src/core/server/integration_tests/status/routes/preboot_status.test.ts rename to src/core/packages/core/server/integration_tests/status/routes/preboot_status.test.ts diff --git a/src/core/server/integration_tests/status/routes/status.test.ts b/src/core/packages/core/server/integration_tests/status/routes/status.test.ts similarity index 100% rename from src/core/server/integration_tests/status/routes/status.test.ts rename to src/core/packages/core/server/integration_tests/status/routes/status.test.ts diff --git a/src/core/server/integration_tests/ui_settings/create_or_upgrade.test.ts b/src/core/packages/core/server/integration_tests/ui_settings/create_or_upgrade.test.ts similarity index 100% rename from src/core/server/integration_tests/ui_settings/create_or_upgrade.test.ts rename to src/core/packages/core/server/integration_tests/ui_settings/create_or_upgrade.test.ts diff --git a/src/core/server/integration_tests/ui_settings/doc_exists.ts b/src/core/packages/core/server/integration_tests/ui_settings/doc_exists.ts similarity index 100% rename from src/core/server/integration_tests/ui_settings/doc_exists.ts rename to src/core/packages/core/server/integration_tests/ui_settings/doc_exists.ts diff --git a/src/core/server/integration_tests/ui_settings/doc_missing.ts b/src/core/packages/core/server/integration_tests/ui_settings/doc_missing.ts similarity index 100% rename from src/core/server/integration_tests/ui_settings/doc_missing.ts rename to src/core/packages/core/server/integration_tests/ui_settings/doc_missing.ts diff --git a/src/core/server/integration_tests/ui_settings/index.test.ts b/src/core/packages/core/server/integration_tests/ui_settings/index.test.ts similarity index 100% rename from src/core/server/integration_tests/ui_settings/index.test.ts rename to src/core/packages/core/server/integration_tests/ui_settings/index.test.ts diff --git a/src/core/packages/core/server/integration_tests/ui_settings/jest.integration.config.js b/src/core/packages/core/server/integration_tests/ui_settings/jest.integration.config.js new file mode 100644 index 0000000000000..7f97a6dcfe22b --- /dev/null +++ b/src/core/packages/core/server/integration_tests/ui_settings/jest.integration.config.js @@ -0,0 +1,20 @@ +/* + * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side + * Public License v 1"; you may not use this file except in compliance with, at + * your election, the "Elastic License 2.0", the "GNU Affero General Public + * License v3.0 only", or the "Server Side Public License, v 1". + */ + +module.exports = { + // TODO replace the line below with + // preset: '@kbn/test/jest_integration_node + // to do so, we must fix all integration tests first + // see https://github.com/elastic/kibana/pull/130255/ + preset: '@kbn/test/jest_integration', + rootDir: '../../../../..', + roots: ['/src/core/packages/core/server/integration_tests/ui_settings'], + // must override to match all test given there is no `integration_tests` subfolder + testMatch: ['**/*.test.{js,mjs,ts,tsx}'], +}; diff --git a/src/core/server/integration_tests/ui_settings/lib/chance.ts b/src/core/packages/core/server/integration_tests/ui_settings/lib/chance.ts similarity index 100% rename from src/core/server/integration_tests/ui_settings/lib/chance.ts rename to src/core/packages/core/server/integration_tests/ui_settings/lib/chance.ts diff --git a/src/core/server/integration_tests/ui_settings/lib/index.ts b/src/core/packages/core/server/integration_tests/ui_settings/lib/index.ts similarity index 100% rename from src/core/server/integration_tests/ui_settings/lib/index.ts rename to src/core/packages/core/server/integration_tests/ui_settings/lib/index.ts diff --git a/src/core/server/integration_tests/ui_settings/lib/servers.ts b/src/core/packages/core/server/integration_tests/ui_settings/lib/servers.ts similarity index 100% rename from src/core/server/integration_tests/ui_settings/lib/servers.ts rename to src/core/packages/core/server/integration_tests/ui_settings/lib/servers.ts diff --git a/src/core/server/integration_tests/ui_settings/routes.test.ts b/src/core/packages/core/server/integration_tests/ui_settings/routes.test.ts similarity index 100% rename from src/core/server/integration_tests/ui_settings/routes.test.ts rename to src/core/packages/core/server/integration_tests/ui_settings/routes.test.ts diff --git a/src/core/server/integration_tests/ui_settings/so_migrations.test.ts b/src/core/packages/core/server/integration_tests/ui_settings/so_migrations.test.ts similarity index 100% rename from src/core/server/integration_tests/ui_settings/so_migrations.test.ts rename to src/core/packages/core/server/integration_tests/ui_settings/so_migrations.test.ts diff --git a/src/core/server/jest.config.js b/src/core/packages/core/server/jest.config.js similarity index 91% rename from src/core/server/jest.config.js rename to src/core/packages/core/server/jest.config.js index 65b4cc8eb538e..7338421338932 100644 --- a/src/core/server/jest.config.js +++ b/src/core/packages/core/server/jest.config.js @@ -10,5 +10,5 @@ module.exports = { preset: '@kbn/test/jest_node', rootDir: '../../..', - roots: ['/src/core/server'], + roots: ['/src/core/packages/core/server'], }; diff --git a/src/core/server/mocks.ts b/src/core/packages/core/server/mocks.ts similarity index 100% rename from src/core/server/mocks.ts rename to src/core/packages/core/server/mocks.ts diff --git a/src/core/test_helpers/so_migrations.ts b/src/core/packages/core/test_helpers/so_migrations.ts similarity index 100% rename from src/core/test_helpers/so_migrations.ts rename to src/core/packages/core/test_helpers/so_migrations.ts diff --git a/src/core/test_helpers/strip_ansi_snapshot_serializer.ts b/src/core/packages/core/test_helpers/strip_ansi_snapshot_serializer.ts similarity index 100% rename from src/core/test_helpers/strip_ansi_snapshot_serializer.ts rename to src/core/packages/core/test_helpers/strip_ansi_snapshot_serializer.ts diff --git a/src/core/tsconfig.json b/src/core/packages/core/tsconfig.json similarity index 99% rename from src/core/tsconfig.json rename to src/core/packages/core/tsconfig.json index 92647e56fad82..06f2899190871 100644 --- a/src/core/tsconfig.json +++ b/src/core/packages/core/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig.base.json", + "extends": "../../../../tsconfig.base.json", "compilerOptions": { "outDir": "target/types", "isolatedModules": true, diff --git a/src/core/types/index.ts b/src/core/packages/core/types/index.ts similarity index 100% rename from src/core/types/index.ts rename to src/core/packages/core/types/index.ts diff --git a/src/core/server/integration_tests/execution_context/jest.integration.config.js b/src/core/server/integration_tests/execution_context/jest.integration.config.js deleted file mode 100644 index fe2aa71b352aa..0000000000000 --- a/src/core/server/integration_tests/execution_context/jest.integration.config.js +++ /dev/null @@ -1,20 +0,0 @@ -/* - * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -module.exports = { - // TODO replace the line below with - // preset: '@kbn/test/jest_integration_node - // to do so, we must fix all integration tests first - // see https://github.com/elastic/kibana/pull/130255/ - preset: '@kbn/test/jest_integration', - rootDir: '../../../../..', - roots: ['/src/core/server/integration_tests/execution_context'], - // must override to match all test given there is no `integration_tests` subfolder - testMatch: ['**/*.test.{js,mjs,ts,tsx}'], -}; diff --git a/src/core/server/integration_tests/http/jest.integration.config.js b/src/core/server/integration_tests/http/jest.integration.config.js deleted file mode 100644 index 79eeeb5100148..0000000000000 --- a/src/core/server/integration_tests/http/jest.integration.config.js +++ /dev/null @@ -1,20 +0,0 @@ -/* - * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -module.exports = { - // TODO replace the line below with - // preset: '@kbn/test/jest_integration_node - // to do so, we must fix all integration tests first - // see https://github.com/elastic/kibana/pull/130255/ - preset: '@kbn/test/jest_integration', - rootDir: '../../../../..', - roots: ['/src/core/server/integration_tests/http'], - // must override to match all test given there is no `integration_tests` subfolder - testMatch: ['**/*.test.{js,mjs,ts,tsx}'], -}; diff --git a/src/core/server/integration_tests/http_resources/jest.integration.config.js b/src/core/server/integration_tests/http_resources/jest.integration.config.js deleted file mode 100644 index b8311e901a5c2..0000000000000 --- a/src/core/server/integration_tests/http_resources/jest.integration.config.js +++ /dev/null @@ -1,20 +0,0 @@ -/* - * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -module.exports = { - // TODO replace the line below with - // preset: '@kbn/test/jest_integration_node - // to do so, we must fix all integration tests first - // see https://github.com/elastic/kibana/pull/130255/ - preset: '@kbn/test/jest_integration', - rootDir: '../../../../..', - roots: ['/src/core/server/integration_tests/http_resources'], - // must override to match all test given there is no `integration_tests` subfolder - testMatch: ['**/*.test.{js,mjs,ts,tsx}'], -}; diff --git a/src/core/server/integration_tests/logging/jest.integration.config.js b/src/core/server/integration_tests/logging/jest.integration.config.js deleted file mode 100644 index 49c88fa449976..0000000000000 --- a/src/core/server/integration_tests/logging/jest.integration.config.js +++ /dev/null @@ -1,20 +0,0 @@ -/* - * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -module.exports = { - // TODO replace the line below with - // preset: '@kbn/test/jest_integration_node - // to do so, we must fix all integration tests first - // see https://github.com/elastic/kibana/pull/130255/ - preset: '@kbn/test/jest_integration', - rootDir: '../../../../..', - roots: ['/src/core/server/integration_tests/logging'], - // must override to match all test given there is no `integration_tests` subfolder - testMatch: ['**/*.test.{js,mjs,ts,tsx}'], -}; diff --git a/src/core/server/integration_tests/metrics/jest.integration.config.js b/src/core/server/integration_tests/metrics/jest.integration.config.js deleted file mode 100644 index f410afeaee181..0000000000000 --- a/src/core/server/integration_tests/metrics/jest.integration.config.js +++ /dev/null @@ -1,20 +0,0 @@ -/* - * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -module.exports = { - // TODO replace the line below with - // preset: '@kbn/test/jest_integration_node - // to do so, we must fix all integration tests first - // see https://github.com/elastic/kibana/pull/130255/ - preset: '@kbn/test/jest_integration', - rootDir: '../../../../..', - roots: ['/src/core/server/integration_tests/metrics'], - // must override to match all test given there is no `integration_tests` subfolder - testMatch: ['**/*.test.{js,mjs,ts,tsx}'], -}; diff --git a/src/core/server/integration_tests/node/jest.integration.config.js b/src/core/server/integration_tests/node/jest.integration.config.js deleted file mode 100644 index 8382059917a6e..0000000000000 --- a/src/core/server/integration_tests/node/jest.integration.config.js +++ /dev/null @@ -1,20 +0,0 @@ -/* - * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -module.exports = { - // TODO replace the line below with - // preset: '@kbn/test/jest_integration_node - // to do so, we must fix all integration tests first - // see https://github.com/elastic/kibana/pull/130255/ - preset: '@kbn/test/jest_integration', - rootDir: '../../../../..', - roots: ['/src/core/server/integration_tests/node'], - // must override to match all test given there is no `integration_tests` subfolder - testMatch: ['**/*.test.{js,mjs,ts,tsx}'], -}; diff --git a/src/core/server/integration_tests/root/jest.integration.config.js b/src/core/server/integration_tests/root/jest.integration.config.js deleted file mode 100644 index 1d2933512b215..0000000000000 --- a/src/core/server/integration_tests/root/jest.integration.config.js +++ /dev/null @@ -1,20 +0,0 @@ -/* - * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -module.exports = { - // TODO replace the line below with - // preset: '@kbn/test/jest_integration_node - // to do so, we must fix all integration tests first - // see https://github.com/elastic/kibana/pull/130255/ - preset: '@kbn/test/jest_integration', - rootDir: '../../../../..', - roots: ['/src/core/server/integration_tests/root'], - // must override to match all test given there is no `integration_tests` subfolder - testMatch: ['**/*.test.{js,mjs,ts,tsx}'], -}; diff --git a/src/core/server/integration_tests/saved_objects/migrations/group5/jest.integration.config.js b/src/core/server/integration_tests/saved_objects/migrations/group5/jest.integration.config.js deleted file mode 100644 index ca1356038a831..0000000000000 --- a/src/core/server/integration_tests/saved_objects/migrations/group5/jest.integration.config.js +++ /dev/null @@ -1,20 +0,0 @@ -/* - * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -module.exports = { - // TODO replace the line below with - // preset: '@kbn/test/jest_integration_node - // to do so, we must fix all integration tests first - // see https://github.com/elastic/kibana/pull/130255/ - preset: '@kbn/test/jest_integration', - rootDir: '../../../../../../..', - roots: ['/src/core/server/integration_tests/saved_objects/migrations/group5'], - // must override to match all test given there is no `integration_tests` subfolder - testMatch: ['**/*.test.{js,mjs,ts,tsx}'], -}; diff --git a/src/core/server/integration_tests/saved_objects/migrations/group6/jest.integration.config.js b/src/core/server/integration_tests/saved_objects/migrations/group6/jest.integration.config.js deleted file mode 100644 index 7b38ce81c284b..0000000000000 --- a/src/core/server/integration_tests/saved_objects/migrations/group6/jest.integration.config.js +++ /dev/null @@ -1,20 +0,0 @@ -/* - * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -module.exports = { - // TODO replace the line below with - // preset: '@kbn/test/jest_integration_node - // to do so, we must fix all integration tests first - // see https://github.com/elastic/kibana/pull/130255/ - preset: '@kbn/test/jest_integration', - rootDir: '../../../../../../..', - roots: ['/src/core/server/integration_tests/saved_objects/migrations/group6'], - // must override to match all test given there is no `integration_tests` subfolder - testMatch: ['**/*.test.{js,mjs,ts,tsx}'], -}; diff --git a/src/core/server/integration_tests/saved_objects/migrations/zdt_1/jest.integration.config.js b/src/core/server/integration_tests/saved_objects/migrations/zdt_1/jest.integration.config.js deleted file mode 100644 index d242be2b90a7f..0000000000000 --- a/src/core/server/integration_tests/saved_objects/migrations/zdt_1/jest.integration.config.js +++ /dev/null @@ -1,20 +0,0 @@ -/* - * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -module.exports = { - // TODO replace the line below with - // preset: '@kbn/test/jest_integration_node - // to do so, we must fix all integration tests first - // see https://github.com/elastic/kibana/pull/130255/ - preset: '@kbn/test/jest_integration', - rootDir: '../../../../../../..', - roots: ['/src/core/server/integration_tests/saved_objects/migrations/zdt_1'], - // must override to match all test given there is no `integration_tests` subfolder - testMatch: ['**/*.test.{js,mjs,ts,tsx}'], -}; diff --git a/src/core/server/integration_tests/saved_objects/migrations/zdt_2/jest.integration.config.js b/src/core/server/integration_tests/saved_objects/migrations/zdt_2/jest.integration.config.js deleted file mode 100644 index 7cfea1ebcdcf6..0000000000000 --- a/src/core/server/integration_tests/saved_objects/migrations/zdt_2/jest.integration.config.js +++ /dev/null @@ -1,20 +0,0 @@ -/* - * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -module.exports = { - // TODO replace the line below with - // preset: '@kbn/test/jest_integration_node - // to do so, we must fix all integration tests first - // see https://github.com/elastic/kibana/pull/130255/ - preset: '@kbn/test/jest_integration', - rootDir: '../../../../../../..', - roots: ['/src/core/server/integration_tests/saved_objects/migrations/zdt_2'], - // must override to match all test given there is no `integration_tests` subfolder - testMatch: ['**/*.test.{js,mjs,ts,tsx}'], -}; diff --git a/src/core/server/integration_tests/saved_objects/migrations/zdt_v2_compat/jest.integration.config.js b/src/core/server/integration_tests/saved_objects/migrations/zdt_v2_compat/jest.integration.config.js deleted file mode 100644 index b316adc8b7f5f..0000000000000 --- a/src/core/server/integration_tests/saved_objects/migrations/zdt_v2_compat/jest.integration.config.js +++ /dev/null @@ -1,20 +0,0 @@ -/* - * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -module.exports = { - // TODO replace the line below with - // preset: '@kbn/test/jest_integration_node - // to do so, we must fix all integration tests first - // see https://github.com/elastic/kibana/pull/130255/ - preset: '@kbn/test/jest_integration', - rootDir: '../../../../../../..', - roots: ['/src/core/server/integration_tests/saved_objects/migrations/zdt_v2_compat'], - // must override to match all test given there is no `integration_tests` subfolder - testMatch: ['**/*.test.{js,mjs,ts,tsx}'], -}; diff --git a/src/core/server/integration_tests/saved_objects/serverless/migrations/jest.integration.config.js b/src/core/server/integration_tests/saved_objects/serverless/migrations/jest.integration.config.js deleted file mode 100644 index d79f0b6cfb679..0000000000000 --- a/src/core/server/integration_tests/saved_objects/serverless/migrations/jest.integration.config.js +++ /dev/null @@ -1,20 +0,0 @@ -/* - * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -module.exports = { - // TODO replace the line below with - // preset: '@kbn/test/jest_integration_node - // to do so, we must fix all integration tests first - // see https://github.com/elastic/kibana/pull/130255/ - preset: '@kbn/test/jest_integration', - rootDir: '../../../../../../..', - roots: ['/src/core/server/integration_tests/saved_objects/serverless/migrations'], - // must override to match all test given there is no `integration_tests` subfolder - testMatch: ['**/*.test.{js,mjs,ts,tsx}'], -}; diff --git a/src/core/server/integration_tests/status/jest.integration.config.js b/src/core/server/integration_tests/status/jest.integration.config.js deleted file mode 100644 index 53768e581cbcc..0000000000000 --- a/src/core/server/integration_tests/status/jest.integration.config.js +++ /dev/null @@ -1,20 +0,0 @@ -/* - * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -module.exports = { - // TODO replace the line below with - // preset: '@kbn/test/jest_integration_node - // to do so, we must fix all integration tests first - // see https://github.com/elastic/kibana/pull/130255/ - preset: '@kbn/test/jest_integration', - rootDir: '../../../../..', - roots: ['/src/core/server/integration_tests/status'], - // must override to match all test given there is no `integration_tests` subfolder - testMatch: ['**/*.test.{js,mjs,ts,tsx}'], -}; diff --git a/src/core/server/integration_tests/ui_settings/jest.integration.config.js b/src/core/server/integration_tests/ui_settings/jest.integration.config.js deleted file mode 100644 index 21458fcc9f144..0000000000000 --- a/src/core/server/integration_tests/ui_settings/jest.integration.config.js +++ /dev/null @@ -1,20 +0,0 @@ -/* - * 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", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -module.exports = { - // TODO replace the line below with - // preset: '@kbn/test/jest_integration_node - // to do so, we must fix all integration tests first - // see https://github.com/elastic/kibana/pull/130255/ - preset: '@kbn/test/jest_integration', - rootDir: '../../../../..', - roots: ['/src/core/server/integration_tests/ui_settings'], - // must override to match all test given there is no `integration_tests` subfolder - testMatch: ['**/*.test.{js,mjs,ts,tsx}'], -}; diff --git a/src/dev/build/tasks/package_json/find_used_dependencies.ts b/src/dev/build/tasks/package_json/find_used_dependencies.ts index 87540ecedf9cf..0581bcc0a9950 100644 --- a/src/dev/build/tasks/package_json/find_used_dependencies.ts +++ b/src/dev/build/tasks/package_json/find_used_dependencies.ts @@ -54,7 +54,7 @@ export async function findUsedDependencies( // main code entries 'src/cli*/dist.js', // core entry - 'src/core/server/index.js', + 'src/core/packages/core/server/index.js', // entries that are loaded into the server with dynamic require() calls 'src/plugins/vis_types/timelion/server/**/*.js', ], diff --git a/src/dev/precommit_hook/casing_check_config.js b/src/dev/precommit_hook/casing_check_config.js index 3d90324426247..72c3f0406f66c 100644 --- a/src/dev/precommit_hook/casing_check_config.js +++ b/src/dev/precommit_hook/casing_check_config.js @@ -163,18 +163,18 @@ export const REMOVE_EXTENSION = ['packages/kbn-plugin-generator/template/**/*.ej * @type {Array} */ export const TEMPORARILY_IGNORED_PATHS = [ - 'src/core/server/core_app/assets/favicons/android-chrome-192x192.png', - 'src/core/server/core_app/assets/favicons/android-chrome-256x256.png', - 'src/core/server/core_app/assets/favicons/android-chrome-512x512.png', - 'src/core/server/core_app/assets/favicons/apple-touch-icon.png', - 'src/core/server/core_app/assets/favicons/favicon-16x16.png', - 'src/core/server/core_app/assets/favicons/favicon-32x32.png', - 'src/core/server/core_app/assets/favicons/mstile-70x70.png', - 'src/core/server/core_app/assets/favicons/mstile-144x144.png', - 'src/core/server/core_app/assets/favicons/mstile-150x150.png', - 'src/core/server/core_app/assets/favicons/mstile-310x150.png', - 'src/core/server/core_app/assets/favicons/mstile-310x310.png', - 'src/core/server/core_app/assets/favicons/safari-pinned-tab.svg', + 'src/core/packages/core/server/core_app/assets/favicons/android-chrome-192x192.png', + 'src/core/packages/core/server/core_app/assets/favicons/android-chrome-256x256.png', + 'src/core/packages/core/server/core_app/assets/favicons/android-chrome-512x512.png', + 'src/core/packages/core/server/core_app/assets/favicons/apple-touch-icon.png', + 'src/core/packages/core/server/core_app/assets/favicons/favicon-16x16.png', + 'src/core/packages/core/server/core_app/assets/favicons/favicon-32x32.png', + 'src/core/packages/core/server/core_app/assets/favicons/mstile-70x70.png', + 'src/core/packages/core/server/core_app/assets/favicons/mstile-144x144.png', + 'src/core/packages/core/server/core_app/assets/favicons/mstile-150x150.png', + 'src/core/packages/core/server/core_app/assets/favicons/mstile-310x150.png', + 'src/core/packages/core/server/core_app/assets/favicons/mstile-310x310.png', + 'src/core/packages/core/server/core_app/assets/favicons/safari-pinned-tab.svg', 'test/functional/apps/management/exports/_import_objects-conflicts.json', 'x-pack/legacy/platform/plugins/shared/index_management/public/lib/editSettings.js', 'x-pack/legacy/platform/plugins/shared/license_management/public/store/reducers/licenseManagement.js', diff --git a/src/platform/packages/shared/kbn-securitysolution-es-utils/src/decode_version/index.ts b/src/platform/packages/shared/kbn-securitysolution-es-utils/src/decode_version/index.ts index 639cb4233308f..65718c3fe40cd 100644 --- a/src/platform/packages/shared/kbn-securitysolution-es-utils/src/decode_version/index.ts +++ b/src/platform/packages/shared/kbn-securitysolution-es-utils/src/decode_version/index.ts @@ -7,7 +7,7 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -// Similar to the src/core/server/saved_objects/version/decode_version.ts +// Similar to the src/core/packages/core/server/saved_objects/version/decode_version.ts // with the notable differences in that it is more tolerant and does not throw saved object specific errors // but rather just returns an empty object if it cannot parse the version or cannot find one. export const decodeVersion = ( diff --git a/src/platform/packages/shared/kbn-securitysolution-es-utils/src/elasticsearch_client/index.ts b/src/platform/packages/shared/kbn-securitysolution-es-utils/src/elasticsearch_client/index.ts index f403b4a442b92..00ea3890b8fdf 100644 --- a/src/platform/packages/shared/kbn-securitysolution-es-utils/src/elasticsearch_client/index.ts +++ b/src/platform/packages/shared/kbn-securitysolution-es-utils/src/elasticsearch_client/index.ts @@ -7,14 +7,14 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -// Copied from src/core/server/elasticsearch/client/types.ts +// Copied from src/core/packages/core/server/elasticsearch/client/types.ts // as these types aren't part of any package yet. Once they are, remove this completely import type { Client } from '@elastic/elasticsearch'; /** * Client used to query the elasticsearch cluster. - * @deprecated At some point use the one from src/core/server/elasticsearch/client/types.ts when it is made into a package. If it never is, then keep using this one. + * @deprecated At some point use the one from src/core/packages/core/server/elasticsearch/client/types.ts when it is made into a package. If it never is, then keep using this one. * @public */ export type ElasticsearchClient = Omit< diff --git a/src/platform/packages/shared/kbn-securitysolution-es-utils/src/encode_hit_version/index.ts b/src/platform/packages/shared/kbn-securitysolution-es-utils/src/encode_hit_version/index.ts index 1e967972add37..280f09f1c80a9 100644 --- a/src/platform/packages/shared/kbn-securitysolution-es-utils/src/encode_hit_version/index.ts +++ b/src/platform/packages/shared/kbn-securitysolution-es-utils/src/encode_hit_version/index.ts @@ -9,7 +9,7 @@ /** * Very similar to the encode_hit_version from saved object system from here: - * src/core/server/saved_objects/version/encode_hit_version.ts + * src/core/packages/core/server/saved_objects/version/encode_hit_version.ts * * with the most notably change is that it doesn't do any throws but rather just returns undefined * if _seq_no or _primary_term does not exist. diff --git a/src/plugins/dashboard/public/dashboard_app/_dashboard_app.scss b/src/plugins/dashboard/public/dashboard_app/_dashboard_app.scss index c89337d29e720..ce8676d1f2e05 100644 --- a/src/plugins/dashboard/public/dashboard_app/_dashboard_app.scss +++ b/src/plugins/dashboard/public/dashboard_app/_dashboard_app.scss @@ -1,4 +1,4 @@ -@import 'src/core/public/mixins'; +@import 'src/core/packages/core/public/mixins'; .dshUnsavedListingItem { margin-top: $euiSizeM; diff --git a/src/plugins/kibana_usage_collection/server/collectors/config_usage/README.md b/src/plugins/kibana_usage_collection/server/collectors/config_usage/README.md index 954b12dba00f7..09f686ce3837d 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/config_usage/README.md +++ b/src/plugins/kibana_usage_collection/server/collectors/config_usage/README.md @@ -6,7 +6,7 @@ All non-default configs except booleans and numbers will be reported as `[redact ```ts import { schema, TypeOf } from '@kbn/config-schema'; -import { PluginConfigDescriptor } from 'src/core/server'; +import { PluginConfigDescriptor } from 'src/core/packages/core/server'; export const configSchema = schema.object({ usageCounters: schema.object({ @@ -60,4 +60,4 @@ when setting an exact config or its parent path to `false`. } ``` -Note that arrays of objects will be reported as `[redacted]` and cannot be explicitly marked as safe. \ No newline at end of file +Note that arrays of objects will be reported as `[redacted]` and cannot be explicitly marked as safe. diff --git a/src/plugins/usage_collection/README.mdx b/src/plugins/usage_collection/README.mdx index d755c9615327e..7451d43d2aafb 100644 --- a/src/plugins/usage_collection/README.mdx +++ b/src/plugins/usage_collection/README.mdx @@ -231,7 +231,7 @@ In many cases, plugins need to report the custom usage of a feature. In this cas ```ts // server/plugin.ts import { UsageCollectionSetup } from 'src/plugins/usage_collection/server'; - import { Plugin, CoreSetup, CoreStart } from 'src/core/server'; + import { Plugin, CoreSetup, CoreStart } from 'src/core/packages/core/server'; class MyPlugin implements Plugin { public setup(core: CoreSetup, plugins: { usageCollection?: UsageCollectionSetup }) { @@ -408,7 +408,7 @@ for structuring your plugin code. ```ts // src/plugins/dashboard/server/plugin.ts -import { PluginInitializerContext, Plugin, CoreStart, CoreSetup } from '../../src/core/server'; +import { PluginInitializerContext, Plugin, CoreStart, CoreSetup } from '../../src/core/packages/core/server'; export class DashboardPlugin implements Plugin { private readonly logger: Logger; @@ -497,9 +497,9 @@ There are a few ways you can test that your usage collector is working properly. ## FAQ -1. **How should I design my data model?** +1. **How should I design my data model?** Keep it simple, and keep it to a model that Kibana will be able to understand. Bear in mind the number of keys you are reporting as it may result in fields mapping explosion. Flat arrays, such as arrays of strings are fine. -2. **If I accumulate an event counter in server memory, which my fetch method returns, won't it reset when the Kibana server restarts?** +2. **If I accumulate an event counter in server memory, which my fetch method returns, won't it reset when the Kibana server restarts?** Yes, but that is not a major concern. A visualization on such info might be a date histogram that gets events-per-second or something, which would be impacted by server restarts, so we'll have to offset the beginning of the time range when we detect that the latest metric is smaller than the earliest metric. That would be a pretty custom visualization, but perhaps future Kibana enhancements will be able to support that. # Routes registered by this plugin diff --git a/test/functional/page_objects/home_page.ts b/test/functional/page_objects/home_page.ts index 4bdf99a9b7b35..86cad058679f7 100644 --- a/test/functional/page_objects/home_page.ts +++ b/test/functional/page_objects/home_page.ts @@ -58,7 +58,7 @@ export class HomePageObject extends FtrService { } async isWelcomeInterstitialDisplayed() { - // This element inherits style defined {@link https://github.com/elastic/kibana/blob/v8.14.3/src/core/public/styles/core_app/_mixins.scss#L72|here} + // This element inherits style defined {@link https://github.com/elastic/kibana/blob/v8.14.3/src/core/packages/core/public/styles/core_app/_mixins.scss#L72|here} // with an animation duration set to $euiAnimSpeedExtraSlow {@see https://eui.elastic.co/#/theming/more-tokens#animation}, // hence we setup a delay so the interstitial has enough time to fade in const animSpeedExtraSlow = 500; diff --git a/tsconfig.base.json b/tsconfig.base.json index 84c8cb68d811a..a8392c4739217 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -230,8 +230,8 @@ "@kbn/controls-example-plugin/*": ["examples/controls_example/*"], "@kbn/controls-plugin": ["src/plugins/controls"], "@kbn/controls-plugin/*": ["src/plugins/controls/*"], - "@kbn/core": ["src/core"], - "@kbn/core/*": ["src/core/*"], + "@kbn/core": ["src/core/packages/core"], + "@kbn/core/*": ["src/core/packages/core/*"], "@kbn/core-analytics-browser": ["packages/core/analytics/core-analytics-browser"], "@kbn/core-analytics-browser/*": ["packages/core/analytics/core-analytics-browser/*"], "@kbn/core-analytics-browser-internal": ["packages/core/analytics/core-analytics-browser-internal"], diff --git a/x-pack/platform/plugins/private/painless_lab/public/styles/_index.scss b/x-pack/platform/plugins/private/painless_lab/public/styles/_index.scss index 69c5c9a0c344d..5e1570bcc3eb0 100644 --- a/x-pack/platform/plugins/private/painless_lab/public/styles/_index.scss +++ b/x-pack/platform/plugins/private/painless_lab/public/styles/_index.scss @@ -1,4 +1,4 @@ -@import '../../../../../../../src/core/public/mixins'; +@import '../../../../../../../src/core/packages/core/public/mixins'; /** * This is a very brittle way of preventing the editor and other content from disappearing diff --git a/x-pack/platform/plugins/private/runtime_fields/README.md b/x-pack/platform/plugins/private/runtime_fields/README.md index c4e657fdb3b44..84f418b68be44 100644 --- a/x-pack/platform/plugins/private/runtime_fields/README.md +++ b/x-pack/platform/plugins/private/runtime_fields/README.md @@ -150,7 +150,7 @@ As an alternative you can open the flyout with the `openFlyout()` helper from co ```js import React, { useRef } from 'react'; import { EuiButton } from '@elastic/eui'; -import { OverlayRef } from 'src/core/public'; +import { OverlayRef } from 'src/core/packages/core/public'; import { createKibanaReactContext, toMountPoint } from '../../../../src/plugins/kibana_react/public'; import { RuntimeFieldEditorFlyoutContent, RuntimeField } from '../runtime_fields/public'; diff --git a/x-pack/platform/plugins/shared/screenshotting/README.md b/x-pack/platform/plugins/shared/screenshotting/README.md index b129bbb5ad9a1..366a41fbd1aef 100644 --- a/x-pack/platform/plugins/shared/screenshotting/README.md +++ b/x-pack/platform/plugins/shared/screenshotting/README.md @@ -23,7 +23,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 { CoreSetup, Plugin } from 'src/core/packages/core/server'; import type { ScreenshottingStart } from 'x-pack/platform/plugins/shared/screenshotting/server'; @@ -103,11 +103,11 @@ There is a way to override some Chromium command line arguments using the `flags ### Configuration Option | Default | Description --- | --- | --- -`xpack.screenshotting.networkPolicy.enabled` | `true` | Capturing a screenshot from a Kibana page involves sending out requests for all the linked web assets. For example, a Markdown visualization can show an image from a remote server. +`xpack.screenshotting.networkPolicy.enabled` | `true` | Capturing a screenshot from a Kibana page involves sending out requests for all the linked web assets. For example, a Markdown visualization can show an image from a remote server. `xpack.screenshotting.networkPolicy.rules` | Allow http, https, ws, wss, and data. | A policy is specified as an array of objects that describe what to allow or deny based on a host or protocol. If a host or protocol is not specified, the rule matches any host or protocol. `xpack.screenshotting.browser.autoDownload` | Depends on the `dist` parameter. | Flag to automatically download chromium distribution. `xpack.screenshotting.browser.chromium.disableSandbox` | Defaults to `false` for all operating systems except Debian and Red Hat Linux, which use `true`. | It is recommended that you research the feasibility of enabling unprivileged user namespaces. An exception is if you are running Kibana in Docker because the container runs in a user namespace with the built-in seccomp/bpf filters. For more information, refer to [Chromium sandbox](https://chromium.googlesource.com/chromium/src/+/HEAD/docs/linux/sandboxing.md). -`xpack.screenshotting.browser.chromium.proxy.enabled` | `false` | Enables the proxy for Chromium to use. +`xpack.screenshotting.browser.chromium.proxy.enabled` | `false` | Enables the proxy for Chromium to use. `xpack.screenshotting.browser.chromium.proxy.server` | _none_ | The uri for the proxy server. Providing the username and password for the proxy server via the uri is not supported. `xpack.screenshotting.browser.chromium.proxy.bypass` | `[]` | An array of hosts that should not go through the proxy server and should use a direct connection instead. Examples of valid entries are "elastic.co", "*.elastic.co", ".elastic.co", ".elastic.co:5601". diff --git a/x-pack/platform/plugins/shared/searchprofiler/public/application/_app.scss b/x-pack/platform/plugins/shared/searchprofiler/public/application/_app.scss index 22bea38e0ccff..0c84711246af2 100644 --- a/x-pack/platform/plugins/shared/searchprofiler/public/application/_app.scss +++ b/x-pack/platform/plugins/shared/searchprofiler/public/application/_app.scss @@ -1,4 +1,4 @@ -@import '../../../../../../../src/core/public/mixins'; +@import '../../../../../../../src/core/packages/core/public/mixins'; .prfDevTool__page { flex: 1 1 auto; diff --git a/x-pack/plugins/actions/server/lib/get_custom_agents.ts b/x-pack/plugins/actions/server/lib/get_custom_agents.ts index c433bec18a54b..e9d664e40b5cb 100644 --- a/x-pack/plugins/actions/server/lib/get_custom_agents.ts +++ b/x-pack/plugins/actions/server/lib/get_custom_agents.ts @@ -60,7 +60,7 @@ export function getCustomAgents( } const sslSettingsFromConfig = getSSLSettingsFromConfig(sslSettings.verificationMode); - // see: src/core/server/elasticsearch/legacy/elasticsearch_client_config.ts + // see: src/core/packages/core/server/elasticsearch/legacy/elasticsearch_client_config.ts // This is where the global rejectUnauthorized is overridden by a custom host const customHostNodeSSLOptions = getNodeSSLOptions( logger, diff --git a/x-pack/plugins/actions/server/lib/get_node_ssl_options.ts b/x-pack/plugins/actions/server/lib/get_node_ssl_options.ts index d01b665d6b304..f1176985875d1 100644 --- a/x-pack/plugins/actions/server/lib/get_node_ssl_options.ts +++ b/x-pack/plugins/actions/server/lib/get_node_ssl_options.ts @@ -49,7 +49,7 @@ export function getNodeSSLOptions( agentOptions.rejectUnauthorized = true; } } - // see: src/core/server/elasticsearch/legacy/elasticsearch_client_config.ts + // see: src/core/packages/core/server/elasticsearch/legacy/elasticsearch_client_config.ts // This is where the global rejectUnauthorized is overridden by a custom host } if (sslOverrides) { diff --git a/x-pack/plugins/canvas/PLUGINS.mdx b/x-pack/plugins/canvas/PLUGINS.mdx index c0e0bc9c92f5a..e67c09423f696 100644 --- a/x-pack/plugins/canvas/PLUGINS.mdx +++ b/x-pack/plugins/canvas/PLUGINS.mdx @@ -60,7 +60,7 @@ In your plugin folder, create a new folder `public` and an `index.ts` file withi This `index.ts` will need export a Kibana Plugin. You can use this as a starting point for your plugin. ```typescript -import { Plugin, CoreSetup, CoreStart } from '../../../src/core/public'; +import { Plugin, CoreSetup, CoreStart } from '../../../src/core/packages/core/public'; import { CanvasSetup } from '../../../x-pack/plugins/canvas/public'; interface CanvasExampleSetupPlugins { @@ -171,7 +171,7 @@ Now, much like we made the client plugin, we'll make a server plugin. Start by making the `server` directory and an `index.ts` file with a shell for your server plugin: ```typescript -import { Plugin, CoreSetup, CoreStart } from '../../../src/core/server'; +import { Plugin, CoreSetup, CoreStart } from '../../../src/core/packages/core/server'; import { ExpressionsServerSetup } from '../../../src/plugins/expressions/server'; interface CanvasExamplePluginsSetup { diff --git a/x-pack/plugins/canvas/shareable_runtime/webpack.config.js b/x-pack/plugins/canvas/shareable_runtime/webpack.config.js index a2ed32fe77573..891d0c7deb682 100644 --- a/x-pack/plugins/canvas/shareable_runtime/webpack.config.js +++ b/x-pack/plugins/canvas/shareable_runtime/webpack.config.js @@ -34,7 +34,7 @@ module.exports = { }, resolve: { alias: { - core_app_image_assets: path.resolve(KIBANA_ROOT, 'src/core/public/styles/core_app/images'), + core_app_image_assets: path.resolve(KIBANA_ROOT, 'src/core/packages/core/public/styles/core_app/images'), }, extensions: ['.js', '.json', '.ts', '.tsx', '.scss'], mainFields: ['browser', 'main'], @@ -162,7 +162,7 @@ module.exports = { additionalData(content, loaderContext) { return `@import ${stringifyRequest( loaderContext, - path.resolve(KIBANA_ROOT, 'src/core/public/styles/core_app/_globals_v8light.scss') + path.resolve(KIBANA_ROOT, 'src/core/packages/core/public/styles/core_app/_globals_v8light.scss') )};\n${content}`; }, implementation: require('sass-embedded'), diff --git a/x-pack/plugins/enterprise_search/public/applications/shared/kibana_chrome/set_chrome.tsx b/x-pack/plugins/enterprise_search/public/applications/shared/kibana_chrome/set_chrome.tsx index c556213ec8b42..47633770f84a0 100644 --- a/x-pack/plugins/enterprise_search/public/applications/shared/kibana_chrome/set_chrome.tsx +++ b/x-pack/plugins/enterprise_search/public/applications/shared/kibana_chrome/set_chrome.tsx @@ -44,7 +44,7 @@ import { /** * Helpers for setting Kibana chrome (breadcrumbs, doc titles) on React view mount - * @see https://github.com/elastic/kibana/blob/main/src/core/public/chrome/chrome_service.tsx + * @see https://github.com/elastic/kibana/blob/main/src/core/packages/core/public/chrome/chrome_service.tsx * * Example usage (don't forget to i18n.translate() page titles!): * diff --git a/x-pack/plugins/enterprise_search/server/collectors/lib/telemetry.ts b/x-pack/plugins/enterprise_search/server/collectors/lib/telemetry.ts index 37c2c2a5c7154..d0a90014c0ccc 100644 --- a/x-pack/plugins/enterprise_search/server/collectors/lib/telemetry.ts +++ b/x-pack/plugins/enterprise_search/server/collectors/lib/telemetry.ts @@ -12,7 +12,7 @@ import { Logger, } from '@kbn/core/server'; -// This throws `Error: Cannot find module 'src/core/server'` if I import it via alias ¯\_(ツ)_/¯ +// This throws `Error: Cannot find module 'src/core/packages/core/server'` if I import it via alias ¯\_(ツ)_/¯ import { SavedObjectsErrorHelpers } from '@kbn/core/server'; /** diff --git a/x-pack/plugins/maps/public/_main.scss b/x-pack/plugins/maps/public/_main.scss index 02298872d4f7d..e653a0af61521 100644 --- a/x-pack/plugins/maps/public/_main.scss +++ b/x-pack/plugins/maps/public/_main.scss @@ -1,4 +1,4 @@ -@import '../../../../src/core/public/mixins'; +@import '../../../../src/core/packages/core/public/mixins'; // sass-lint:disable no-ids #maps-plugin { diff --git a/x-pack/plugins/monitoring/dev_docs/reference/data_collection_modes.md b/x-pack/plugins/monitoring/dev_docs/reference/data_collection_modes.md index ea585fda0306e..f02f5143784a2 100644 --- a/x-pack/plugins/monitoring/dev_docs/reference/data_collection_modes.md +++ b/x-pack/plugins/monitoring/dev_docs/reference/data_collection_modes.md @@ -10,7 +10,7 @@ And two log collection modes: - Planned future standard: [Package-driven collection](#package-driven-collection) > **Note**: In the following sections "Beats" is used to refer to any stack component based on libbeat because the data collection modes are the same for any process in this group. This notably includes apm-server and fleet server. - + ## Metrics collection ### Internal collection @@ -35,11 +35,11 @@ subgraph Kibana Collectors-.->|poll|Metrics[OS, Cgroups, etc] Collectors-.->|update|OpsMetricsObservable BulkUploader-.->|observe|OpsMetricsObservable - - click Collectors "https://github.com/elastic/kibana/tree/main/src/core/server/metrics/collectors" - click OpsMetricsObservable "https://github.com/elastic/kibana/blob/92a8636f0ff63ab072527574e96e6616327b2ea4/src/core/server/metrics/metrics_service.ts#L32" + + click Collectors "https://github.com/elastic/kibana/tree/main/src/core/packages/core/server/metrics/collectors" + click OpsMetricsObservable "https://github.com/elastic/kibana/blob/92a8636f0ff63ab072527574e96e6616327b2ea4/src/core/packages/core/server/metrics/metrics_service.ts#L32" click BulkUploader "https://github.com/elastic/kibana/blob/main/x-pack/plugins/monitoring/server/kibana_monitoring/bulk_uploader.ts" -end +end BulkUploader-->|/_monitoring/bulk|ProdElasticsearch ProdElasticsearch-->|/_bulk|MonElasticsearch @@ -109,7 +109,7 @@ Regardless of the metrics collection mode, logs should always be collected using - [Elasticsearch](https://github.com/elastic/beats/tree/main/filebeat/module/elasticsearch) - [Kibana](https://github.com/elastic/beats/tree/main/filebeat/module/kibana) - [Logstash](https://github.com/elastic/beats/tree/main/filebeat/module/logstash) - + Stack Monitoring will read those same logs, as configured by the `monitoring.ui.logs.index` setting. For example, in the case of the elasticsearch filebeat module reading slow query logs and writing to the corresponding pipeline on Elasticsearch: @@ -137,7 +137,7 @@ ElasticsearchModule-.->|read|Disk ElasticsearchModule-->|/_bulk|Pipeline ``` -Enterprise Search doesn't have a filebeat module, but the logs can be ingested using the configuration found at https://github.com/elastic/ent-search-monitoring/blob/main/filebeat/filebeat.yml +Enterprise Search doesn't have a filebeat module, but the logs can be ingested using the configuration found at https://github.com/elastic/ent-search-monitoring/blob/main/filebeat/filebeat.yml Beats also doesn't have filebeat module or recommended configuration, but the logs can be ingested using a basic JSON filebeat configuration. @@ -177,7 +177,7 @@ subgraph Monitoring Deployment EsPackage((ES Package))-->|install|Kibana FleetServer[Fleet Server]-->|read policies|Kibana Kibana-->|templates, dashboards, etc.|Elasticsearch - + click EsPackage "https://github.com/elastic/integrations/tree/main/packages/elasticsearch" click FleetServer "https://github.com/elastic/fleet-server" end diff --git a/x-pack/plugins/monitoring/server/deprecations.ts b/x-pack/plugins/monitoring/server/deprecations.ts index 7811d21713319..fc6cba3831029 100644 --- a/x-pack/plugins/monitoring/server/deprecations.ts +++ b/x-pack/plugins/monitoring/server/deprecations.ts @@ -85,6 +85,6 @@ export const deprecations = ({ // vice versa. // ^ These deprecations should only be shown if they are explicitly configured for monitoring -- we should not show Monitoring // deprecations for these settings if they are inherited from the Core elasticsearch settings. - // See the Core implementation: src/core/server/elasticsearch/elasticsearch_config.ts + // See the Core implementation: src/core/packages/core/server/elasticsearch/elasticsearch_config.ts ]; }; diff --git a/x-pack/plugins/spaces/server/lib/utils/url.test.ts b/x-pack/plugins/spaces/server/lib/utils/url.test.ts index 525e93954402a..61fb04ba5232c 100644 --- a/x-pack/plugins/spaces/server/lib/utils/url.test.ts +++ b/x-pack/plugins/spaces/server/lib/utils/url.test.ts @@ -7,7 +7,7 @@ // TEMPORARY UNTIL FIXED! // DIRECT COPY FROM `src/core/utils/url`, since it's not possible to import from there, -// nor can I re-export from `src/core/server`... +// nor can I re-export from `src/core/packages/core/server`... import { modifyUrl } from './url'; diff --git a/x-pack/plugins/spaces/server/lib/utils/url.ts b/x-pack/plugins/spaces/server/lib/utils/url.ts index 2e434fe0de6f9..bf3c53d67a84d 100644 --- a/x-pack/plugins/spaces/server/lib/utils/url.ts +++ b/x-pack/plugins/spaces/server/lib/utils/url.ts @@ -7,7 +7,7 @@ // TEMPORARY UNTIL FIXED! // DIRECT COPY FROM `src/core/utils/url`, since it's not possible to import from there, -// nor can I re-export from `src/core/server`... +// nor can I re-export from `src/core/packages/core/server`... import type { ParsedQuery } from 'query-string'; import type { UrlObject } from 'url'; diff --git a/x-pack/plugins/stack_connectors/server/connector_types/lib/result_type.ts b/x-pack/plugins/stack_connectors/server/connector_types/lib/result_type.ts index 5e2c19aca9313..d9c02e77c3be8 100644 --- a/x-pack/plugins/stack_connectors/server/connector_types/lib/result_type.ts +++ b/x-pack/plugins/stack_connectors/server/connector_types/lib/result_type.ts @@ -5,7 +5,7 @@ * 2.0. */ -// There appears to be an unexported implementation of Either in here: src/core/server/saved_objects/service/lib/repository.ts +// There appears to be an unexported implementation of Either in here: src/core/packages/core/server/saved_objects/service/lib/repository.ts // Which is basically the Haskel equivalent of Rust/ML/Scala's Result // I'll reach out to other's in Kibana to see if we can merge these into one type diff --git a/x-pack/plugins/upgrade_assistant/README.md b/x-pack/plugins/upgrade_assistant/README.md index 39bebc15e44b1..7fdf75165a3d9 100644 --- a/x-pack/plugins/upgrade_assistant/README.md +++ b/x-pack/plugins/upgrade_assistant/README.md @@ -29,7 +29,7 @@ These surface runtime deprecations, e.g. a Painless script that uses a deprecate request to a deprecated API. These are also generally surfaced as deprecation headers within the response. Even if the cluster state is good, app maintainers need to watch the logs in case deprecations are discovered as data is migrated. Starting in 7.x, deprecation logs can be written to a file or a data stream ([#58924](https://github.com/elastic/elasticsearch/pull/58924)). When the data stream exists, the Upgrade Assistant provides a way to analyze the logs through Observability or Discover ([#106521](https://github.com/elastic/kibana/pull/106521)). -* [**Kibana deprecations API.**](https://github.com/elastic/kibana/blob/main/src/core/server/docs/kib_core_deprecations_service.mdx) This is information about deprecated features and configs in Kibana. These deprecations are only communicated to the user if the deployment is using these features. Kibana engineers are responsible for adding deprecations to the deprecations API for their respective team. +* [**Kibana deprecations API.**](https://github.com/elastic/kibana/blob/main/src/core/packages/core/server/docs/kib_core_deprecations_service.mdx) This is information about deprecated features and configs in Kibana. These deprecations are only communicated to the user if the deployment is using these features. Kibana engineers are responsible for adding deprecations to the deprecations API for their respective team. ### Fixing problems diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/field_value_lists/index.test.tsx b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/field_value_lists/index.test.tsx index 30323eba26855..09990fda1be72 100644 --- a/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/field_value_lists/index.test.tsx +++ b/x-pack/solutions/security/packages/kbn-securitysolution-autocomplete/src/field_value_lists/index.test.tsx @@ -23,7 +23,7 @@ import { // TODO: Once these mocks are available, use them instead of hand mocking, https://github.com/elastic/kibana/issues/100715 // const mockKibanaHttpService = coreMock.createStart().http; -// import { coreMock } from '../../../../../../../../../../src/core/public/mocks'; +// import { coreMock } from '../../../../../../../../../../src/core/packages/core/public/mocks'; const mockKibanaHttpService = jest.fn(); const mockShowValueListModal = jest.fn(); const MockedShowValueListModal = (props: unknown) => { diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/saved_object_attributes/index.ts b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/saved_object_attributes/index.ts index 33db222f098e1..73f4e4ab635fc 100644 --- a/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/saved_object_attributes/index.ts +++ b/x-pack/solutions/security/packages/kbn-securitysolution-io-ts-alerting-types/src/saved_object_attributes/index.ts @@ -10,7 +10,7 @@ import * as t from 'io-ts'; /** - * TODO: This type are originally from "src/core/types/saved_objects.ts", once that is package friendly remove + * TODO: This type are originally from "src/core/packages/core/types/saved_objects.ts", once that is package friendly remove * this copied type. * * Don't use this type, it's simply a helper type for {@link SavedObjectAttribute} @@ -26,7 +26,7 @@ export type SavedObjectAttributeSingle = | SavedObjectAttributes; /** - * TODO: This type are originally from "src/core/types/saved_objects.ts", once that is package friendly remove + * TODO: This type are originally from "src/core/packages/core/types/saved_objects.ts", once that is package friendly remove * this copied type. * * Type definition for a Saved Object attribute value @@ -36,7 +36,7 @@ export type SavedObjectAttributeSingle = export type SavedObjectAttribute = SavedObjectAttributeSingle | SavedObjectAttributeSingle[]; /** - * TODO: This type are originally from "src/core/types/saved_objects.ts", once that is package friendly remove + * TODO: This type are originally from "src/core/packages/core/types/saved_objects.ts", once that is package friendly remove * this copied type. * * The data for a Saved Object is stored as an object in the `attributes` diff --git a/x-pack/solutions/security/packages/kbn-securitysolution-list-api/src/types.ts b/x-pack/solutions/security/packages/kbn-securitysolution-list-api/src/types.ts index 54aa89936d73c..0e70afcd2bb1f 100644 --- a/x-pack/solutions/security/packages/kbn-securitysolution-list-api/src/types.ts +++ b/x-pack/solutions/security/packages/kbn-securitysolution-list-api/src/types.ts @@ -15,7 +15,7 @@ import type { // TODO: Replace these with kbn packaged versions once we have those available to us // These originally came from this location below before moving them to this hacked "any" types: -// import { HttpStart, NotificationsStart } from '../../../../../../../../src/core/public'; +// import { HttpStart, NotificationsStart } from '../../../../../../../../src/core/packages/core/public'; interface HttpStart { // eslint-disable-next-line @typescript-eslint/no-explicit-any fetch: (...args: any) => any; diff --git a/x-pack/solutions/security/plugins/lists/server/routes/utils/build_siem_response.ts b/x-pack/solutions/security/plugins/lists/server/routes/utils/build_siem_response.ts index dbf15b1faa5f4..6c16772d55766 100644 --- a/x-pack/solutions/security/plugins/lists/server/routes/utils/build_siem_response.ts +++ b/x-pack/solutions/security/plugins/lists/server/routes/utils/build_siem_response.ts @@ -14,7 +14,7 @@ import { /** * Copied from x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/utils.ts - * We cannot put this in kbn package just yet as the types from 'src/core/server' aren't a kbn package yet and this would pull in a lot of copied things. + * We cannot put this in kbn package just yet as the types from 'src/core/packages/core/server' aren't a kbn package yet and this would pull in a lot of copied things. * TODO: Once more types are moved into kbn package we can move this into a kbn package. */ const statusToErrorMessage = ( @@ -47,7 +47,7 @@ const statusToErrorMessage = ( /** * Copied from x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/utils.ts - * We cannot put this in kbn package just yet as the types from 'src/core/server' aren't a kbn package yet and this would pull in a lot of copied things. + * We cannot put this in kbn package just yet as the types from 'src/core/packages/core/server' aren't a kbn package yet and this would pull in a lot of copied things. * TODO: Once more types are moved into kbn package we can move this into a kbn package. */ export class SiemResponseFactory { @@ -88,7 +88,7 @@ export class SiemResponseFactory { /** * Copied from x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/routes/utils.ts - * We cannot put this in kbn package just yet as the types from 'src/core/server' aren't a kbn package yet and this would pull in a lot of copied things. + * We cannot put this in kbn package just yet as the types from 'src/core/packages/core/server' aren't a kbn package yet and this would pull in a lot of copied things. * TODO: Once more types are moved into kbn package we can move this into a kbn package. */ export const buildSiemResponse = (response: KibanaResponseFactory): SiemResponseFactory => diff --git a/x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_app_toasts.ts b/x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_app_toasts.ts index b98adfb4a875c..71c9541cc554f 100644 --- a/x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_app_toasts.ts +++ b/x-pack/solutions/security/plugins/security_solution/public/common/hooks/use_app_toasts.ts @@ -77,7 +77,7 @@ export type MaybeESError = IEsError & { err?: Record }; /** * This attempts its best to map between an IEsError which comes from bsearch to a error_toaster - * See the file: src/core/public/notifications/toasts/error_toast.tsx + * See the file: src/core/packages/core/public/notifications/toasts/error_toast.tsx * * NOTE: This is brittle at the moment from bsearch and the hope is that better support between * the error message and formatting of bsearch and the error_toast.tsx from Kibana core will be diff --git a/x-pack/solutions/security/plugins/security_solution/public/exceptions/hooks/use_import_exception_list/index.tsx b/x-pack/solutions/security/plugins/security_solution/public/exceptions/hooks/use_import_exception_list/index.tsx index be88970ed5b23..71b0f05500623 100644 --- a/x-pack/solutions/security/plugins/security_solution/public/exceptions/hooks/use_import_exception_list/index.tsx +++ b/x-pack/solutions/security/plugins/security_solution/public/exceptions/hooks/use_import_exception_list/index.tsx @@ -22,7 +22,7 @@ export const importExceptionList = async ({ }: { // TODO: Replace these with kbn packaged versions once we have those available to us // These originally came from this location below before moving them to this hacked "any" types: - // import { HttpStart, NotificationsStart } from '../../../../../../../src/core/public'; + // import { HttpStart, NotificationsStart } from '../../../../../../../src/core/packages/core/public'; http: HttpStart; signal: AbortSignal; file: File; diff --git a/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/utils/utils.ts b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/utils/utils.ts index 447d55382ab61..0b46b08654a3c 100644 --- a/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/utils/utils.ts +++ b/x-pack/solutions/security/plugins/security_solution/server/lib/detection_engine/rule_management/utils/utils.ts @@ -150,7 +150,7 @@ export const getTupleDuplicateErrorsAndUniqueRules = ( }; // functions copied from here -// https://github.com/elastic/kibana/blob/4584a8b570402aa07832cf3e5b520e5d2cfa7166/src/core/server/saved_objects/import/lib/check_origin_conflicts.ts#L55-L57 +// https://github.com/elastic/kibana/blob/4584a8b570402aa07832cf3e5b520e5d2cfa7166/src/core/packages/core/server/saved_objects/import/lib/check_origin_conflicts.ts#L55-L57 const createQueryTerm = (input: string) => input.replace(/\\/g, '\\\\').replace(/\"/g, '\\"'); const createQuery = (type: string, id: string) => `"${createQueryTerm(`${type}:${id}`)}" | "${createQueryTerm(id)}"`; diff --git a/x-pack/solutions/security/plugins/timelines/public/hooks/use_app_toasts.ts b/x-pack/solutions/security/plugins/timelines/public/hooks/use_app_toasts.ts index 3ef00461dbd40..968180e275a6a 100644 --- a/x-pack/solutions/security/plugins/timelines/public/hooks/use_app_toasts.ts +++ b/x-pack/solutions/security/plugins/timelines/public/hooks/use_app_toasts.ts @@ -73,7 +73,7 @@ export type MaybeESError = IEsError & { err?: Record }; /** * This attempts its best to map between an IEsError which comes from bsearch to a error_toaster - * See the file: src/core/public/notifications/toasts/error_toast.tsx + * See the file: src/core/packages/core/public/notifications/toasts/error_toast.tsx * * NOTE: This is brittle at the moment from bsearch and the hope is that better support between * the error message and formatting of bsearch and the error_toast.tsx from Kibana core will be diff --git a/yarn.lock b/yarn.lock index 84be1ce3cd650..c7d6dbc6a9810 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5169,7 +5169,7 @@ version "0.0.0" uid "" -"@kbn/core@link:src/core": +"@kbn/core@link:src/core/packages/core": version "0.0.0" uid ""