Skip to content

Commit 0f7ce01

Browse files
committed
Merge branch 'master' into np/es-ui-cleanup
2 parents 6d70a6a + 75fa843 commit 0f7ce01

File tree

1,168 files changed

+21625
-14933
lines changed

Some content is hidden

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

1,168 files changed

+21625
-14933
lines changed

.eslintrc.js

Lines changed: 37 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -185,31 +185,40 @@ module.exports = {
185185
zones: [
186186
{
187187
target: [
188-
'src/legacy/**/*',
189-
'x-pack/**/*',
190-
'!x-pack/**/*.test.*',
191-
'!x-pack/test/**/*',
188+
'(src|x-pack)/legacy/**/*',
192189
'(src|x-pack)/plugins/**/(public|server)/**/*',
193-
'src/core/(public|server)/**/*',
194190
'examples/**/*',
195191
],
196192
from: [
197193
'src/core/public/**/*',
198-
'!src/core/public/index.ts',
199-
'!src/core/public/mocks.ts',
200-
'!src/core/public/*.test.mocks.ts',
194+
'!src/core/public/index.ts', // relative import
195+
'!src/core/public/mocks{,.ts}',
196+
'!src/core/server/types{,.ts}',
201197
'!src/core/public/utils/**/*',
198+
'!src/core/public/*.test.mocks{,.ts}',
202199

203200
'src/core/server/**/*',
204-
'!src/core/server/index.ts',
205-
'!src/core/server/mocks.ts',
206-
'!src/core/server/types.ts',
207-
'!src/core/server/test_utils.ts',
201+
'!src/core/server/index.ts', // relative import
202+
'!src/core/server/mocks{,.ts}',
203+
'!src/core/server/types{,.ts}',
204+
'!src/core/server/test_utils',
208205
// for absolute imports until fixed in
209206
// https://github.com/elastic/kibana/issues/36096
210-
'!src/core/server/types',
211-
'!src/core/server/*.test.mocks.ts',
212-
207+
'!src/core/server/*.test.mocks{,.ts}',
208+
],
209+
allowSameFolder: true,
210+
errorMessage:
211+
'Plugins may only import from top-level public and server modules in core.',
212+
},
213+
{
214+
target: [
215+
'(src|x-pack)/legacy/**/*',
216+
'(src|x-pack)/plugins/**/(public|server)/**/*',
217+
'examples/**/*',
218+
'!(src|x-pack)/**/*.test.*',
219+
'!(x-pack/)?test/**/*',
220+
],
221+
from: [
213222
'(src|x-pack)/plugins/**/(public|server)/**/*',
214223
'!(src|x-pack)/plugins/**/(public|server)/(index|mocks).{js,ts,tsx}',
215224
],
@@ -730,6 +739,19 @@ module.exports = {
730739
},
731740
},
732741

742+
/**
743+
* Alerting Services overrides
744+
*/
745+
{
746+
// typescript only for front and back end
747+
files: [
748+
'x-pack/{,legacy/}plugins/{alerting,alerting_builtins,actions,task_manager,event_log}/**/*.{ts,tsx}',
749+
],
750+
rules: {
751+
'@typescript-eslint/no-explicit-any': 'error',
752+
},
753+
},
754+
733755
/**
734756
* Lens overrides
735757
*/

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
/src/plugins/vis_type_timelion/ @elastic/kibana-app
1919
/src/plugins/dashboard/ @elastic/kibana-app
2020
/src/plugins/discover/ @elastic/kibana-app
21+
/src/plugins/input_control_vis/ @elastic/kibana-app
2122
/src/plugins/visualize/ @elastic/kibana-app
2223
/src/plugins/vis_type_timeseries/ @elastic/kibana-app
2324
/src/plugins/vis_type_metric/ @elastic/kibana-app

.i18nrc.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"esUi": "src/plugins/es_ui_shared",
1515
"devTools": "src/plugins/dev_tools",
1616
"expressions": "src/plugins/expressions",
17-
"inputControl": "src/legacy/core_plugins/input_control_vis",
17+
"inputControl": "src/plugins/input_control_vis",
1818
"inspector": "src/plugins/inspector",
1919
"inspectorViews": "src/legacy/core_plugins/inspector_views",
2020
"interpreter": "src/legacy/core_plugins/interpreter",
@@ -51,7 +51,7 @@
5151
"visTypeTable": "src/plugins/vis_type_table",
5252
"visTypeTagCloud": "src/plugins/vis_type_tagcloud",
5353
"visTypeTimeseries": ["src/legacy/core_plugins/vis_type_timeseries", "src/plugins/vis_type_timeseries"],
54-
"visTypeVega": "src/legacy/core_plugins/vis_type_vega",
54+
"visTypeVega": "src/plugins/vis_type_vega",
5555
"visTypeVislib": "src/legacy/core_plugins/vis_type_vislib",
5656
"visTypeXy": "src/legacy/core_plugins/vis_type_xy",
5757
"visualizations": "src/plugins/visualizations",

.sass-lint.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ files:
44
- 'src/legacy/core_plugins/timelion/**/*.s+(a|c)ss'
55
- 'src/legacy/core_plugins/vis_type_vislib/**/*.s+(a|c)ss'
66
- 'src/legacy/core_plugins/vis_type_xy/**/*.s+(a|c)ss'
7-
- 'x-pack/legacy/plugins/rollup/**/*.s+(a|c)ss'
87
- 'x-pack/legacy/plugins/security/**/*.s+(a|c)ss'
98
- 'x-pack/legacy/plugins/canvas/**/*.s+(a|c)ss'
109
- 'x-pack/plugins/triggers_actions_ui/**/*.s+(a|c)ss'

Jenkinsfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ kibanaPipeline(timeoutMinutes: 135, checkPrChanges: true) {
1111
'kibana-intake-agent': workers.intake('kibana-intake', './test/scripts/jenkins_unit.sh'),
1212
'x-pack-intake-agent': workers.intake('x-pack-intake', './test/scripts/jenkins_xpack.sh'),
1313
'kibana-oss-agent': workers.functional('kibana-oss-tests', { kibanaPipeline.buildOss() }, [
14-
// 'oss-firefoxSmoke': kibanaPipeline.functionalTestProcess('kibana-firefoxSmoke', './test/scripts/jenkins_firefox_smoke.sh'),
14+
'oss-firefoxSmoke': kibanaPipeline.functionalTestProcess('kibana-firefoxSmoke', './test/scripts/jenkins_firefox_smoke.sh'),
1515
'oss-ciGroup1': kibanaPipeline.ossCiGroupProcess(1),
1616
'oss-ciGroup2': kibanaPipeline.ossCiGroupProcess(2),
1717
'oss-ciGroup3': kibanaPipeline.ossCiGroupProcess(3),
@@ -28,7 +28,7 @@ kibanaPipeline(timeoutMinutes: 135, checkPrChanges: true) {
2828
// 'oss-visualRegression': kibanaPipeline.functionalTestProcess('visualRegression', './test/scripts/jenkins_visual_regression.sh'),
2929
]),
3030
'kibana-xpack-agent': workers.functional('kibana-xpack-tests', { kibanaPipeline.buildXpack() }, [
31-
// 'xpack-firefoxSmoke': kibanaPipeline.functionalTestProcess('xpack-firefoxSmoke', './test/scripts/jenkins_xpack_firefox_smoke.sh'),
31+
'xpack-firefoxSmoke': kibanaPipeline.functionalTestProcess('xpack-firefoxSmoke', './test/scripts/jenkins_xpack_firefox_smoke.sh'),
3232
'xpack-ciGroup1': kibanaPipeline.xpackCiGroupProcess(1),
3333
'xpack-ciGroup2': kibanaPipeline.xpackCiGroupProcess(2),
3434
'xpack-ciGroup3': kibanaPipeline.xpackCiGroupProcess(3),

docs/developer/core/development-functional-tests.asciidoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,16 +154,16 @@ A test suite is a collection of tests defined by calling `describe()`, and then
154154
Use tags in `describe()` function to group functional tests. Tags include:
155155
* `ciGroup{id}` - Assigns test suite to a specific CI worker
156156
* `skipCloud` and `skipFirefox` - Excludes test suite from running on Cloud or Firefox
157-
* `smoke` - Groups tests that run on Chrome and Firefox
157+
* `includeFirefox` - Groups tests that run on Chrome and Firefox
158158

159159
**Cross-browser testing**:::
160-
On CI, all the functional tests are executed in Chrome by default. To also run a suite against Firefox, assign the `smoke` tag:
160+
On CI, all the functional tests are executed in Chrome by default. To also run a suite against Firefox, assign the `includeFirefox` tag:
161161

162162
["source","js"]
163163
-----------
164164
// on CI test suite will be run twice: in Chrome and Firefox
165165
describe('My Cross-browser Test Suite', function () {
166-
this.tags('smoke');
166+
this.tags('includeFirefox');
167167
168168
it('My First Test');
169169
}

docs/development/core/server/kibana-plugin-core-server.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -263,14 +263,14 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->
263263
| [SavedObjectAttribute](./kibana-plugin-core-server.savedobjectattribute.md) | Type definition for a Saved Object attribute value |
264264
| [SavedObjectAttributeSingle](./kibana-plugin-core-server.savedobjectattributesingle.md) | Don't use this type, it's simply a helper type for [SavedObjectAttribute](./kibana-plugin-core-server.savedobjectattribute.md) |
265265
| [SavedObjectMigrationFn](./kibana-plugin-core-server.savedobjectmigrationfn.md) | A migration function for a [saved object type](./kibana-plugin-core-server.savedobjectstype.md) used to migrate it to a given version |
266-
| [SavedObjectSanitizedDoc](./kibana-plugin-core-server.savedobjectsanitizeddoc.md) | |
267-
| [SavedObjectsClientContract](./kibana-plugin-core-server.savedobjectsclientcontract.md) | Saved Objects is Kibana's data persisentence mechanism allowing plugins to use Elasticsearch for storing plugin state.<!-- -->\#\# SavedObjectsClient errors<!-- -->Since the SavedObjectsClient has its hands in everything we are a little paranoid about the way we present errors back to to application code. Ideally, all errors will be either:<!-- -->1. Caused by bad implementation (ie. undefined is not a function) and as such unpredictable 2. An error that has been classified and decorated appropriately by the decorators in [SavedObjectsErrorHelpers](./kibana-plugin-core-server.savedobjectserrorhelpers.md)<!-- -->Type 1 errors are inevitable, but since all expected/handle-able errors should be Type 2 the <code>isXYZError()</code> helpers exposed at <code>SavedObjectsErrorHelpers</code> should be used to understand and manage error responses from the <code>SavedObjectsClient</code>.<!-- -->Type 2 errors are decorated versions of the source error, so if the elasticsearch client threw an error it will be decorated based on its type. That means that rather than looking for <code>error.body.error.type</code> or doing substring checks on <code>error.body.error.reason</code>, just use the helpers to understand the meaning of the error:<!-- -->\`\`\`<!-- -->js if (SavedObjectsErrorHelpers.isNotFoundError(error)) { // handle 404 }<!-- -->if (SavedObjectsErrorHelpers.isNotAuthorizedError(error)) { // 401 handling should be automatic, but in case you wanted to know }<!-- -->// always rethrow the error unless you handle it throw error; \`\`\`<!-- -->\#\#\# 404s from missing index<!-- -->From the perspective of application code and APIs the SavedObjectsClient is a black box that persists objects. One of the internal details that users have no control over is that we use an elasticsearch index for persistance and that index might be missing.<!-- -->At the time of writing we are in the process of transitioning away from the operating assumption that the SavedObjects index is always available. Part of this transition is handling errors resulting from an index missing. These used to trigger a 500 error in most cases, and in others cause 404s with different error messages.<!-- -->From my (Spencer) perspective, a 404 from the SavedObjectsApi is a 404; The object the request/call was targeting could not be found. This is why \#14141 takes special care to ensure that 404 errors are generic and don't distinguish between index missing or document missing.<!-- -->\#\#\# 503s from missing index<!-- -->Unlike all other methods, create requests are supposed to succeed even when the Kibana index does not exist because it will be automatically created by elasticsearch. When that is not the case it is because Elasticsearch's <code>action.auto_create_index</code> setting prevents it from being created automatically so we throw a special 503 with the intention of informing the user that their Elasticsearch settings need to be updated.<!-- -->See [SavedObjectsClient](./kibana-plugin-core-server.savedobjectsclient.md) See [SavedObjectsErrorHelpers](./kibana-plugin-core-server.savedobjectserrorhelpers.md) |
266+
| [SavedObjectSanitizedDoc](./kibana-plugin-core-server.savedobjectsanitizeddoc.md) | Describes Saved Object documents that have passed through the migration framework and are guaranteed to have a <code>references</code> root property. |
267+
| [SavedObjectsClientContract](./kibana-plugin-core-server.savedobjectsclientcontract.md) | Saved Objects is Kibana's data persisentence mechanism allowing plugins to use Elasticsearch for storing plugin state.<!-- -->\#\# SavedObjectsClient errors<!-- -->Since the SavedObjectsClient has its hands in everything we are a little paranoid about the way we present errors back to to application code. Ideally, all errors will be either:<!-- -->1. Caused by bad implementation (ie. undefined is not a function) and as such unpredictable 2. An error that has been classified and decorated appropriately by the decorators in [SavedObjectsErrorHelpers](./kibana-plugin-core-server.savedobjectserrorhelpers.md)<!-- -->Type 1 errors are inevitable, but since all expected/handle-able errors should be Type 2 the <code>isXYZError()</code> helpers exposed at <code>SavedObjectsErrorHelpers</code> should be used to understand and manage error responses from the <code>SavedObjectsClient</code>.<!-- -->Type 2 errors are decorated versions of the source error, so if the elasticsearch client threw an error it will be decorated based on its type. That means that rather than looking for <code>error.body.error.type</code> or doing substring checks on <code>error.body.error.reason</code>, just use the helpers to understand the meaning of the error:<!-- -->\`\`\`<!-- -->js if (SavedObjectsErrorHelpers.isNotFoundError(error)) { // handle 404 }<!-- -->if (SavedObjectsErrorHelpers.isNotAuthorizedError(error)) { // 401 handling should be automatic, but in case you wanted to know }<!-- -->// always rethrow the error unless you handle it throw error; \`\`\`<!-- -->\#\#\# 404s from missing index<!-- -->From the perspective of application code and APIs the SavedObjectsClient is a black box that persists objects. One of the internal details that users have no control over is that we use an elasticsearch index for persistance and that index might be missing.<!-- -->At the time of writing we are in the process of transitioning away from the operating assumption that the SavedObjects index is always available. Part of this transition is handling errors resulting from an index missing. These used to trigger a 500 error in most cases, and in others cause 404s with different error messages.<!-- -->From my (Spencer) perspective, a 404 from the SavedObjectsApi is a 404; The object the request/call was targeting could not be found. This is why \#14141 takes special care to ensure that 404 errors are generic and don't distinguish between index missing or document missing.<!-- -->See [SavedObjectsClient](./kibana-plugin-core-server.savedobjectsclient.md) See [SavedObjectsErrorHelpers](./kibana-plugin-core-server.savedobjectserrorhelpers.md) |
268268
| [SavedObjectsClientFactory](./kibana-plugin-core-server.savedobjectsclientfactory.md) | Describes the factory used to create instances of the Saved Objects Client. |
269269
| [SavedObjectsClientFactoryProvider](./kibana-plugin-core-server.savedobjectsclientfactoryprovider.md) | Provider to invoke to retrieve a [SavedObjectsClientFactory](./kibana-plugin-core-server.savedobjectsclientfactory.md)<!-- -->. |
270270
| [SavedObjectsClientWrapperFactory](./kibana-plugin-core-server.savedobjectsclientwrapperfactory.md) | Describes the factory used to create instances of Saved Objects Client Wrappers. |
271271
| [SavedObjectsFieldMapping](./kibana-plugin-core-server.savedobjectsfieldmapping.md) | Describe a [saved object type mapping](./kibana-plugin-core-server.savedobjectstypemappingdefinition.md) field.<!-- -->Please refer to [elasticsearch documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-types.html) For the mapping documentation |
272272
| [SavedObjectsNamespaceType](./kibana-plugin-core-server.savedobjectsnamespacetype.md) | The namespace type dictates how a saved object can be interacted in relation to namespaces. Each type is mutually exclusive: \* single (default): this type of saved object is namespace-isolated, e.g., it exists in only one namespace. \* multiple: this type of saved object is shareable, e.g., it can exist in one or more namespaces. \* agnostic: this type of saved object is global.<!-- -->Note: do not write logic that uses this value directly; instead, use the appropriate accessors in the [type registry](./kibana-plugin-core-server.savedobjecttyperegistry.md)<!-- -->. |
273-
| [SavedObjectUnsanitizedDoc](./kibana-plugin-core-server.savedobjectunsanitizeddoc.md) | We want to have two types, one that guarantees a "references" attribute will exist and one that allows it to be null. Since we're not migrating all the saved objects to have a "references" array, we need to support the scenarios where it may be missing (ex migrations). |
273+
| [SavedObjectUnsanitizedDoc](./kibana-plugin-core-server.savedobjectunsanitizeddoc.md) | Describes Saved Object documents from Kibana &lt; 7.0.0 which don't have a <code>references</code> root property defined. This type should only be used in migrations. |
274274
| [ScopeableRequest](./kibana-plugin-core-server.scopeablerequest.md) | A user credentials container. It accommodates the necessary auth credentials to impersonate the current user.<!-- -->See [KibanaRequest](./kibana-plugin-core-server.kibanarequest.md)<!-- -->. |
275275
| [ServiceStatusLevel](./kibana-plugin-core-server.servicestatuslevel.md) | A convenience type that represents the union of each value in [ServiceStatusLevels](./kibana-plugin-core-server.servicestatuslevels.md)<!-- -->. |
276276
| [SharedGlobalConfig](./kibana-plugin-core-server.sharedglobalconfig.md) | |

docs/development/core/server/kibana-plugin-core-server.savedobjectsanitizeddoc.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
## SavedObjectSanitizedDoc type
66

7+
Describes Saved Object documents that have passed through the migration framework and are guaranteed to have a `references` root property.
78

89
<b>Signature:</b>
910

docs/development/core/server/kibana-plugin-core-server.savedobjectsclientcontract.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,6 @@ At the time of writing we are in the process of transitioning away from the oper
3030

3131
From my (Spencer) perspective, a 404 from the SavedObjectsApi is a 404; The object the request/call was targeting could not be found. This is why \#14141 takes special care to ensure that 404 errors are generic and don't distinguish between index missing or document missing.
3232

33-
\#\#\# 503s from missing index
34-
35-
Unlike all other methods, create requests are supposed to succeed even when the Kibana index does not exist because it will be automatically created by elasticsearch. When that is not the case it is because Elasticsearch's `action.auto_create_index` setting prevents it from being created automatically so we throw a special 503 with the intention of informing the user that their Elasticsearch settings need to be updated.
36-
3733
See [SavedObjectsClient](./kibana-plugin-core-server.savedobjectsclient.md) See [SavedObjectsErrorHelpers](./kibana-plugin-core-server.savedobjectserrorhelpers.md)
3834

3935
<b>Signature:</b>

docs/development/core/server/kibana-plugin-core-server.savedobjectserrorhelpers.createesautocreateindexerror.md

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)