Skip to content

Commit

Permalink
Merge branch 'main' into discover-help
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine authored Feb 16, 2022
2 parents 72165b8 + cf25ac3 commit 9c16b12
Show file tree
Hide file tree
Showing 616 changed files with 23,630 additions and 6,056 deletions.
11 changes: 11 additions & 0 deletions .buildkite/pipelines/docker_context.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
steps:
- command: .buildkite/scripts/steps/docker_context/build.sh
label: 'Docker Build Context'
agents:
queue: n2-4
timeout_in_minutes: 30
key: build-docker-context
retry:
automatic:
- exit_status: '*'
limit: 1
1 change: 1 addition & 0 deletions .buildkite/pipelines/es_snapshots/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ steps:

- command: .buildkite/scripts/steps/test/jest_integration.sh
label: 'Jest Integration Tests'
parallelism: 2
agents:
queue: n2-4
timeout_in_minutes: 120
Expand Down
3 changes: 2 additions & 1 deletion .buildkite/pipelines/hourly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,10 @@ steps:

- command: .buildkite/scripts/steps/test/jest_integration.sh
label: 'Jest Integration Tests'
parallelism: 2
agents:
queue: n2-4
timeout_in_minutes: 120
timeout_in_minutes: 90
key: jest-integration

- command: .buildkite/scripts/steps/test/api_integration.sh
Expand Down
8 changes: 8 additions & 0 deletions .buildkite/pipelines/on_merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,20 @@ steps:
agents:
queue: c2-8
timeout_in_minutes: 60
retry:
automatic:
- exit_status: '*'
limit: 1

- command: .buildkite/scripts/steps/on_merge_ts_refs_api_docs.sh
label: Build TS Refs and Check Public API Docs
agents:
queue: c2-4
timeout_in_minutes: 80
retry:
automatic:
- exit_status: '*'
limit: 1

- wait: ~
continue_on_failure: true
Expand Down
3 changes: 2 additions & 1 deletion .buildkite/pipelines/pull_request/base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,10 @@ steps:

- command: .buildkite/scripts/steps/test/jest_integration.sh
label: 'Jest Integration Tests'
parallelism: 2
agents:
queue: n2-4
timeout_in_minutes: 120
timeout_in_minutes: 90
key: jest-integration

- command: .buildkite/scripts/steps/test/api_integration.sh
Expand Down
19 changes: 12 additions & 7 deletions .buildkite/scripts/steps/cloud/build_and_deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,16 @@ node scripts/build \
CLOUD_IMAGE=$(docker images --format "{{.Repository}}:{{.Tag}}" docker.elastic.co/kibana-ci/kibana-cloud)
CLOUD_DEPLOYMENT_NAME="kibana-pr-$BUILDKITE_PULL_REQUEST"

jq '
.resources.kibana[0].plan.kibana.docker_image = "'$CLOUD_IMAGE'" |
.name = "'$CLOUD_DEPLOYMENT_NAME'" |
.resources.kibana[0].plan.kibana.version = "'$VERSION'" |
.resources.elasticsearch[0].plan.elasticsearch.version = "'$VERSION'"
' .buildkite/scripts/steps/cloud/deploy.json > /tmp/deploy.json

CLOUD_DEPLOYMENT_ID=$(ecctl deployment list --output json | jq -r '.deployments[] | select(.name == "'$CLOUD_DEPLOYMENT_NAME'") | .id')
JSON_FILE=$(mktemp --suffix ".json")
if [ -z "${CLOUD_DEPLOYMENT_ID}" ]; then
jq '
.resources.kibana[0].plan.kibana.docker_image = "'$CLOUD_IMAGE'" |
.name = "'$CLOUD_DEPLOYMENT_NAME'" |
.resources.kibana[0].plan.kibana.version = "'$VERSION'" |
.resources.elasticsearch[0].plan.elasticsearch.version = "'$VERSION'"
' .buildkite/scripts/steps/cloud/deploy.json > /tmp/deploy.json

ecctl deployment create --track --output json --file /tmp/deploy.json &> "$JSON_FILE"
CLOUD_DEPLOYMENT_USERNAME=$(jq --slurp '.[]|select(.resources).resources[] | select(.credentials).credentials.username' "$JSON_FILE")
CLOUD_DEPLOYMENT_PASSWORD=$(jq --slurp '.[]|select(.resources).resources[] | select(.credentials).credentials.password' "$JSON_FILE")
Expand All @@ -59,6 +59,11 @@ if [ -z "${CLOUD_DEPLOYMENT_ID}" ]; then

