Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kbn team 1309 relocate 20241223085057 #205077

Draft
wants to merge 17 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 2 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ const DEV_DIRECTORIES = [
'test_utils',
'test_utilities',
'test_helpers',
'test-helpers',
'tests_client_integration',
'tsd_tests',
];
Expand Down Expand Up @@ -1915,7 +1916,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/**',
Expand Down
30 changes: 15 additions & 15 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -54,22 +54,11 @@ packages/content-management/table_list_view @elastic/appex-sharedux
packages/content-management/table_list_view_common @elastic/appex-sharedux
packages/content-management/table_list_view_table @elastic/appex-sharedux
packages/content-management/user_profiles @elastic/appex-sharedux
packages/core/analytics/core-analytics-browser @elastic/kibana-core
packages/core/analytics/core-analytics-browser-internal @elastic/kibana-core
packages/core/analytics/core-analytics-browser-mocks @elastic/kibana-core
packages/core/analytics/core-analytics-server @elastic/kibana-core
packages/core/analytics/core-analytics-server-internal @elastic/kibana-core
packages/core/analytics/core-analytics-server-mocks @elastic/kibana-core
packages/core/application/core-application-browser @elastic/kibana-core
packages/core/application/core-application-browser-internal @elastic/kibana-core
packages/core/application/core-application-browser-mocks @elastic/kibana-core
packages/core/application/core-application-common @elastic/kibana-core
packages/core/apps/core-apps-browser-internal @elastic/kibana-core
packages/core/apps/core-apps-browser-mocks @elastic/kibana-core
packages/core/apps/core-apps-server-internal @elastic/kibana-core
packages/core/base/core-base-browser-internal @elastic/kibana-core
packages/core/base/core-base-browser-mocks @elastic/kibana-core
packages/core/base/core-base-common @elastic/kibana-core
packages/core/base/core-base-common-internal @elastic/kibana-core
packages/core/base/core-base-server-internal @elastic/kibana-core
packages/core/base/core-base-server-mocks @elastic/kibana-core
Expand Down Expand Up @@ -557,7 +546,18 @@ packages/shared-ux/router/types @elastic/appex-sharedux
packages/shared-ux/storybook/config @elastic/appex-sharedux
packages/shared-ux/storybook/mock @elastic/appex-sharedux
packages/shared-ux/table_persist @elastic/appex-sharedux
src/core @elastic/kibana-core
src/core/packages/analytics/browser @elastic/kibana-core
src/core/packages/analytics/browser-internal @elastic/kibana-core
src/core/packages/analytics/server @elastic/kibana-core
src/core/packages/analytics/server-internal @elastic/kibana-core
src/core/packages/application/browser @elastic/kibana-core
src/core/packages/application/browser-internal @elastic/kibana-core
src/core/packages/application/common @elastic/kibana-core
src/core/packages/apps/browser-internal @elastic/kibana-core
src/core/packages/apps/server-internal @elastic/kibana-core
src/core/packages/base/browser-internal @elastic/kibana-core
src/core/packages/base/common @elastic/kibana-core
src/core/packages/core @elastic/kibana-core
src/platform/packages/private/default-nav/devtools @elastic/kibana-management
src/platform/packages/private/default-nav/management @elastic/kibana-management
src/platform/packages/private/default-nav/ml @elastic/ml-ui
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion STYLEGUIDE.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export class MyPlugin implements Plugin {
}
}
----
<1> Refer to {kib-repo}/blob/8.9/packages/core/application/core-application-browser/src/contracts.ts[application.register interface]
<1> Refer to {kib-repo}/blob/8.9/src/core/packages/application/browser/src/contracts.ts[application.register interface]
<2> Application specific URL.
<3> `mount` callback is invoked when a user navigates to the application-specific URL.
<4> `core.getStartServices` method provides API available during `start` lifecycle.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Registering a feature consists of the following fields. For more information, co
|A human readable name for your feature.

|`category` (required)
|{kib-repo}blob/{branch}/packages/core/application/core-application-common/src/app_category.ts[`AppCategory`]
|{kib-repo}blob/{branch}/src/core/packages/application/common/src/app_category.ts[`AppCategory`]
|`DEFAULT_APP_CATEGORIES.kibana`
|The `AppCategory` which best represents your feature. Used to organize the display
of features within the management screens.
Expand Down
16 changes: 8 additions & 8 deletions docs/developer/best-practices/navigation.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,13 @@ window.location.href = urlToADashboard;

To navigate between different {kib} apps without a page reload (by default) there are APIs in `core`:

* {kib-repo}tree/{branch}/packages/core/application/core-application-browser/src/contracts.ts[core.application.navigateToApp]
* {kib-repo}tree/{branch}/packages/core/application/core-application-browser/src/contracts.ts[core.application.navigateToUrl]
* {kib-repo}tree/{branch}/src/core/packages/application/browser/src/contracts.ts[core.application.navigateToApp]
* {kib-repo}tree/{branch}/src/core/packages/application/browser/src/contracts.ts[core.application.navigateToUrl]

Both methods offer customization such as opening the target in a new page, with an `options` parameter. All the options are optional be default.

* {kib-repo}tree/{branch}/packages/core/application/core-application-browser/src/contracts.ts[core.application.navigateToApp options]
* {kib-repo}tree/{branch}/packages/core/application/core-application-browser/src/contracts.ts[core.application.navigateToUrl options]
* {kib-repo}tree/{branch}/src/core/packages/application/browser/src/contracts.ts[core.application.navigateToApp options]
* {kib-repo}tree/{branch}/src/core/packages/application/browser/src/contracts.ts[core.application.navigateToUrl options]

*Rendering a link to a different {kib} app on its own would also cause a full page reload:*

Expand Down Expand Up @@ -163,8 +163,8 @@ Common rules to follow in this scenario:

This is required to make sure `core` is aware of navigations triggered inside your app, so it could act accordingly when needed.

* `Core`'s {kib-repo}tree/{branch}/packages/core/application/core-application-browser/src/scoped_history.ts[ScopedHistory] instance.
* {kib-repo}tree/{branch}/packages/core/application/core-application-browser/src/app_mount.ts[Example usage]
* `Core`'s {kib-repo}tree/{branch}/src/core/packages/application/browser/src/scoped_history.ts[ScopedHistory] instance.
* {kib-repo}tree/{branch}/src/core/packages/application/browser/src/app_mount.ts[Example usage]
* {kib-repo}tree/{branch}/test/plugin_functional/plugins/core_plugin_a/public/application.tsx#L120[Example plugin]

Relative links will be resolved relative to your app's route (e.g.: `http://localhost5601/app/{your-app-id}`)
Expand All @@ -181,14 +181,14 @@ const MyInternalLink = () => <Link to="/my-other-page"></Link>
=== Using history and browser location

Try to avoid using `window.location` and `window.history` directly. +
Instead, consider using {kib-repo}tree/{branch}/packages/core/application/core-application-browser/src/scoped_history.ts[ScopedHistory]
Instead, consider using {kib-repo}tree/{branch}/src/core/packages/application/browser/src/scoped_history.ts[ScopedHistory]
instance provided by `core`.

* This way `core` will know about location changes triggered within your app, and it would act accordingly.
* Some plugins are listening to location changes. Triggering location change manually could lead to unpredictable and hard-to-catch bugs.

Common use-case for using
`core`'s {kib-repo}tree/{branch}/packages/core/application/core-application-browser/src/scoped_history.ts[ScopedHistory] directly:
`core`'s {kib-repo}tree/{branch}/src/core/packages/application/browser/src/scoped_history.ts[ScopedHistory] directly:

* Reading/writing query params or hash.
* Imperatively triggering internal navigations within your app.
Expand Down
24 changes: 12 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -244,19 +244,19 @@
"@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-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",
"@kbn/core-analytics-server-internal": "link:packages/core/analytics/core-analytics-server-internal",
"@kbn/core": "link:src/core/packages/core",
"@kbn/core-analytics-browser": "link:src/core/packages/analytics/browser",
"@kbn/core-analytics-browser-internal": "link:src/core/packages/analytics/browser-internal",
"@kbn/core-analytics-server": "link:src/core/packages/analytics/server",
"@kbn/core-analytics-server-internal": "link:src/core/packages/analytics/server-internal",
"@kbn/core-app-status-plugin": "link:test/plugin_functional/plugins/core_app_status",
"@kbn/core-application-browser": "link:packages/core/application/core-application-browser",
"@kbn/core-application-browser-internal": "link:packages/core/application/core-application-browser-internal",
"@kbn/core-application-common": "link:packages/core/application/core-application-common",
"@kbn/core-apps-browser-internal": "link:packages/core/apps/core-apps-browser-internal",
"@kbn/core-apps-server-internal": "link:packages/core/apps/core-apps-server-internal",
"@kbn/core-base-browser-internal": "link:packages/core/base/core-base-browser-internal",
"@kbn/core-base-common": "link:packages/core/base/core-base-common",
"@kbn/core-application-browser": "link:src/core/packages/application/browser",
"@kbn/core-application-browser-internal": "link:src/core/packages/application/browser-internal",
"@kbn/core-application-common": "link:src/core/packages/application/common",
"@kbn/core-apps-browser-internal": "link:src/core/packages/apps/browser-internal",
"@kbn/core-apps-server-internal": "link:src/core/packages/apps/server-internal",
"@kbn/core-base-browser-internal": "link:src/core/packages/base/browser-internal",
"@kbn/core-base-common": "link:src/core/packages/base/common",
"@kbn/core-base-common-internal": "link:packages/core/base/core-base-common-internal",
"@kbn/core-base-server-internal": "link:packages/core/base/core-base-server-internal",
"@kbn/core-capabilities-browser-internal": "link:packages/core/capabilities/core-capabilities-browser-internal",
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

14 changes: 0 additions & 14 deletions packages/core/application/core-application-browser/jest.config.js

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,10 @@ export interface DeprecationDetailsMessage {
export interface BaseDeprecationDetails {
/**
* The title of the deprecation.
* Check the README for writing deprecations in `src/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`
*/
message: string | DeprecationDetailsMessage | Array<string | DeprecationDetailsMessage>;
/**
Expand Down Expand Up @@ -72,7 +70,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[];
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 '@kbn/core/server';
* import { i18n } from '@kbn/i18n';
*
* async function getDeprecations({ esClient, savedObjectsClient }: GetDeprecationsContext): Promise<DeprecationsDetails[]> {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/http/core-http-server/src/router/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Loading
Loading