-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into task/dw-fix-flaky-test-145204
- Loading branch information
Showing
499 changed files
with
13,038 additions
and
25,383 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# as work on serverless picks up we will add config values to this file that | ||
# define how Kibana will run in "serverless" mode. To start Kibana locally with | ||
# this configuration, pass `--serverless` or run `yarn start-serverless` | ||
|
||
# configuration is applied in the following order, later values override | ||
# 1. kibana.yml | ||
# 2. kibana.serverless.yml (when --serverless is passed) | ||
# 3. kibana.dev.yml | ||
# 4. kibana.serverless.dev.yml (when --serverless is passed) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
120 changes: 120 additions & 0 deletions
120
...ns/core-plugins-server-internal/src/discovery/plugin_manifest_from_plugin_package.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
/* | ||
* 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 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 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import { PluginPackageManifest } from '@kbn/repo-packages'; | ||
import { PluginType } from '@kbn/core-base-common'; | ||
import { pluginManifestFromPluginPackage } from './plugin_manifest_from_plugin_package'; | ||
|
||
const kibanaVersion = `1.${Math.round(10 * Math.random())}.1`; | ||
const minimal: PluginPackageManifest = { | ||
type: 'plugin', | ||
id: '@kbn/some-legacy-plugin', | ||
owner: ['@elastic/team-a', '@elastic/team-b'], | ||
plugin: { | ||
id: 'someLegacyPluginId', | ||
browser: true, | ||
server: true, | ||
}, | ||
}; | ||
const basic: PluginPackageManifest = { | ||
...minimal, | ||
plugin: { | ||
...minimal.plugin, | ||
type: 'preboot', | ||
configPath: ['some', 'legacy'], | ||
enabledOnAnonymousPages: false, | ||
extraPublicDirs: ['foo', 'bar'], | ||
optionalPlugins: ['someOtherPlugin'], | ||
requiredBundles: ['someRequiresBundlePlugin'], | ||
requiredPlugins: ['someRequiredPlugin'], | ||
}, | ||
serviceFolders: ['foo', 'bar'], | ||
}; | ||
|
||
describe('pluginManifestFromPluginPackage()', () => { | ||
it('consumes correct values from plugin package manifest', () => { | ||
expect(pluginManifestFromPluginPackage('static', basic)).toMatchInlineSnapshot(` | ||
Object { | ||
"configPath": Array [ | ||
"some", | ||
"legacy", | ||
], | ||
"enabledOnAnonymousPages": false, | ||
"id": "someLegacyPluginId", | ||
"kibanaVersion": "static", | ||
"optionalPlugins": Array [ | ||
"someOtherPlugin", | ||
], | ||
"owner": Object { | ||
"name": "@elastic/team-a & @elastic/team-b", | ||
}, | ||
"requiredBundles": Array [ | ||
"someRequiresBundlePlugin", | ||
], | ||
"requiredPlugins": Array [ | ||
"someRequiredPlugin", | ||
], | ||
"server": true, | ||
"serviceFolders": Array [ | ||
"foo", | ||
"bar", | ||
], | ||
"type": "preboot", | ||
"ui": true, | ||
"version": "1.0.0", | ||
} | ||
`); | ||
}); | ||
|
||
it('applies correct defaults', () => { | ||
const pm = pluginManifestFromPluginPackage(kibanaVersion, minimal); | ||
expect(pm).toHaveProperty('type', PluginType.standard); | ||
expect(pm.enabledOnAnonymousPages).toBeUndefined(); | ||
expect(pm.serviceFolders).toBeUndefined(); | ||
expect(pm).toHaveProperty('kibanaVersion', kibanaVersion); | ||
expect(pm).toHaveProperty('optionalPlugins', []); | ||
expect(pm).toHaveProperty('requiredBundles', []); | ||
expect(pm).toHaveProperty('requiredPlugins', []); | ||
expect(pm).toHaveProperty('owner', { | ||
name: '@elastic/team-a & @elastic/team-b', | ||
}); | ||
expect(pm).toHaveProperty('server', true); | ||
expect(pm).toHaveProperty('ui', true); | ||
expect(pm).toHaveProperty('configPath', 'some_legacy_plugin_id'); | ||
}); | ||
|
||
it('reflects plugin.server', () => { | ||
expect( | ||
pluginManifestFromPluginPackage(kibanaVersion, { | ||
...minimal, | ||
plugin: { ...minimal.plugin, server: false }, | ||
}) | ||
).toHaveProperty('server', false); | ||
expect( | ||
pluginManifestFromPluginPackage(kibanaVersion, { | ||
...minimal, | ||
plugin: { ...minimal.plugin, server: true }, | ||
}) | ||
).toHaveProperty('server', true); | ||
}); | ||
|
||
it('reflects plugin.browser', () => { | ||
expect( | ||
pluginManifestFromPluginPackage(kibanaVersion, { | ||
...minimal, | ||
plugin: { ...minimal.plugin, browser: false }, | ||
}) | ||
).toHaveProperty('ui', false); | ||
expect( | ||
pluginManifestFromPluginPackage(kibanaVersion, { | ||
...minimal, | ||
plugin: { ...minimal.plugin, browser: true }, | ||
}) | ||
).toHaveProperty('ui', true); | ||
}); | ||
}); |
35 changes: 35 additions & 0 deletions
35
...plugins/core-plugins-server-internal/src/discovery/plugin_manifest_from_plugin_package.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* 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 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 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import { snakeCase } from 'lodash'; | ||
import { PluginPackageManifest } from '@kbn/repo-packages'; | ||
import { PluginManifest } from '@kbn/core-plugins-server'; | ||
import { PluginType } from '@kbn/core-base-common'; | ||
|
||
export function pluginManifestFromPluginPackage( | ||
kibanaVersion: string, | ||
manifest: PluginPackageManifest | ||
): PluginManifest { | ||
return { | ||
type: manifest.plugin.type === 'preboot' ? PluginType.preboot : PluginType.standard, | ||
id: manifest.plugin.id, | ||
version: '1.0.0', | ||
enabledOnAnonymousPages: manifest.plugin.enabledOnAnonymousPages, | ||
serviceFolders: manifest.serviceFolders, | ||
kibanaVersion, | ||
optionalPlugins: manifest.plugin.optionalPlugins ?? [], | ||
requiredBundles: manifest.plugin.requiredBundles ?? [], | ||
requiredPlugins: manifest.plugin.requiredPlugins ?? [], | ||
owner: { | ||
name: manifest.owner.join(' & '), | ||
}, | ||
server: manifest.plugin.server, | ||
ui: manifest.plugin.browser, | ||
configPath: manifest.plugin.configPath ?? snakeCase(manifest.plugin.id), | ||
}; | ||
} |
Oops, something went wrong.