Skip to content

Commit 9b01f73

Browse files
committed
Merge branch 'master' of github.com:elastic/kibana into sourcerer-offshoot
2 parents cb739a2 + 0cf3bf2 commit 9b01f73

File tree

405 files changed

+7658
-12291
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

405 files changed

+7658
-12291
lines changed

.eslintrc.js

+9-55
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@
1717
* under the License.
1818
*/
1919

20-
const { readdirSync } = require('fs');
21-
const { resolve } = require('path');
22-
2320
const APACHE_2_0_LICENSE_HEADER = `
2421
/*
2522
* Licensed to Elasticsearch B.V. under one or more contributor
@@ -288,7 +285,7 @@ module.exports = {
288285
},
289286
{
290287
target: [
291-
'(src|x-pack)/legacy/**/*',
288+
'src/legacy/**/*',
292289
'(src|x-pack)/plugins/**/(public|server)/**/*',
293290
'examples/**/*',
294291
],
@@ -319,14 +316,11 @@ module.exports = {
319316
},
320317
{
321318
target: [
322-
'(src|x-pack)/legacy/**/*',
319+
'src/legacy/**/*',
323320
'(src|x-pack)/plugins/**/(public|server)/**/*',
324321
'examples/**/*',
325322
'!(src|x-pack)/**/*.test.*',
326323
'!(x-pack/)?test/**/*',
327-
// next folder contains legacy browser tests which can't be migrated to jest
328-
// which import np files
329-
'!src/legacy/core_plugins/kibana/public/__tests__/**/*',
330324
],
331325
from: [
332326
'(src|x-pack)/plugins/**/(public|server)/**/*',
@@ -341,14 +335,6 @@ module.exports = {
341335
'(src|x-pack)/plugins/**/*',
342336
'!(src|x-pack)/plugins/**/server/**/*',
343337

344-
'src/legacy/core_plugins/**/*',
345-
'!src/legacy/core_plugins/**/server/**/*',
346-
'!src/legacy/core_plugins/**/index.{js,mjs,ts,tsx}',
347-
348-
'x-pack/legacy/plugins/**/*',
349-
'!x-pack/legacy/plugins/**/server/**/*',
350-
'!x-pack/legacy/plugins/**/index.{js,mjs,ts,tsx}',
351-
352338
'examples/**/*',
353339
'!examples/**/server/**/*',
354340
],
@@ -370,12 +356,7 @@ module.exports = {
370356
},
371357
{
372358
target: ['src/core/**/*'],
373-
from: [
374-
'plugins/**/*',
375-
'src/plugins/**/*',
376-
'src/legacy/core_plugins/**/*',
377-
'src/legacy/ui/**/*',
378-
],
359+
from: ['plugins/**/*', 'src/plugins/**/*', 'src/legacy/ui/**/*'],
379360
errorMessage: 'The core cannot depend on any plugins.',
380361
},
381362
{
@@ -388,12 +369,6 @@ module.exports = {
388369
target: [
389370
'test/plugin_functional/plugins/**/public/np_ready/**/*',
390371
'test/plugin_functional/plugins/**/server/np_ready/**/*',
391-
'src/legacy/core_plugins/**/public/np_ready/**/*',
392-
'src/legacy/core_plugins/vis_type_*/public/**/*',
393-
'!src/legacy/core_plugins/vis_type_*/public/legacy*',
394-
'src/legacy/core_plugins/**/server/np_ready/**/*',
395-
'x-pack/legacy/plugins/**/public/np_ready/**/*',
396-
'x-pack/legacy/plugins/**/server/np_ready/**/*',
397372
],
398373
allowSameFolder: true,
399374
errorMessage:
@@ -443,22 +418,14 @@ module.exports = {
443418
settings: {
444419
// instructs import/no-extraneous-dependencies to treat certain modules
445420
// as core modules, even if they aren't listed in package.json
446-
'import/core-modules': ['plugins', 'legacy/ui'],
421+
'import/core-modules': ['plugins'],
447422

448423
'import/resolver': {
449424
'@kbn/eslint-import-resolver-kibana': {
450425
forceNode: false,
451426
rootPackageName: 'kibana',
452427
kibanaPath: '.',
453-
pluginMap: readdirSync(resolve(__dirname, 'x-pack/legacy/plugins')).reduce(
454-
(acc, name) => {
455-
if (!name.startsWith('_')) {
456-
acc[name] = `x-pack/legacy/plugins/${name}`;
457-
}
458-
return acc;
459-
},
460-
{}
461-
),
428+
pluginMap: {},
462429
},
463430
},
464431
},
@@ -764,16 +731,6 @@ module.exports = {
764731
},
765732
},
766733

767-
/**
768-
* GIS overrides
769-
*/
770-
{
771-
files: ['x-pack/legacy/plugins/maps/**/*.js'],
772-
rules: {
773-
'react/prefer-stateless-function': [0, { ignorePureComponents: false }],
774-
},
775-
},
776-
777734
/**
778735
* ML overrides
779736
*/
@@ -812,7 +769,7 @@ module.exports = {
812769
},
813770
{
814771
// typescript only for front and back end
815-
files: ['x-pack/{,legacy/}plugins/security_solution/**/*.{ts,tsx}'],
772+
files: ['x-pack/plugins/security_solution/**/*.{ts,tsx}'],
816773
rules: {
817774
// This will be turned on after bug fixes are complete
818775
// '@typescript-eslint/explicit-member-accessibility': 'warn',
@@ -858,7 +815,7 @@ module.exports = {
858815
// },
859816
{
860817
// typescript and javascript for front and back end
861-
files: ['x-pack/{,legacy/}plugins/security_solution/**/*.{js,mjs,ts,tsx}'],
818+
files: ['x-pack/plugins/security_solution/**/*.{js,mjs,ts,tsx}'],
862819
plugins: ['eslint-plugin-node', 'react'],
863820
env: {
864821
mocha: true,
@@ -1089,7 +1046,7 @@ module.exports = {
10891046
{
10901047
// typescript only for front and back end
10911048
files: [
1092-
'x-pack/{,legacy/}plugins/{alerts,alerting_builtins,actions,task_manager,event_log}/**/*.{ts,tsx}',
1049+
'x-pack/plugins/{alerts,alerting_builtins,actions,task_manager,event_log}/**/*.{ts,tsx}',
10931050
],
10941051
rules: {
10951052
'@typescript-eslint/no-explicit-any': 'error',
@@ -1238,10 +1195,7 @@ module.exports = {
12381195
* TSVB overrides
12391196
*/
12401197
{
1241-
files: [
1242-
'src/plugins/vis_type_timeseries/**/*.{js,mjs,ts,tsx}',
1243-
'src/legacy/core_plugins/vis_type_timeseries/**/*.{js,mjs,ts,tsx}',
1244-
],
1198+
files: ['src/plugins/vis_type_timeseries/**/*.{js,mjs,ts,tsx}'],
12451199
rules: {
12461200
'import/no-default-export': 'error',
12471201
},

.github/CODEOWNERS

+4-12
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,15 @@
6565

6666
# Client Side Monitoring (lives in APM directories but owned by Uptime)
6767
/x-pack/plugins/apm/e2e/cypress/support/step_definitions/csm @elastic/uptime
68+
/x-pack/plugins/apm/e2e/cypress/integration/csm_dashboard.feature @elastic/uptime
6869
/x-pack/plugins/apm/public/application/csmApp.tsx @elastic/uptime
6970
/x-pack/plugins/apm/public/components/app/RumDashboard @elastic/uptime
7071
/x-pack/plugins/apm/server/lib/rum_client @elastic/uptime
7172
/x-pack/plugins/apm/server/routes/rum_client.ts @elastic/uptime
72-
/x-pack/plugins/apm/server/projections/rum_overview.ts @elastic/uptime
73+
/x-pack/plugins/apm/server/projections/rum_page_load_transactions.ts @elastic/uptime
7374

7475
# Beats
75-
/x-pack/legacy/plugins/beats_management/ @elastic/beats
76+
/x-pack/plugins/beats_management/ @elastic/beats
7677

7778
# Canvas
7879
/x-pack/plugins/canvas/ @elastic/kibana-canvas
@@ -86,16 +87,13 @@
8687
/x-pack/plugins/global_search_bar/ @elastic/kibana-core-ui
8788

8889
# Observability UIs
89-
/x-pack/legacy/plugins/infra/ @elastic/logs-metrics-ui
9090
/x-pack/plugins/infra/ @elastic/logs-metrics-ui
9191
/x-pack/plugins/ingest_manager/ @elastic/ingest-management
92-
/x-pack/legacy/plugins/ingest_manager/ @elastic/ingest-management
9392
/x-pack/plugins/observability/ @elastic/observability-ui
9493
/x-pack/plugins/monitoring/ @elastic/stack-monitoring-ui
9594
/x-pack/plugins/uptime @elastic/uptime
9695

9796
# Machine Learning
98-
/x-pack/legacy/plugins/ml/ @elastic/ml-ui
9997
/x-pack/plugins/ml/ @elastic/ml-ui
10098
/x-pack/test/functional/apps/machine_learning/ @elastic/ml-ui
10199
/x-pack/test/functional/services/machine_learning/ @elastic/ml-ui
@@ -107,7 +105,6 @@
107105
/x-pack/test/functional/services/transform.ts @elastic/ml-ui
108106

109107
# Maps
110-
/x-pack/legacy/plugins/maps/ @elastic/kibana-gis
111108
/x-pack/plugins/maps/ @elastic/kibana-gis
112109
/x-pack/test/api_integration/apis/maps/ @elastic/kibana-gis
113110
/x-pack/test/functional/apps/maps/ @elastic/kibana-gis
@@ -234,13 +231,8 @@ x-pack/plugins/telemetry_collection_xpack/schema/xpack_plugins.json @elastic/kib
234231
/src/plugins/dev_tools/ @elastic/es-ui
235232
/src/plugins/console/ @elastic/es-ui
236233
/src/plugins/es_ui_shared/ @elastic/es-ui
237-
/x-pack/legacy/plugins/cross_cluster_replication/ @elastic/es-ui
234+
/x-pack/plugins/cross_cluster_replication/ @elastic/es-ui
238235
/x-pack/plugins/index_lifecycle_management/ @elastic/es-ui
239-
/x-pack/legacy/plugins/index_management/ @elastic/es-ui
240-
/x-pack/legacy/plugins/license_management/ @elastic/es-ui
241-
/x-pack/legacy/plugins/rollup/ @elastic/es-ui
242-
/x-pack/legacy/plugins/snapshot_restore/ @elastic/es-ui
243-
/x-pack/legacy/plugins/upgrade_assistant/ @elastic/es-ui
244236
/x-pack/plugins/console_extensions/ @elastic/es-ui
245237
/x-pack/plugins/es_ui_shared/ @elastic/es-ui
246238
/x-pack/plugins/grokdebugger/ @elastic/es-ui

docs/developer/plugin-list.asciidoc

+4
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,10 @@ in their infrastructure.
504504
|Contains HTTP endpoints and UiSettings that are slated for removal.
505505
506506
507+
|{kib-repo}blob/{branch}/x-pack/plugins/drilldowns/url_drilldown/README.md[urlDrilldown]
508+
|NOTE: This plugin contains implementation of URL drilldown. For drilldowns infrastructure code refer to ui_actions_enhanced plugin.
509+
510+
507511
|===
508512
509513
include::{kibana-root}/src/plugins/dashboard/README.asciidoc[leveloffset=+1]

docs/user/dashboard/url-drilldown.asciidoc

+11
Original file line numberDiff line numberDiff line change
@@ -238,3 +238,14 @@ Tip: Consider using <<helpers, date>> helper for date formatting.
238238
| Aggregation field behind the selected range, if available.
239239

240240
|===
241+
242+
[float]
243+
[[disable]]
244+
==== Disable URL drilldown
245+
246+
You can disable URL drilldown feature on your {kib} instance by disabling the plugin:
247+
248+
["source","yml"]
249+
-----------
250+
url_drilldown.enabled: false
251+
-----------

kibana.d.ts

-5
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ export { Public, Server };
2828
/**
2929
* All exports from TS ambient definitions (where types are added for JS source in a .d.ts file).
3030
*/
31-
import * as LegacyKibanaPluginSpec from './src/legacy/plugin_discovery/plugin_spec/plugin_spec_options';
3231
import * as LegacyKibanaServer from './src/legacy/server/kbn_server';
3332

3433
/**
@@ -39,8 +38,4 @@ export namespace Legacy {
3938
export type Request = LegacyKibanaServer.Request;
4039
export type ResponseToolkit = LegacyKibanaServer.ResponseToolkit;
4140
export type Server = LegacyKibanaServer.Server;
42-
43-
export type InitPluginFunction = LegacyKibanaPluginSpec.InitPluginFunction;
44-
export type UiExports = LegacyKibanaPluginSpec.UiExports;
45-
export type PluginSpecOptions = LegacyKibanaPluginSpec.PluginSpecOptions;
4641
}

src/cli/serve/serve.js

+1-15
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,6 @@ const CAN_CLUSTER = canRequire(CLUSTER_MANAGER_PATH);
4848
const REPL_PATH = resolve(__dirname, '../repl');
4949
const CAN_REPL = canRequire(REPL_PATH);
5050

51-
// xpack is installed in both dev and the distributable, it's optional if
52-
// install is a link to the source, not an actual install
53-
const XPACK_DIR = resolve(__dirname, '../../../x-pack');
54-
const XPACK_INSTALLED = canRequire(XPACK_DIR);
55-
5651
const pathCollector = function () {
5752
const paths = [];
5853
return function (path) {
@@ -137,16 +132,7 @@ function applyConfigOverrides(rawConfig, opts, extraCliOptions) {
137132
if (opts.logFile) set('logging.dest', opts.logFile);
138133

139134
set('plugins.scanDirs', _.compact([].concat(get('plugins.scanDirs'), opts.pluginDir)));
140-
set(
141-
'plugins.paths',
142-
_.compact(
143-
[].concat(
144-
get('plugins.paths'),
145-
opts.pluginPath,
146-
XPACK_INSTALLED && !opts.oss ? [XPACK_DIR] : []
147-
)
148-
)
149-
);
135+
set('plugins.paths', _.compact([].concat(get('plugins.paths'), opts.pluginPath)));
150136

151137
merge(extraCliOptions);
152138
merge(readKeystore());

src/core/public/injected_metadata/injected_metadata_service.ts

-25
Original file line numberDiff line numberDiff line change
@@ -58,19 +58,6 @@ export interface InjectedMetadataParams {
5858
uiPlugins: InjectedPluginMetadata[];
5959
anonymousStatusPage: boolean;
6060
legacyMetadata: {
61-
app: {
62-
id: string;
63-
title: string;
64-
};
65-
bundleId: string;
66-
version: string;
67-
branch: string;
68-
buildNum: number;
69-
buildSha: string;
70-
basePath: string;
71-
serverName: string;
72-
devMode: boolean;
73-
category?: AppCategory;
7461
uiSettings: {
7562
defaults: Record<string, UiSettingsParams>;
7663
user?: Record<string, UserProvidedValues>;
@@ -167,18 +154,6 @@ export interface InjectedMetadataSetup {
167154
getPlugins: () => InjectedPluginMetadata[];
168155
getAnonymousStatusPage: () => boolean;
169156
getLegacyMetadata: () => {
170-
app: {
171-
id: string;
172-
title: string;
173-
};
174-
bundleId: string;
175-
version: string;
176-
branch: string;
177-
buildNum: number;
178-
buildSha: string;
179-
basePath: string;
180-
serverName: string;
181-
devMode: boolean;
182157
uiSettings: {
183158
defaults: Record<string, UiSettingsParams>;
184159
user?: Record<string, UserProvidedValues> | undefined;

src/core/server/index.ts

+1-8
Original file line numberDiff line numberDiff line change
@@ -339,14 +339,7 @@ export {
339339
SavedObjectsMigrationVersion,
340340
} from './types';
341341

342-
export {
343-
LegacyServiceSetupDeps,
344-
LegacyServiceStartDeps,
345-
LegacyServiceDiscoverPlugins,
346-
LegacyConfig,
347-
LegacyUiExports,
348-
LegacyInternals,
349-
} from './legacy';
342+
export { LegacyServiceSetupDeps, LegacyServiceStartDeps, LegacyConfig } from './legacy';
350343

351344
export {
352345
CoreStatus,

src/core/server/legacy/config/ensure_valid_configuration.test.ts

+1-6
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,12 @@ describe('ensureValidConfiguration', () => {
3939
configService as any,
4040
{
4141
settings: 'settings',
42-
pluginSpecs: 'pluginSpecs',
43-
disabledPluginSpecs: 'disabledPluginSpecs',
44-
pluginExtendedConfig: 'pluginExtendedConfig',
45-
uiExports: 'uiExports',
42+
legacyConfig: 'pluginExtendedConfig',
4643
} as any
4744
);
4845
expect(getUnusedConfigKeys).toHaveBeenCalledTimes(1);
4946
expect(getUnusedConfigKeys).toHaveBeenCalledWith({
5047
coreHandledConfigPaths: ['core', 'elastic'],
51-
pluginSpecs: 'pluginSpecs',
52-
disabledPluginSpecs: 'disabledPluginSpecs',
5348
settings: 'settings',
5449
legacyConfig: 'pluginExtendedConfig',
5550
});

src/core/server/legacy/config/ensure_valid_configuration.ts

+3-5
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,17 @@
1919

2020
import { getUnusedConfigKeys } from './get_unused_config_keys';
2121
import { ConfigService } from '../../config';
22-
import { LegacyServiceDiscoverPlugins } from '../types';
2322
import { CriticalError } from '../../errors';
23+
import { LegacyServiceSetupConfig } from '../types';
2424

2525
export async function ensureValidConfiguration(
2626
configService: ConfigService,
27-
{ pluginSpecs, disabledPluginSpecs, pluginExtendedConfig, settings }: LegacyServiceDiscoverPlugins
27+
{ legacyConfig, settings }: LegacyServiceSetupConfig
2828
) {
2929
const unusedConfigKeys = await getUnusedConfigKeys({
3030
coreHandledConfigPaths: await configService.getUsedPaths(),
31-
pluginSpecs,
32-
disabledPluginSpecs,
3331
settings,
34-
legacyConfig: pluginExtendedConfig,
32+
legacyConfig,
3533
});
3634

3735
if (unusedConfigKeys.length > 0) {

0 commit comments

Comments
 (0)