Skip to content

Commit

Permalink
Merge branch 'main' into alerting/null-accessor-error
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine authored Jan 18, 2022
2 parents 84445a1 + bd57aa5 commit 0bf71fa
Show file tree
Hide file tree
Showing 208 changed files with 4,893 additions and 1,354 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ steps:
key: "performance-test-iteration-count"
hint: "How many times you want to run tests? "
required: true
if: build.env('ITERATION_COUNT_ENV') == null
if: build.env('PERF_TEST_COUNT') == null

- label: ":male-mechanic::skin-tone-2: Pre-Build"
command: .buildkite/scripts/lifecycle/pre_build.sh
Expand All @@ -19,10 +19,10 @@ steps:
queue: c2-16
key: build

- label: ":muscle: Performance Tests"
command: .buildkite/scripts/steps/functional/performance.sh
- label: ":muscle: Performance Tests with Playwright config"
command: .buildkite/scripts/steps/functional/performance_playwright.sh
agents:
queue: ci-group-6
queue: c2-16
depends_on: build

- wait: ~
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,22 @@

set -uo pipefail

if [ -z "${ITERATION_COUNT_ENV+x}" ]; then
ITERATION_COUNT="$(buildkite-agent meta-data get performance-test-iteration-count)"
if [ -z "${PERF_TEST_COUNT+x}" ]; then
TEST_COUNT="$(buildkite-agent meta-data get performance-test-iteration-count)"
else
ITERATION_COUNT=$ITERATION_COUNT_ENV
TEST_COUNT=$PERF_TEST_COUNT
fi

tput setab 2; tput setaf 0; echo "Performance test will be run at ${BUILDKITE_BRANCH} ${ITERATION_COUNT} times"
tput setab 2; tput setaf 0; echo "Performance test will be run at ${BUILDKITE_BRANCH} ${TEST_COUNT} times"

cat << EOF | buildkite-agent pipeline upload
steps:
- command: .buildkite/scripts/steps/functional/performance_sub.sh
parallelism: "$ITERATION_COUNT"
- command: .buildkite/scripts/steps/functional/performance_sub_playwright.sh
parallelism: "$TEST_COUNT"
concurrency: 20
concurrency_group: 'performance-test-group'
agents:
queue: c2-16
EOF


Expand Down
17 changes: 0 additions & 17 deletions .buildkite/scripts/steps/functional/performance_sub.sh

This file was deleted.

41 changes: 41 additions & 0 deletions .buildkite/scripts/steps/functional/performance_sub_playwright.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/usr/bin/env bash

set -euo pipefail

source .buildkite/scripts/common/util.sh

.buildkite/scripts/bootstrap.sh
.buildkite/scripts/download_build_artifacts.sh

echo --- Run Performance Tests with Playwright config

node scripts/es snapshot&

esPid=$!

export TEST_PERFORMANCE_PHASE=WARMUP
export TEST_ES_URL=http://elastic:changeme@localhost:9200
export TEST_ES_DISABLE_STARTUP=true
export ELASTIC_APM_ACTIVE=false

sleep 120

cd "$XPACK_DIR"

# warmup round 1
checks-reporter-with-killswitch "Run Performance Tests with Playwright Config (Phase: WARMUP)" \
node scripts/functional_tests \
--debug --bail \
--kibana-install-dir "$KIBANA_BUILD_LOCATION" \
--config "test/performance/config.playwright.ts";

export TEST_PERFORMANCE_PHASE=TEST
export ELASTIC_APM_ACTIVE=true

checks-reporter-with-killswitch "Run Performance Tests with Playwright Config (Phase: TEST)" \
node scripts/functional_tests \
--debug --bail \
--kibana-install-dir "$KIBANA_BUILD_LOCATION" \
--config "test/performance/config.playwright.ts";

kill "$esPid"
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -313,9 +313,11 @@
/x-pack/plugins/encrypted_saved_objects/ @elastic/kibana-security
/x-pack/plugins/security/ @elastic/kibana-security
/x-pack/test/api_integration/apis/security/ @elastic/kibana-security
/x-pack/test/api_integration/apis/spaces/ @elastic/kibana-security
/x-pack/test/ui_capabilities/ @elastic/kibana-security
/x-pack/test/encrypted_saved_objects_api_integration/ @elastic/kibana-security
/x-pack/test/functional/apps/security/ @elastic/kibana-security
/x-pack/test/functional/apps/spaces/ @elastic/kibana-security
/x-pack/test/security_api_integration/ @elastic/kibana-security
/x-pack/test/security_functional/ @elastic/kibana-security
/x-pack/test/spaces_api_integration/ @elastic/kibana-security
Expand Down
8 changes: 4 additions & 4 deletions api_docs/cases.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ import casesObj from './cases.json';