retry 5 5 vault write "secret/kibana-issues/dev/cloud-deploy/$CLOUD_DEPLOYMENT_NAME" username="$CLOUD_DEPLOYMENT_USERNAME" password="$CLOUD_DEPLOYMENT_PASSWORD"
else
ecctl deployment show "$CLOUD_DEPLOYMENT_ID" --generate-update-payload | jq '
.resources.kibana[0].plan.kibana.docker_image = "'$CLOUD_IMAGE'" |
.resources.kibana[0].plan.kibana.version = "'$VERSION'" |
.resources.elasticsearch[0].plan.elasticsearch.version = "'$VERSION'"
' > /tmp/deploy.json
ecctl deployment update "$CLOUD_DEPLOYMENT_ID" --track --output json --file /tmp/deploy.json &> "$JSON_FILE"
fi

Expand Down
4 changes: 2 additions & 2 deletions .buildkite/scripts/steps/code_coverage/jest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ is_test_execution_step

echo '--- Jest code coverage'

.buildkite/scripts/steps/code_coverage/jest_parallel.sh
.buildkite/scripts/steps/code_coverage/jest_parallel.sh jest.config.js

tar -czf kibana-jest-thread-coverage.tar.gz target/kibana-coverage/jest

echo "--- Merging code coverage for a thread"
yarn nyc report --nycrc-path src/dev/code_coverage/nyc_config/nyc.jest.config.js --reporter json
rm -rf target/kibana-coverage/jest/*
mv target/kibana-coverage/jest-combined/coverage-final.json "target/kibana-coverage/jest/jest-merged-coverage-$(date +%s%3N).json"
mv target/kibana-coverage/jest-combined/coverage-final.json "target/kibana-coverage/jest/jest-merged-coverage-$(date +%s%3N).json"
16 changes: 16 additions & 0 deletions .buildkite/scripts/steps/docker_context/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

set -euo pipefail

.buildkite/scripts/bootstrap.sh

echo "--- Create Kibana Docker contexts"
mkdir -p target
node scripts/build --skip-initialize --skip-generic-folders --skip-platform-folders --skip-archives

echo "--- Build default context"
DOCKER_BUILD_FOLDER=$(mktemp -d)

tar -xf target/kibana-[0-9]*-docker-build-context.tar.gz -C "$DOCKER_BUILD_FOLDER"
cd $DOCKER_BUILD_FOLDER
docker build .
3 changes: 1 addition & 2 deletions .buildkite/scripts/steps/storybooks/build_and_upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ const STORYBOOKS = [
'canvas',
'ci_composite',
'cloud',
'codeeditor',
'custom_integrations',
'dashboard_enhanced',
'dashboard',
Expand All @@ -31,13 +30,13 @@ const STORYBOOKS = [
'expression_tagcloud',
'fleet',
'infra',
'kibana_react',
'lists',
'observability',
'presentation',
'security_solution',
'shared_ux',
'ui_actions_enhanced',
'url_template_editor',
];

const GITHUB_CONTEXT = 'Build and Publish Storybooks';
Expand Down
2 changes: 1 addition & 1 deletion .buildkite/scripts/steps/test/jest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ is_test_execution_step

echo '--- Jest'
checks-reporter-with-killswitch "Jest Unit Tests $((BUILDKITE_PARALLEL_JOB+1))" \
.buildkite/scripts/steps/test/jest_parallel.sh
.buildkite/scripts/steps/test/jest_parallel.sh jest.config.js
4 changes: 2 additions & 2 deletions .buildkite/scripts/steps/test/jest_integration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ is_test_execution_step
.buildkite/scripts/bootstrap.sh

echo '--- Jest Integration Tests'
checks-reporter-with-killswitch "Jest Integration Tests" \
node --max-old-space-size=6144 scripts/jest_integration --ci
checks-reporter-with-killswitch "Jest Integration Tests $((BUILDKITE_PARALLEL_JOB+1))" \
.buildkite/scripts/steps/test/jest_parallel.sh jest.integration.config.js
6 changes: 3 additions & 3 deletions .buildkite/scripts/steps/test/jest_parallel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ exitCode=0
while read -r config; do
if [ "$((i % JOB_COUNT))" -eq "$JOB" ]; then
echo "--- $ node scripts/jest --config $config"
node --max-old-space-size=14336 ./node_modules/.bin/jest --config="$config" --runInBand --coverage=false
node --max-old-space-size=14336 ./node_modules/.bin/jest --config="$config" --runInBand --coverage=false --passWithNoTests
lastCode=$?

if [ $lastCode -ne 0 ]; then
Expand All @@ -25,6 +25,6 @@ while read -r config; do

((i=i+1))
# uses heredoc to avoid the while loop being in a sub-shell thus unable to overwrite exitCode
done <<< "$(find src x-pack packages -name jest.config.js -not -path "*/__fixtures__/*" | sort)"
done <<< "$(find src x-pack packages -name "$1" -not -path "*/__fixtures__/*" | sort)"

exit $exitCode
exit $exitCode
12 changes: 12 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -886,6 +886,18 @@ module.exports = {
],
},
},
{
// require explicit return types in route handlers for performance reasons
files: ['x-pack/plugins/apm/server/**/route.ts'],
rules: {
'@typescript-eslint/explicit-function-return-type': [
'error',
{
allowTypedFunctionExpressions: false,
},
],
},
},

