Skip to content

Commit a7d426d

Browse files
Merge branch 'master' of github.com:elastic/kibana into fix/siem-timeline-drag-and-drop
# Conflicts: # x-pack/legacy/plugins/siem/public/components/page/index.tsx
2 parents 93cde19 + f529629 commit a7d426d

593 files changed

Lines changed: 11440 additions & 6460 deletions

File tree

Some content is hidden

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

.ci/Jenkinsfile_flaky

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,13 @@
33
library 'kibana-pipeline-library'
44
kibanaLibrary.load()
55

6-
// Looks like 'oss:ciGroup:1' or 'oss:firefoxSmoke'
7-
def JOB_PARTS = params.CI_GROUP.split(':')
6+
def CI_GROUP_PARAM = params.CI_GROUP
7+
8+
// Looks like 'oss:ciGroup:1', 'oss:firefoxSmoke', or 'all:serverMocha'
9+
def JOB_PARTS = CI_GROUP_PARAM.split(':')
810
def IS_XPACK = JOB_PARTS[0] == 'xpack'
911
def JOB = JOB_PARTS[1]
12+
def NEED_BUILD = JOB != 'serverMocha'
1013
def CI_GROUP = JOB_PARTS.size() > 2 ? JOB_PARTS[2] : ''
1114
def EXECUTIONS = params.NUMBER_EXECUTIONS.toInteger()
1215
def AGENT_COUNT = getAgentCount(EXECUTIONS)
@@ -31,13 +34,15 @@ stage("Kibana Pipeline") {
3134
print "Agent ${agentNumberInside} - ${agentExecutions} executions"
3235

3336
kibanaPipeline.withWorkers('flaky-test-runner', {
34-
if (!IS_XPACK) {
35-
kibanaPipeline.buildOss()
36-
if (CI_GROUP == '1') {
37-
runbld("./test/scripts/jenkins_build_kbn_tp_sample_panel_action.sh", "Build kbn tp sample panel action for ciGroup1")
37+
if (NEED_BUILD) {
38+
if (!IS_XPACK) {
39+
kibanaPipeline.buildOss()
40+
if (CI_GROUP == '1') {
41+
runbld("./test/scripts/jenkins_build_kbn_tp_sample_panel_action.sh", "Build kbn tp sample panel action for ciGroup1")
42+
}
43+
} else {
44+
kibanaPipeline.buildXpack()
3845
}
39-
} else {
40-
kibanaPipeline.buildXpack()
4146
}
4247
}, getWorkerMap(agentNumberInside, agentExecutions, worker, workerFailures))()
4348
}
@@ -61,7 +66,17 @@ stage("Kibana Pipeline") {
6166

6267
def getWorkerFromParams(isXpack, job, ciGroup) {
6368
if (!isXpack) {
64-
if (job == 'firefoxSmoke') {
69+
if (job == 'serverMocha') {
70+
return kibanaPipeline.getPostBuildWorker('serverMocha', {
71+
kibanaPipeline.bash(
72+
"""
73+
source src/dev/ci_setup/setup_env.sh
74+
node scripts/mocha
75+
""",
76+
"run `node scripts/mocha`"
77+
)
78+
})
79+
} else if (job == 'firefoxSmoke') {
6580
return kibanaPipeline.getPostBuildWorker('firefoxSmoke', { runbld('./test/scripts/jenkins_firefox_smoke.sh', 'Execute kibana-firefoxSmoke') })
6681
} else if(job == 'visualRegression') {
6782
return kibanaPipeline.getPostBuildWorker('visualRegression', { runbld('./test/scripts/jenkins_visual_regression.sh', 'Execute kibana-visualRegression') })

.eslintrc.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,6 @@ module.exports = {
6464
'jsx-a11y/no-onchange': 'off',
6565
},
6666
},
67-
{
68-
files: ['src/legacy/core_plugins/console/**/*.{js,ts,tsx}'],
69-
rules: {
70-
'react-hooks/exhaustive-deps': 'off',
71-
},
72-
},
7367
{
7468
files: ['src/legacy/core_plugins/data/**/*.{js,ts,tsx}'],
7569
rules: {

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
/x-pack/test/functional/services/transform.ts @elastic/ml-ui
4646

4747
# Operations
48-
/renovate.json5 @elastic/kibana-operations
4948
/src/dev/ @elastic/kibana-operations
5049
/src/setup_node_env/ @elastic/kibana-operations
5150
/src/optimize/ @elastic/kibana-operations
@@ -62,6 +61,7 @@
6261
/config/kibana.yml @elastic/kibana-platform
6362
/x-pack/plugins/features/ @elastic/kibana-platform
6463
/x-pack/plugins/licensing/ @elastic/kibana-platform
64+
/packages/kbn-config-schema/ @elastic/kibana-platform
6565

6666
# Security
6767
/x-pack/legacy/plugins/security/ @elastic/kibana-security

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ Register a route handler for `DELETE` request.
99
<b>Signature:</b>
1010

1111
```typescript
12-
delete: <P extends ObjectType, Q extends ObjectType, B extends ObjectType>(route: RouteConfig<P, Q, B>, handler: RequestHandler<P, Q, B>) => void;
12+
delete: RouteRegistrar;
1313
```

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ Register a route handler for `GET` request.
99
<b>Signature:</b>
1010

1111
```typescript
12-
get: <P extends ObjectType, Q extends ObjectType, B extends ObjectType>(route: RouteConfig<P, Q, B>, handler: RequestHandler<P, Q, B>) => void;
12+
get: RouteRegistrar;
1313
```
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [kibana-plugin-server](./kibana-plugin-server.md) &gt; [IRouter](./kibana-plugin-server.irouter.md) &gt; [handleLegacyErrors](./kibana-plugin-server.irouter.handlelegacyerrors.md)
4+
5+
## IRouter.handleLegacyErrors property
6+
7+
Wrap a router handler to catch and converts legacy boom errors to proper custom errors.
8+
9+
<b>Signature:</b>
10+
11+
```typescript
12+
handleLegacyErrors: <P extends ObjectType, Q extends ObjectType, B extends ObjectType>(handler: RequestHandler<P, Q, B>) => RequestHandler<P, Q, B>;
13+
```

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@ export interface IRouter
1616

1717
| Property | Type | Description |
1818
| --- | --- | --- |
19-
| [delete](./kibana-plugin-server.irouter.delete.md) | <code>&lt;P extends ObjectType, Q extends ObjectType, B extends ObjectType&gt;(route: RouteConfig&lt;P, Q, B&gt;, handler: RequestHandler&lt;P, Q, B&gt;) =&gt; void</code> | Register a route handler for <code>DELETE</code> request. |
20-
| [get](./kibana-plugin-server.irouter.get.md) | <code>&lt;P extends ObjectType, Q extends ObjectType, B extends ObjectType&gt;(route: RouteConfig&lt;P, Q, B&gt;, handler: RequestHandler&lt;P, Q, B&gt;) =&gt; void</code> | Register a route handler for <code>GET</code> request. |
21-
| [post](./kibana-plugin-server.irouter.post.md) | <code>&lt;P extends ObjectType, Q extends ObjectType, B extends ObjectType&gt;(route: RouteConfig&lt;P, Q, B&gt;, handler: RequestHandler&lt;P, Q, B&gt;) =&gt; void</code> | Register a route handler for <code>POST</code> request. |
22-
| [put](./kibana-plugin-server.irouter.put.md) | <code>&lt;P extends ObjectType, Q extends ObjectType, B extends ObjectType&gt;(route: RouteConfig&lt;P, Q, B&gt;, handler: RequestHandler&lt;P, Q, B&gt;) =&gt; void</code> | Register a route handler for <code>PUT</code> request. |
19+
| [delete](./kibana-plugin-server.irouter.delete.md) | <code>RouteRegistrar</code> | Register a route handler for <code>DELETE</code> request. |
20+
| [get](./kibana-plugin-server.irouter.get.md) | <code>RouteRegistrar</code> | Register a route handler for <code>GET</code> request. |
21+
| [handleLegacyErrors](./kibana-plugin-server.irouter.handlelegacyerrors.md) | <code>&lt;P extends ObjectType, Q extends ObjectType, B extends ObjectType&gt;(handler: RequestHandler&lt;P, Q, B&gt;) =&gt; RequestHandler&lt;P, Q, B&gt;</code> | Wrap a router handler to catch and converts legacy boom errors to proper custom errors. |
22+
| [post](./kibana-plugin-server.irouter.post.md) | <code>RouteRegistrar</code> | Register a route handler for <code>POST</code> request. |
23+
| [put](./kibana-plugin-server.irouter.put.md) | <code>RouteRegistrar</code> | Register a route handler for <code>PUT</code> request. |
2324
| [routerPath](./kibana-plugin-server.irouter.routerpath.md) | <code>string</code> | Resulted path |
2425

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ Register a route handler for `POST` request.
99
<b>Signature:</b>
1010

1111
```typescript
12-
post: <P extends ObjectType, Q extends ObjectType, B extends ObjectType>(route: RouteConfig<P, Q, B>, handler: RequestHandler<P, Q, B>) => void;
12+
post: RouteRegistrar;
1313
```

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ Register a route handler for `PUT` request.
99
<b>Signature:</b>
1010

1111
```typescript
12-
put: <P extends ObjectType, Q extends ObjectType, B extends ObjectType>(route: RouteConfig<P, Q, B>, handler: RequestHandler<P, Q, B>) => void;
12+
put: RouteRegistrar;
1313
```

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->
170170
| [ResponseErrorAttributes](./kibana-plugin-server.responseerrorattributes.md) | Additional data to provide error details. |
171171
| [ResponseHeaders](./kibana-plugin-server.responseheaders.md) | Http response headers to set. |
172172
| [RouteMethod](./kibana-plugin-server.routemethod.md) | The set of common HTTP methods supported by Kibana routing. |
173+
| [RouteRegistrar](./kibana-plugin-server.routeregistrar.md) | Handler to declare a route. |
173174
| [SavedObjectAttribute](./kibana-plugin-server.savedobjectattribute.md) | Type definition for a Saved Object attribute value |
174175
| [SavedObjectAttributeSingle](./kibana-plugin-server.savedobjectattributesingle.md) | Don't use this type, it's simply a helper type for [SavedObjectAttribute](./kibana-plugin-server.savedobjectattribute.md) |
175176
| [SavedObjectsClientContract](./kibana-plugin-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-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-server.savedobjectsclient.md) See [SavedObjectsErrorHelpers](./kibana-plugin-server.savedobjectserrorhelpers.md) |

0 commit comments

Comments
 (0)