The Case management system in Kibana

Contact [Security Solution Threat Hunting](https://github.com/orgs/elastic/teams/security-threat-hunting) for questions regarding this plugin.
Contact [ResponseOps](https://github.com/orgs/elastic/teams/response-ops) for questions regarding this plugin.

**Code health stats**

| Public API count | Any count | Items lacking comments | Missing exports |
|-------------------|-----------|------------------------|-----------------|
| 83 | 0 | 57 | 23 |
| Public API count | Any count | Items lacking comments | Missing exports |
| ---------------- | --------- | ---------------------- | --------------- |
| 83 | 0 | 57 | 23 |

## Client

Expand Down
2 changes: 1 addition & 1 deletion api_docs/plugin_directory.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ warning: This document is auto-generated and is meant to be viewed inside our ex
| <DocLink id="kibBannersPluginApi" text="banners"/> | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 9 | 0 | 9 | 0 |
| <DocLink id="kibBfetchPluginApi" text="bfetch"/> | [App Services](https://github.com/orgs/elastic/teams/kibana-app-services) | Considering using bfetch capabilities when fetching large amounts of data. This services supports batching HTTP requests and streaming responses back. | 76 | 1 | 67 | 2 |
| <DocLink id="kibCanvasPluginApi" text="canvas"/> | [Kibana Presentation](https://github.com/orgs/elastic/teams/kibana-presentation) | Adds Canvas application to Kibana | 9 | 0 | 8 | 3 |
| <DocLink id="kibCasesPluginApi" text="cases"/> | [Security Solution Threat Hunting](https://github.com/orgs/elastic/teams/security-threat-hunting) | The Case management system in Kibana | 83 | 0 | 57 | 23 |
| <DocLink id="kibCasesPluginApi" text="cases"/> | [ResponseOps](https://github.com/orgs/elastic/teams/response-ops) | The Case management system in Kibana | 83 | 0 | 57 | 23 |
| <DocLink id="kibChartsPluginApi" text="charts"/> | [Vis Editors](https://github.com/orgs/elastic/teams/kibana-vis-editors) | - | 314 | 2 | 281 | 4 |
| <DocLink id="kibCloudPluginApi" text="cloud"/> | [Kibana Core](https://github.com/orgs/elastic/teams/kibana-core) | - | 22 | 0 | 22 | 0 |
| <DocLink id="kibConsolePluginApi" text="console"/> | [Stack Management](https://github.com/orgs/elastic/teams/kibana-stack-management) | - | 13 | 0 | 13 | 1 |
Expand Down
32 changes: 20 additions & 12 deletions docs/CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -134,17 +134,19 @@ The `xpack.apm.autocreateApmIndexPattern` APM setting has been removed. For more
*Impact* +
To automatically create data views in APM, use `xpack.apm.autoCreateApmDataView`.
====

[discrete]
[[deprecation-119494]]
.Updates Fleet API responses for consistency
.Updates Fleet API to improve consistency
[%collapsible]
====
*Details* +
To make sure all Fleet API GET resposes return `items`, the following have been updated:
The Fleet API has been updated to improve consistency:
* `/api/fleet/enrollment-api-keys`
* `/api/fleet/agents`
* Hyphens are changed to underscores in some names.
* The `pkgkey` path parameter in the packages endpoint is split.
* The `response` and `list` properties are renamed to `items` or `item` in some
responses.
For more information, refer to {kibana-pull}119494[#119494].
Expand All @@ -157,24 +159,30 @@ When you upgrade to 8.0.0, use the following API changes:
* Use `service_tokens` instead of `service-tokens`.
* `check-permissions` is no longer supported.
* Use `/epm/packages/{packageName}/{version}` instead of `/epm/packages/{pkgkey}`.
* Use `items[]` or `item` instead of `response[]` in the following:
* Use `items[]` instead of `response[]` in:
+
[source,text]
--
/api/fleet/enrollment_api_keys
/api/fleet/agents
/epm/packages/
/epm/packages/{pkgkey}
/epm/categories
/epm/packages/_bulk
/epm/packages/limited
/epm/packages/{packageName}/{version} <1>
--
<1> Use `items[]` when the verb is `POST` or `DELETE`. Use `item` when the verb
is `GET` or `PUT`.
For more information, refer to {fleet-guide}/fleet-api-docs.html[Fleet APIs].
====

To review the depcrecations in previous versions, refer to the <<deprecations-8.0.0-alpha1,8.0.0-alpha1 release notes>>.

To review the deprecations in previous versions, refer to the <<deprecations-8.0.0-alpha1,8.0.0-alpha1 release notes>>.


[float]
[[features-8.0.0-rc1]]
=== Features
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ export interface ElasticsearchServiceSetup
| Property | Type | Description |
| --- | --- | --- |
| [legacy](./kibana-plugin-core-server.elasticsearchservicesetup.legacy.md) | { readonly config$: Observable&lt;ElasticsearchConfig&gt;; } | |
| [setUnauthorizedErrorHandler](./kibana-plugin-core-server.elasticsearchservicesetup.setunauthorizederrorhandler.md) | (handler: UnauthorizedErrorHandler) =&gt; void | Register a handler that will be called when unauthorized (401) errors are returned from any API call to elasticsearch performed on behalf of a user via a [scoped cluster client](./kibana-plugin-core-server.iscopedclusterclient.md)<!-- -->. |

Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [ElasticsearchServiceSetup](./kibana-plugin-core-server.elasticsearchservicesetup.md) &gt; [setUnauthorizedErrorHandler](./kibana-plugin-core-server.elasticsearchservicesetup.setunauthorizederrorhandler.md)

## ElasticsearchServiceSetup.setUnauthorizedErrorHandler property

Register a handler that will be called when unauthorized (401) errors are returned from any API call to elasticsearch performed on behalf of a user via a [scoped cluster client](./kibana-plugin-core-server.iscopedclusterclient.md)<!-- -->.

<b>Signature:</b>

```typescript
setUnauthorizedErrorHandler: (handler: UnauthorizedErrorHandler) => void;
```

## Remarks

The handler will only be invoked for scoped client bound to real [request](./kibana-plugin-core-server.kibanarequest.md) instances.

## Example


```ts
const handler: UnauthorizedErrorHandler = ({ request, error }, toolkit) => {
const reauthenticationResult = await authenticator.reauthenticate(request, error);
if (reauthenticationResult.succeeded()) {
return toolkit.retry({
authHeaders: reauthenticationResult.authHeaders,
});
}
return toolkit.notHandled();
}

coreSetup.elasticsearch.setUnauthorizedErrorHandler(handler);
```

8 changes: 8 additions & 0 deletions docs/development/core/server/kibana-plugin-core-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,11 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->
| [UiSettingsParams](./kibana-plugin-core-server.uisettingsparams.md) | UiSettings parameters defined by the plugins. |
| [UiSettingsServiceSetup](./kibana-plugin-core-server.uisettingsservicesetup.md) | |
| [UiSettingsServiceStart](./kibana-plugin-core-server.uisettingsservicestart.md) | |
| [UnauthorizedErrorHandlerNotHandledResult](./kibana-plugin-core-server.unauthorizederrorhandlernothandledresult.md) | |
| [UnauthorizedErrorHandlerOptions](./kibana-plugin-core-server.unauthorizederrorhandleroptions.md) | |
| [UnauthorizedErrorHandlerResultRetryParams](./kibana-plugin-core-server.unauthorizederrorhandlerresultretryparams.md) | |
| [UnauthorizedErrorHandlerRetryResult](./kibana-plugin-core-server.unauthorizederrorhandlerretryresult.md) | |
| [UnauthorizedErrorHandlerToolkit](./kibana-plugin-core-server.unauthorizederrorhandlertoolkit.md) | Toolkit passed to a [UnauthorizedErrorHandler](./kibana-plugin-core-server.unauthorizederrorhandler.md) used to generate responses from the handler |
| [UserProvidedValues](./kibana-plugin-core-server.userprovidedvalues.md) | Describes the values explicitly set by user. |

## Variables
Expand Down Expand Up @@ -329,4 +334,7 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->
| [SharedGlobalConfig](./kibana-plugin-core-server.sharedglobalconfig.md) | |
| [StartServicesAccessor](./kibana-plugin-core-server.startservicesaccessor.md) | Allows plugins to get access to APIs available in start inside async handlers. Promise will not resolve until Core and plugin dependencies have completed <code>start</code>. This should only be used inside handlers registered during <code>setup</code> that will only be executed after <code>start</code> lifecycle. |
| [UiSettingsType](./kibana-plugin-core-server.uisettingstype.md) | UI element type to represent the settings. |
| [UnauthorizedError](./kibana-plugin-core-server.unauthorizederror.md) | |
| [UnauthorizedErrorHandler](./kibana-plugin-core-server.unauthorizederrorhandler.md) | A handler used to handle unauthorized error returned by elasticsearch |
| [UnauthorizedErrorHandlerResult](./kibana-plugin-core-server.unauthorizederrorhandlerresult.md) | |

Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [UnauthorizedError](./kibana-plugin-core-server.unauthorizederror.md)

## UnauthorizedError type


<b>Signature:</b>

```typescript
export declare type UnauthorizedError = errors.ResponseError & {
statusCode: 401;
};
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [UnauthorizedErrorHandler](./kibana-plugin-core-server.unauthorizederrorhandler.md)

## UnauthorizedErrorHandler type

A handler used to handle unauthorized error returned by elasticsearch

<b>Signature:</b>

```typescript
export declare type UnauthorizedErrorHandler = (options: UnauthorizedErrorHandlerOptions, toolkit: UnauthorizedErrorHandlerToolkit) => MaybePromise<UnauthorizedErrorHandlerResult>;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [UnauthorizedErrorHandlerNotHandledResult](./kibana-plugin-core-server.unauthorizederrorhandlernothandledresult.md)

## UnauthorizedErrorHandlerNotHandledResult interface


<b>Signature:</b>

```typescript
export interface UnauthorizedErrorHandlerNotHandledResult
```

## Properties

| Property | Type | Description |
| --- | --- | --- |
| [type](./kibana-plugin-core-server.unauthorizederrorhandlernothandledresult.type.md) | 'notHandled' | |

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [UnauthorizedErrorHandlerNotHandledResult](./kibana-plugin-core-server.unauthorizederrorhandlernothandledresult.md) &gt; [type](./kibana-plugin-core-server.unauthorizederrorhandlernothandledresult.type.md)

## UnauthorizedErrorHandlerNotHandledResult.type property

<b>Signature:</b>

```typescript
type: 'notHandled';
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [UnauthorizedErrorHandlerOptions](./kibana-plugin-core-server.unauthorizederrorhandleroptions.md) &gt; [error](./kibana-plugin-core-server.unauthorizederrorhandleroptions.error.md)

## UnauthorizedErrorHandlerOptions.error property

<b>Signature:</b>

```typescript
error: UnauthorizedError;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [UnauthorizedErrorHandlerOptions](./kibana-plugin-core-server.unauthorizederrorhandleroptions.md)

## UnauthorizedErrorHandlerOptions interface


<b>Signature:</b>

```typescript
export interface UnauthorizedErrorHandlerOptions
```

## Properties

| Property | Type | Description |
| --- | --- | --- |
| [error](./kibana-plugin-core-server.unauthorizederrorhandleroptions.error.md) | UnauthorizedError | |
| [request](./kibana-plugin-core-server.unauthorizederrorhandleroptions.request.md) | KibanaRequest | |

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [UnauthorizedErrorHandlerOptions](./kibana-plugin-core-server.unauthorizederrorhandleroptions.md) &gt; [request](./kibana-plugin-core-server.unauthorizederrorhandleroptions.request.md)

## UnauthorizedErrorHandlerOptions.request property

<b>Signature:</b>

```typescript
request: KibanaRequest;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [UnauthorizedErrorHandlerResult](./kibana-plugin-core-server.unauthorizederrorhandlerresult.md)

## UnauthorizedErrorHandlerResult type


<b>Signature:</b>

```typescript
export declare type UnauthorizedErrorHandlerResult = UnauthorizedErrorHandlerRetryResult | UnauthorizedErrorHandlerNotHandledResult;
```
Loading

0 comments on commit 0bf71fa

Please sign in to comment.