/**
* Fleet overrides
Expand Down
4 changes: 3 additions & 1 deletion dev_docs/tutorials/debugging.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ Next we will go over how to exactly enable the inspector for different aspects o

You will need to run Jest directly from the Node script:

`node --inspect-brk scripts/jest [TestPathPattern]`
`node --inspect-brk node_modules/.bin/jest --runInBand --config [JestConfig] [TestPathPattern]`

Additional information can be found in the [Jest troubleshooting documentation](https://jestjs.io/docs/troubleshooting).

### Functional Test Runner

Expand Down
16 changes: 1 addition & 15 deletions docs/api/upgrade-assistant/status.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,8 @@ The API returns the following:
"cluster": [
{
"message": "Cluster deprecated issue",
"details": "...",
"level": "warning",
"url": "https://docs.elastic.co/..."
}
],
"indices": [
{
"message": "Index was created before 6.0",
"details": "...",
"index": "myIndex",
"level": "critical",
"reindex": true, <1>
"url": "https://docs.elastic.co/..."
"details":"You have 2 system indices that must be migrated and 5 Elasticsearch deprecation issues and 0 Kibana deprecation issues that must be resolved before upgrading."
}
]
}
--------------------------------------------------

<1> To fix indices with the `reindex` attribute, set to `true` using the <<start-resume-reindex, Start or resume reindex API>>.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[discrete]
[[logging-config-changes]]
=== Logging configuration changes
== Logging configuration changes

WARNING: {kib} 8.0.0 and later uses a new logging system. Before you upgrade, read the documentation for your {kib} version.

Expand Down Expand Up @@ -43,4 +42,3 @@ WARNING: {kib} 8.0.0 and later uses a new logging system. Before you upgrade, re
| error | `{ message, name, stack }` | `{ message, name, stack, code, signal }`

|===

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-public](./kibana-plugin-core-public.md) &gt; [AppLeaveConfirmAction](./kibana-plugin-core-public.appleaveconfirmaction.md) &gt; [buttonColor](./kibana-plugin-core-public.appleaveconfirmaction.buttoncolor.md)

## AppLeaveConfirmAction.buttonColor property

<b>Signature:</b>

```typescript
buttonColor?: ButtonColor;
```
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-public](./kibana-plugin-core-public.md) &gt; [AppLeaveConfirmAction](./kibana-plugin-core-public.appleaveconfirmaction.md) &gt; [confirmButtonText](./kibana-plugin-core-public.appleaveconfirmaction.confirmbuttontext.md)

## AppLeaveConfirmAction.confirmButtonText property

<b>Signature:</b>

```typescript
confirmButtonText?: string;
```
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ export interface AppLeaveConfirmAction

| Property | Type | Description |
| --- | --- | --- |
| [buttonColor?](./kibana-plugin-core-public.appleaveconfirmaction.buttoncolor.md) | ButtonColor | <i>(Optional)</i> |
| [callback?](./kibana-plugin-core-public.appleaveconfirmaction.callback.md) | () =&gt; void | <i>(Optional)</i> |
| [confirmButtonText?](./kibana-plugin-core-public.appleaveconfirmaction.confirmbuttontext.md) | string | <i>(Optional)</i> |
| [text](./kibana-plugin-core-public.appleaveconfirmaction.text.md) | string | |
| [title?](./kibana-plugin-core-public.appleaveconfirmaction.title.md) | string | <i>(Optional)</i> |
| [type](./kibana-plugin-core-public.appleaveconfirmaction.type.md) | AppLeaveActionType.confirm | |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ export declare type KibanaExecutionContext = {
readonly type: string;
readonly name: string;
readonly id: string;
readonly description: string;
readonly description?: string;
readonly url?: string;
parent?: KibanaExecutionContext;
child?: KibanaExecutionContext;
};
```
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ export declare type KibanaExecutionContext = {
readonly type: string;
readonly name: string;
readonly id: string;
readonly description: string;
readonly description?: string;
readonly url?: string;
parent?: KibanaExecutionContext;
child?: KibanaExecutionContext;
};
```
2 changes: 1 addition & 1 deletion docs/osquery/osquery.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ or <<osquery-map-fields,map ECS fields>>. When you add a saved query to a pack,
. Click a pack name to view the status.
+
Details include the last time each query ran, how many results were returned, and the number of agents the query ran against.
If there are errors, expand the row to view the details.
If there are errors, expand the row to view the details, including an option to view more information in the Logs.
+
[role="screenshot"]
image::images/scheduled-pack.png[Shows queries in the pack and details about each query, including the last time it ran, how many results were returned, the number of agents it ran against, and if there are errors]
Expand Down
2 changes: 1 addition & 1 deletion docs/setup/upgrade.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ complete the upgrade migration before bringing up the remaining instances.
[[preventing-migration-failures]]
=== Preparing for migration

There are extra steps you can follow to ensure you are ready for migration.
Take these extra steps to ensure you are ready for migration.

[float]
==== Ensure your {es} cluster is healthy
Expand Down
16 changes: 8 additions & 8 deletions docs/setup/upgrade/resolving-migration-failures.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Migrating {kib} primarily involves migrating saved object documents to be compat
with the new version.

[float]
==== Resolve saved object migration failures
==== Saved object migration failures

If {kib} unexpectedly terminates while migrating a saved object index, {kib} automatically attempts to
perform the migration again when the process restarts. Do not delete any saved objects indices to
Expand All @@ -21,14 +21,14 @@ If you're unable to resolve a failed migration, contact Support.

[float]
[[upgrade-migrations-old-indices]]
==== Handle old `.kibana_N` indices
==== Old `.kibana_N` indices

After the migrations complete, multiple {kib} indices are created in {es}: (`.kibana_1`, `.kibana_2`, `.kibana_7.12.0` etc).
{kib} only uses the index that the `.kibana` and `.kibana_task_manager` aliases point to.
The other {kib} indices can be safely deleted, but are left around as a matter of historical record, and to facilitate rolling {kib} back to a previous version.

[float]
==== Handle known issues with {fleet} beta
==== Known issues with {fleet} beta
If you see a`timeout_exception` or `receive_timeout_transport_exception` error,
it might be from a known known issue in 7.12.0 if you tried the {fleet} beta.
Upgrade migrations fail because of a large number of documents in the `.kibana` index,
Expand All @@ -45,7 +45,7 @@ For instructions on how to mitigate the known issue, refer to https://github.com


[float]
==== Handle corrupt saved objects
==== Corrupt saved objects
To find and remedy problems caused by corrupt documents, we highly recommend testing your {kib} upgrade in a development cluster,
especially when there are custom integrations that create saved objects in your environment.

Expand Down Expand Up @@ -87,13 +87,13 @@ The dashboard with the `e3c5fc71-ac71-4805-bcab-2bcc9cc93275` ID that belongs to

[float]
[[unknown-saved-object-types]]
==== Handle documents for unknown saved objects
==== Documents for unknown saved objects
Migrations will fail if saved objects belong to an unknown
saved object type. Unknown saved objects are typically caused by
to the {es} index, or by disabling a plugin that had previously
created a saved object.

We recommend using the {kibana-ref-all}/7.17/upgrade-assistant.html[Upgrade Assistant]
We recommend using the {kibana-ref-all}/7.17/upgrade-assistant.html[Upgrade Assistant]
to discover and remedy any unknown saved object types. {kib} version 7.17.0 deployments containing unknown saved
object types will also log the following warning message:

Expand All @@ -110,15 +110,15 @@ Unable to complete saved object migrations for the [.kibana] index: Migration fa
--------------------------------------------

[float]
==== Handle incompatible settings or mappings
==== Incompatible settings or mappings
Matching index templates that specify `settings.refresh_interval` or
`mappings` are known to interfere with {kib} upgrades.
This can happen when index templates are defined manually.

To make sure the index templates won't apply to new `.kibana*` indices, narrow down the {data-sources} of any user-defined index templates.

[float]
==== Handle incompatible `xpack.tasks.index` configuration setting
==== Incompatible `xpack.tasks.index` configuration setting
In {kib} 7.5.0 and earlier, when the task manager index is set to `.tasks`
with the configuration setting `xpack.tasks.index: ".tasks"`,
upgrade migrations fail. In {kib} 7.5.1 and later, the incompatible configuration
Expand Down
Loading

0 comments on commit 9c16b12

Please sign in to comment.