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

Remove /src/legacy #95510

Merged
merged 40 commits into from
Apr 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
264e77c
starting removing stuff
pgayvallet Mar 26, 2021
60effbc
fix jest config
pgayvallet Mar 26, 2021
dac4ac0
disable CLI mode until other PR is merged
pgayvallet Mar 26, 2021
3427c1a
fix the schema
pgayvallet Mar 26, 2021
cff9b0b
Merge remote-tracking branch 'upstream/master' into kbn-xxx-legacy-fi…
pgayvallet Mar 29, 2021
46260c8
add deprecation for maxPayloadBytes
pgayvallet Mar 29, 2021
5a9ff60
fix legacy start logic
pgayvallet Mar 29, 2021
4a9bd3a
deletes `env` from unknown args
pgayvallet Mar 29, 2021
9628609
fix FTR test config
pgayvallet Mar 29, 2021
510caae
Merge remote-tracking branch 'upstream/master' into kbn-xxx-legacy-fi…
pgayvallet Mar 30, 2021
8d5cadf
some legacy service deletion
pgayvallet Mar 30, 2021
7daef0a
move config validation
pgayvallet Mar 30, 2021
871e4c3
remove legacy exports from entrypoint
pgayvallet Mar 30, 2021
dd02cfa
preserve legacy logging in core logging config
pgayvallet Mar 30, 2021
5148dd4
try to fix uiSettings integration tests
pgayvallet Mar 30, 2021
f4f9ad0
fix legacy service tests
pgayvallet Mar 30, 2021
3443fa1
Merge remote-tracking branch 'upstream/master' into kbn-xxx-legacy-fi…
pgayvallet Mar 30, 2021
c1eab04
more type fix
pgayvallet Mar 30, 2021
4b5df60
use fromRoot from @kbn/utils
pgayvallet Mar 30, 2021
fa8da2b
cleanup kibana.d.ts
pgayvallet Mar 30, 2021
fbf2618
Merge remote-tracking branch 'upstream/master' into kbn-xxx-legacy-fi…
pgayvallet Mar 31, 2021
d1d64e1
fix unit tests
pgayvallet Mar 31, 2021
f51f0cd
remove src/core/server/utils
pgayvallet Mar 31, 2021
d4a5c97
fix server script
pgayvallet Mar 31, 2021
ac7baa3
add integration test for `/{path*}` route
pgayvallet Mar 31, 2021
b82e0c0
add unit tests on legacy config
pgayvallet Mar 31, 2021
6a45836
adapt uiSetting IT bis
pgayvallet Mar 31, 2021
1f29cb6
fix tests
pgayvallet Mar 31, 2021
89bf3d6
update generated doc
pgayvallet Mar 31, 2021
315a8b2
Merge remote-tracking branch 'upstream/master' into kbn-xxx-legacy-fi…
pgayvallet Apr 5, 2021
69a9d8c
address some review comments
pgayvallet Apr 5, 2021
04e90cc
move review comments
pgayvallet Apr 5, 2021
436e094
Merge remote-tracking branch 'upstream/master' into kbn-xxx-legacy-fi…
pgayvallet Apr 5, 2021
af6c32d
fix some stuff
pgayvallet Apr 5, 2021
a057a60
fix some stuff
pgayvallet Apr 5, 2021
a49f2e1
fix some stuff
pgayvallet Apr 5, 2021
2445460
fix some stuff bis
pgayvallet Apr 5, 2021
4541ab1
generated doc
pgayvallet Apr 5, 2021
d75d880
add test for ensureValidConfiguration
pgayvallet Apr 5, 2021
b16ebf3
Merge remote-tracking branch 'upstream/master' into kbn-xxx-legacy-fi…
pgayvallet Apr 5, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,13 @@ snapshots.js

# plugin overrides
/src/core/lib/kbn_internal_native_observable
/src/legacy/plugin_discovery/plugin_pack/__tests__/fixtures/plugins/broken
/src/plugins/data/common/es_query/kuery/ast/_generated_/**
/src/plugins/vis_type_timelion/common/_generated_/**
/x-pack/legacy/plugins/**/__tests__/fixtures/**
/x-pack/plugins/apm/e2e/tmp/*
/x-pack/plugins/canvas/canvas_plugin
/x-pack/plugins/canvas/shareable_runtime/build
/x-pack/plugins/canvas/storybook/build
/x-pack/plugins/reporting/server/export_types/printable_pdf/server/lib/pdf/assets/**
/x-pack/legacy/plugins/infra/common/graphql/types.ts
/x-pack/legacy/plugins/infra/public/graphql/types.ts
/x-pack/legacy/plugins/infra/server/graphql/types.ts
/x-pack/legacy/plugins/maps/public/vendor/**

# package overrides
/packages/elastic-eslint-config-kibana
Expand Down
24 changes: 2 additions & 22 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -410,11 +410,7 @@ module.exports = {
errorMessage: `Common code can not import from server or public, use a common directory.`,
},
{
target: [
'src/legacy/**/*',
'(src|x-pack)/plugins/**/(public|server)/**/*',
'examples/**/*',
],
target: ['(src|x-pack)/plugins/**/(public|server)/**/*', 'examples/**/*'],
from: [
'src/core/public/**/*',
'!src/core/public/index.ts', // relative import
Expand All @@ -428,8 +424,6 @@ module.exports = {
'!src/core/server/mocks{,.ts}',
'!src/core/server/types{,.ts}',
'!src/core/server/test_utils{,.ts}',
'!src/core/server/utils', // ts alias
'!src/core/server/utils/**/*',
// for absolute imports until fixed in
// https://github.com/elastic/kibana/issues/36096
'!src/core/server/*.test.mocks{,.ts}',
Expand All @@ -442,7 +436,6 @@ module.exports = {
},
{
target: [
'src/legacy/**/*',
'(src|x-pack)/plugins/**/(public|server)/**/*',
'examples/**/*',
'!(src|x-pack)/**/*.test.*',
Expand Down Expand Up @@ -482,27 +475,14 @@ module.exports = {
},
{
target: ['src/core/**/*'],
from: ['plugins/**/*', 'src/plugins/**/*', 'src/legacy/ui/**/*'],
from: ['plugins/**/*', 'src/plugins/**/*'],
errorMessage: 'The core cannot depend on any plugins.',
},
{
target: ['(src|x-pack)/plugins/*/public/**/*'],
from: ['ui/**/*'],
errorMessage: 'Plugins cannot import legacy UI code.',
},
{
from: ['src/legacy/ui/**/*', 'ui/**/*'],
target: [
'test/plugin_functional/plugins/**/public/np_ready/**/*',
'test/plugin_functional/plugins/**/server/np_ready/**/*',
],
allowSameFolder: true,
errorMessage:
'NP-ready code should not import from /src/legacy/ui/** folder. ' +
'Instead of importing from /src/legacy/ui/** deeply within a np_ready folder, ' +
'import those things once at the top level of your plugin and pass those down, just ' +
'like you pass down `core` and `plugins` objects.',
},
],
},
],
Expand Down
8 changes: 0 additions & 8 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@
/x-pack/plugins/dashboard_enhanced/ @elastic/kibana-presentation
/x-pack/test/functional/apps/canvas/ @elastic/kibana-presentation
#CC# /src/plugins/kibana_react/public/code_editor/ @elastic/kibana-presentation
#CC# /x-pack/legacy/plugins/canvas/ @elastic/kibana-presentation
#CC# /x-pack/plugins/dashboard_mode @elastic/kibana-presentation


Expand Down Expand Up @@ -164,7 +163,6 @@
/packages/kbn-utils/ @elastic/kibana-operations
/packages/kbn-cli-dev-mode/ @elastic/kibana-operations
/src/cli/keystore/ @elastic/kibana-operations
/src/legacy/server/warnings/ @elastic/kibana-operations
/.ci/es-snapshots/ @elastic/kibana-operations
/.github/workflows/ @elastic/kibana-operations
/vars/ @elastic/kibana-operations
Expand Down Expand Up @@ -201,9 +199,6 @@
/packages/kbn-legacy-logging/ @elastic/kibana-core
/packages/kbn-crypto/ @elastic/kibana-core
/packages/kbn-http-tools/ @elastic/kibana-core
/src/legacy/server/config/ @elastic/kibana-core
/src/legacy/server/http/ @elastic/kibana-core
/src/legacy/server/logging/ @elastic/kibana-core
/src/plugins/status_page/ @elastic/kibana-core
/src/plugins/saved_objects_management/ @elastic/kibana-core
/src/dev/run_check_published_api_changes.ts @elastic/kibana-core
Expand All @@ -213,9 +208,6 @@
/src/plugins/kibana_overview/ @elastic/kibana-core
/x-pack/plugins/global_search_bar/ @elastic/kibana-core
#CC# /src/core/server/csp/ @elastic/kibana-core
#CC# /src/legacy/server/config/ @elastic/kibana-core
#CC# /src/legacy/server/http/ @elastic/kibana-core
#CC# /src/legacy/ui/public/documentation_links @elastic/kibana-core
#CC# /src/plugins/legacy_export/ @elastic/kibana-core
#CC# /src/plugins/xpack_legacy/ @elastic/kibana-core
#CC# /src/plugins/saved_objects/ @elastic/kibana-core
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ Set of helpers used to create `KibanaResponse` to form HTTP response on an incom

```typescript
kibanaResponseFactory: {
custom: <T extends string | Record<string, any> | Error | Buffer | {
custom: <T extends string | Record<string, any> | Error | Buffer | Stream | {
message: string | Error;
attributes?: Record<string, any> | undefined;
} | Stream | undefined>(options: CustomHttpResponseOptions<T>) => KibanaResponse<T>;
} | undefined>(options: CustomHttpResponseOptions<T>) => KibanaResponse<T>;
badRequest: (options?: ErrorHttpResponseOptions) => KibanaResponse<ResponseError>;
unauthorized: (options?: ErrorHttpResponseOptions) => KibanaResponse<ResponseError>;
forbidden: (options?: ErrorHttpResponseOptions) => KibanaResponse<ResponseError>;
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

2 changes: 0 additions & 2 deletions docs/development/core/server/kibana-plugin-core-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,6 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->
| [LegacyCallAPIOptions](./kibana-plugin-core-server.legacycallapioptions.md) | The set of options that defines how API call should be made and result be processed. |
| [LegacyElasticsearchError](./kibana-plugin-core-server.legacyelasticsearcherror.md) | @<!-- -->deprecated. The new elasticsearch client doesn't wrap errors anymore. |
| [LegacyRequest](./kibana-plugin-core-server.legacyrequest.md) | |
| [LegacyServiceSetupDeps](./kibana-plugin-core-server.legacyservicesetupdeps.md) | |
| [LegacyServiceStartDeps](./kibana-plugin-core-server.legacyservicestartdeps.md) | |
| [LoggerContextConfigInput](./kibana-plugin-core-server.loggercontextconfiginput.md) | |
| [LoggingServiceSetup](./kibana-plugin-core-server.loggingservicesetup.md) | Provides APIs to plugins for customizing the plugin's logger. |
| [MetricsServiceSetup](./kibana-plugin-core-server.metricsservicesetup.md) | APIs to retrieves metrics gathered and exposed by the core platform. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ start(core: CoreStart): {
fieldFormatServiceFactory: (uiSettings: import("../../../core/server").IUiSettingsClient) => Promise<import("../common").FieldFormatsRegistry>;
};
indexPatterns: {
indexPatternsServiceFactory: (savedObjectsClient: Pick<import("../../../core/server").SavedObjectsClient, "get" | "delete" | "create" | "bulkCreate" | "checkConflicts" | "find" | "bulkGet" | "resolve" | "update" | "addToNamespaces" | "deleteFromNamespaces" | "bulkUpdate" | "removeReferencesTo" | "openPointInTimeForType" | "closePointInTime" | "createPointInTimeFinder" | "errors">, elasticsearchClient: import("../../../core/server").ElasticsearchClient) => Promise<import(".").IndexPatternsService>;
indexPatternsServiceFactory: (savedObjectsClient: Pick<import("../../../core/server").SavedObjectsClient, "update" | "get" | "delete" | "create" | "bulkCreate" | "checkConflicts" | "find" | "bulkGet" | "resolve" | "addToNamespaces" | "deleteFromNamespaces" | "bulkUpdate" | "removeReferencesTo" | "openPointInTimeForType" | "closePointInTime" | "createPointInTimeFinder" | "errors">, elasticsearchClient: import("../../../core/server").ElasticsearchClient) => Promise<import(".").IndexPatternsService>;
};
search: ISearchStart<import("./search").IEsSearchRequest, import("./search").IEsSearchResponse<any>>;
};
Expand All @@ -31,7 +31,7 @@ start(core: CoreStart): {
fieldFormatServiceFactory: (uiSettings: import("../../../core/server").IUiSettingsClient) => Promise<import("../common").FieldFormatsRegistry>;
};
indexPatterns: {
indexPatternsServiceFactory: (savedObjectsClient: Pick<import("../../../core/server").SavedObjectsClient, "get" | "delete" | "create" | "bulkCreate" | "checkConflicts" | "find" | "bulkGet" | "resolve" | "update" | "addToNamespaces" | "deleteFromNamespaces" | "bulkUpdate" | "removeReferencesTo" | "openPointInTimeForType" | "closePointInTime" | "createPointInTimeFinder" | "errors">, elasticsearchClient: import("../../../core/server").ElasticsearchClient) => Promise<import(".").IndexPatternsService>;
indexPatternsServiceFactory: (savedObjectsClient: Pick<import("../../../core/server").SavedObjectsClient, "update" | "get" | "delete" | "create" | "bulkCreate" | "checkConflicts" | "find" | "bulkGet" | "resolve" | "addToNamespaces" | "deleteFromNamespaces" | "bulkUpdate" | "removeReferencesTo" | "openPointInTimeForType" | "closePointInTime" | "createPointInTimeFinder" | "errors">, elasticsearchClient: import("../../../core/server").ElasticsearchClient) => Promise<import(".").IndexPatternsService>;
};
search: ISearchStart<import("./search").IEsSearchRequest, import("./search").IEsSearchResponse<any>>;
}`
Expand Down
1 change: 0 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ module.exports = {
projects: [
'<rootDir>/packages/*/jest.config.js',
'<rootDir>/src/*/jest.config.js',
'<rootDir>/src/legacy/*/jest.config.js',
'<rootDir>/src/plugins/*/jest.config.js',
'<rootDir>/test/*/jest.config.js',
'<rootDir>/x-pack/plugins/*/jest.config.js',
Expand Down
15 changes: 0 additions & 15 deletions kibana.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,3 @@ import * as Public from 'src/core/public';
import * as Server from 'src/core/server';

export { Public, Server };

/**
Comment on lines 13 to -17
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All that remains in this file is this Public / Server export. The file seems unused in the repo, but I wasn't sure if I should remove it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this used for the import { CoreSetup } from 'kibana/server' TS shortcuts in the repo. I believe we'll need to migrate away from those for Bazel anyways, but that should be done separate from this PR.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Err scratch that, I think the generated types are used to power that. So yeah, not sure if we need this strictly anymore either.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import { CoreSetup } from 'kibana/server'

they are configured with TS paths

"kibana/public": ["src/core/public"],
"kibana/server": ["src/core/server"]

I didn't manage to find any places relying on it.
@elastic/kibana-operations maybe you know? If no, let's remove it

* All exports from TS ambient definitions (where types are added for JS source in a .d.ts file).
*/
import * as LegacyKibanaServer from './src/legacy/server/kbn_server';

/**
* Re-export legacy types under a namespace.
*/
export namespace Legacy {
export type KibanaConfig = LegacyKibanaServer.KibanaConfig;
export type Request = LegacyKibanaServer.Request;
export type ResponseToolkit = LegacyKibanaServer.ResponseToolkit;
export type Server = LegacyKibanaServer.Server;
}
2 changes: 0 additions & 2 deletions packages/kbn-cli-dev-mode/src/get_server_watch_paths.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ it('produces the right watch and ignore list', () => {
expect(watchPaths).toMatchInlineSnapshot(`
Array [
<absolute path>/src/core,
<absolute path>/src/legacy/server,
<absolute path>/src/legacy/utils,
<absolute path>/config,
<absolute path>/x-pack/test/plugin_functional/plugins/resolver_test,
<absolute path>/src/plugins,
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading