diff --git a/.bazelrc b/.bazelrc index 9278352e686ef..c4029cd0bab47 100644 --- a/.bazelrc +++ b/.bazelrc @@ -2,14 +2,6 @@ # Import shared settings first so we can override below import %workspace%/.bazelrc.common -# Remote cache settings for local env -# build --remote_cache=grpcs://cloud.buildbuddy.io -# build --incompatible_remote_results_ignore_disk=true -# build --noremote_upload_local_results -# build --remote_timeout=30 -# build --remote_header=x-buildbuddy-api-key=3EYk49W2NefOx2n3yMze -# build --remote_accept_cached=true - # Enable this in case you want to share your build info # build --build_metadata=VISIBILITY=PUBLIC build --build_metadata=TEST_GROUPS=//packages diff --git a/.buildkite/pipelines/artifacts.yml b/.buildkite/pipelines/artifacts.yml index 773672c5f05f5..eac479d4d450f 100644 --- a/.buildkite/pipelines/artifacts.yml +++ b/.buildkite/pipelines/artifacts.yml @@ -4,29 +4,68 @@ steps: agents: queue: c2-16 timeout_in_minutes: 60 + retry: + automatic: + - exit_status: '*' + limit: 1 - wait - command: TEST_PACKAGE=deb .buildkite/scripts/steps/package_testing/test.sh - label: Package testing for deb + label: Artifact Testing agents: queue: n2-4-virt - timeout_in_minutes: 20 + timeout_in_minutes: 30 + retry: + automatic: + - exit_status: '*' + limit: 1 - command: TEST_PACKAGE=rpm .buildkite/scripts/steps/package_testing/test.sh - label: Package testing for rpm + label: Artifact Testing agents: queue: n2-4-virt - timeout_in_minutes: 20 + timeout_in_minutes: 30 + retry: + automatic: + - exit_status: '*' + limit: 1 - command: TEST_PACKAGE=docker .buildkite/scripts/steps/package_testing/test.sh - label: Package testing for docker + label: Artifact Testing agents: queue: n2-4-virt - timeout_in_minutes: 20 + timeout_in_minutes: 30 + retry: + automatic: + - exit_status: '*' + limit: 1 - command: .buildkite/scripts/steps/artifacts/docker_context.sh - label: 'Docker Build Context' + label: 'Docker Context Verification' agents: queue: n2-2 - timeout_in_minutes: 20 + timeout_in_minutes: 30 + retry: + automatic: + - exit_status: '*' + limit: 1 + + - command: .buildkite/scripts/steps/artifacts/cloud.sh + label: 'Cloud Deployment' + agents: + queue: n2-2 + timeout_in_minutes: 30 + if: "build.env('RELEASE_BUILD') == null || build.env('RELEASE_BUILD') == '' || build.env('RELEASE_BUILD') == 'false'" + retry: + automatic: + - exit_status: '*' + limit: 1 + + - wait + + - command: .buildkite/scripts/steps/artifacts/publish.sh + label: 'Publish Kibana Artifacts' + agents: + queue: n2-2 + timeout_in_minutes: 30 diff --git a/.buildkite/pipelines/es_snapshots/verify.yml b/.buildkite/pipelines/es_snapshots/verify.yml index 18f3440b4acf7..23ec38085c3d9 100755 --- a/.buildkite/pipelines/es_snapshots/verify.yml +++ b/.buildkite/pipelines/es_snapshots/verify.yml @@ -29,7 +29,7 @@ steps: - command: .buildkite/scripts/steps/functional/xpack_cigroup.sh label: 'Default CI Group' - parallelism: 27 + parallelism: 31 agents: queue: n2-4 depends_on: build @@ -40,18 +40,6 @@ steps: - exit_status: '*' limit: 1 - - command: CI_GROUP=Docker .buildkite/scripts/steps/functional/xpack_cigroup.sh - label: 'Docker CI Group' - agents: - queue: n2-4 - depends_on: build - timeout_in_minutes: 120 - key: default-cigroup-docker - retry: - automatic: - - exit_status: '*' - limit: 1 - - command: .buildkite/scripts/steps/functional/oss_cigroup.sh label: 'OSS CI Group' parallelism: 11 @@ -91,7 +79,6 @@ steps: queue: kibana-default depends_on: - default-cigroup - - default-cigroup-docker - oss-cigroup - jest-integration - api-integration diff --git a/.buildkite/pipelines/flaky_tests/groups.json b/.buildkite/pipelines/flaky_tests/groups.json index 0a5d0d488cd5d..e471d5c6a8679 100644 --- a/.buildkite/pipelines/flaky_tests/groups.json +++ b/.buildkite/pipelines/flaky_tests/groups.json @@ -32,11 +32,7 @@ { "key": "xpack/cigroup", "name": "Default CI Group", - "ciGroups": 27 - }, - { - "key": "xpack/cigroup/Docker", - "name": "Default CI Group Docker" + "ciGroups": 30 }, { "key": "xpack/firefox", @@ -47,4 +43,4 @@ "name": "Default Accessibility" } ] -} \ No newline at end of file +} diff --git a/.buildkite/pipelines/on_merge.yml b/.buildkite/pipelines/on_merge.yml index a11f566b06093..8702493d9f4cf 100644 --- a/.buildkite/pipelines/on_merge.yml +++ b/.buildkite/pipelines/on_merge.yml @@ -51,7 +51,7 @@ steps: - command: .buildkite/scripts/steps/functional/xpack_cigroup.sh label: 'Default CI Group' - parallelism: 27 + parallelism: 31 agents: queue: n2-4-spot depends_on: build @@ -64,20 +64,6 @@ steps: - exit_status: '*' limit: 1 - - command: CI_GROUP=Docker .buildkite/scripts/steps/functional/xpack_cigroup.sh - label: 'Docker CI Group' - agents: - queue: n2-4-spot - depends_on: build - timeout_in_minutes: 120 - key: default-cigroup-docker - retry: - automatic: - - exit_status: '-1' - limit: 3 - - exit_status: '*' - limit: 1 - - command: .buildkite/scripts/steps/functional/oss_cigroup.sh label: 'OSS CI Group' parallelism: 11 diff --git a/.buildkite/pipelines/pull_request/base.yml b/.buildkite/pipelines/pull_request/base.yml index a88799d785f06..658d855d86cfd 100644 --- a/.buildkite/pipelines/pull_request/base.yml +++ b/.buildkite/pipelines/pull_request/base.yml @@ -17,26 +17,16 @@ steps: - command: .buildkite/scripts/steps/functional/xpack_cigroup.sh label: 'Default CI Group' - parallelism: 27 + parallelism: 31 agents: - queue: n2-4 + queue: n2-4-spot-2 depends_on: build timeout_in_minutes: 150 key: default-cigroup retry: automatic: - - exit_status: '*' - limit: 1 - - - command: CI_GROUP=Docker .buildkite/scripts/steps/functional/xpack_cigroup.sh - label: 'Docker CI Group' - agents: - queue: n2-4 - depends_on: build - timeout_in_minutes: 120 - key: default-cigroup-docker - retry: - automatic: + - exit_status: '-1' + limit: 3 - exit_status: '*' limit: 1 diff --git a/.buildkite/scripts/build_kibana_plugins.sh b/.buildkite/scripts/build_kibana_plugins.sh index 94366d9524346..fafd68d86a65d 100755 --- a/.buildkite/scripts/build_kibana_plugins.sh +++ b/.buildkite/scripts/build_kibana_plugins.sh @@ -3,18 +3,4 @@ set -euo pipefail echo "--- Build Platform Plugins" -node scripts/build_kibana_platform_plugins \ - --scan-dir "$KIBANA_DIR/test/analytics/__fixtures__/plugins" \ - --scan-dir "$KIBANA_DIR/test/plugin_functional/plugins" \ - --scan-dir "$KIBANA_DIR/test/interpreter_functional/plugins" \ - --scan-dir "$KIBANA_DIR/test/common/fixtures/plugins" \ - --scan-dir "$KIBANA_DIR/examples" \ - --scan-dir "$XPACK_DIR/test/plugin_functional/plugins" \ - --scan-dir "$XPACK_DIR/test/functional_with_es_ssl/fixtures/plugins" \ - --scan-dir "$XPACK_DIR/test/alerting_api_integration/plugins" \ - --scan-dir "$XPACK_DIR/test/plugin_api_integration/plugins" \ - --scan-dir "$XPACK_DIR/test/plugin_api_perf/plugins" \ - --scan-dir "$XPACK_DIR/test/licensing_plugin/plugins" \ - --scan-dir "$XPACK_DIR/test/usage_collection/plugins" \ - --scan-dir "$XPACK_DIR/test/security_functional/fixtures/common" \ - --scan-dir "$XPACK_DIR/examples" +node scripts/build_kibana_platform_plugins --examples --test-plugins diff --git a/.buildkite/scripts/common/setup_bazel.sh b/.buildkite/scripts/common/setup_bazel.sh index f9877b16cd424..96cd04fa612fd 100755 --- a/.buildkite/scripts/common/setup_bazel.sh +++ b/.buildkite/scripts/common/setup_bazel.sh @@ -15,8 +15,8 @@ if [[ "${BAZEL_CACHE_MODE:-none}" == read* ]]; then echo "[bazel] enabling caching" cat <> $KIBANA_DIR/.bazelrc build --bes_results_url=https://app.buildbuddy.io/invocation/ - build --bes_backend=grpcs://cloud.buildbuddy.io - build --remote_cache=grpcs://cloud.buildbuddy.io + build --bes_backend=grpcs://remote.buildbuddy.io + build --remote_cache=grpcs://remote.buildbuddy.io build --remote_timeout=3600 build --remote_header=x-buildbuddy-api-key=$KIBANA_BUILDBUDDY_CI_API_KEY EOF diff --git a/.buildkite/scripts/lifecycle/pre_build.sh b/.buildkite/scripts/lifecycle/pre_build.sh index d901594e36ce4..29da2d207dcc4 100755 --- a/.buildkite/scripts/lifecycle/pre_build.sh +++ b/.buildkite/scripts/lifecycle/pre_build.sh @@ -12,3 +12,11 @@ export CI_STATS_TOKEN="$(retry 5 5 vault read -field=api_token secret/kibana-iss export CI_STATS_HOST="$(retry 5 5 vault read -field=api_host secret/kibana-issues/dev/kibana_ci_stats)" node "$(dirname "${0}")/ci_stats_start.js" + +# We resolve the latest manifest URL at the beginning of the build to ensure that all steps in the build will use the same manifest +# Otherwise, the manifest could change if a step is running around the time that a new one is promoted +if [[ ! "${ES_SNAPSHOT_MANIFEST:-}" ]]; then + BUCKET=$(curl -s "https://storage.googleapis.com/kibana-ci-es-snapshots-daily/$(cat package.json | jq -r .version)/manifest-latest-verified.json" | jq -r .bucket) + ES_SNAPSHOT_MANIFEST_DEFAULT="https://storage.googleapis.com/$BUCKET/manifest.json" + buildkite-agent meta-data set ES_SNAPSHOT_MANIFEST_DEFAULT "$ES_SNAPSHOT_MANIFEST_DEFAULT" +fi diff --git a/.buildkite/scripts/lifecycle/pre_command.sh b/.buildkite/scripts/lifecycle/pre_command.sh index 8b2f1f65a52f4..e7a176a5c2666 100755 --- a/.buildkite/scripts/lifecycle/pre_command.sh +++ b/.buildkite/scripts/lifecycle/pre_command.sh @@ -65,6 +65,15 @@ EOF fi } +# If a custom manifest isn't specified, then use the default one that we resolve earlier in the build +{ + if [[ ! "${ES_SNAPSHOT_MANIFEST:-}" ]]; then + ES_SNAPSHOT_MANIFEST=${ES_SNAPSHOT_MANIFEST:-$(buildkite-agent meta-data get ES_SNAPSHOT_MANIFEST_DEFAULT --default '')} + export ES_SNAPSHOT_MANIFEST + echo "Using default ES Snapshot Manifest: $ES_SNAPSHOT_MANIFEST" + fi +} + # Setup CI Stats { CI_STATS_BUILD_ID="$(buildkite-agent meta-data get ci_stats_build_id --default '')" diff --git a/.buildkite/scripts/steps/artifacts/build.sh b/.buildkite/scripts/steps/artifacts/build.sh index 9d40a713d4b0a..4519e5167c91f 100644 --- a/.buildkite/scripts/steps/artifacts/build.sh +++ b/.buildkite/scripts/steps/artifacts/build.sh @@ -4,44 +4,23 @@ set -euo pipefail .buildkite/scripts/bootstrap.sh -if [[ "${RELEASE_BUILD:-}" == "true" ]]; then - VERSION="$(jq -r '.version' package.json)" - RELEASE_ARG="--release" -else - VERSION="$(jq -r '.version' package.json)-SNAPSHOT" - RELEASE_ARG="" -fi +source .buildkite/scripts/steps/artifacts/env.sh -echo "--- Build Kibana Distribution" -node scripts/build "$RELEASE_ARG" --all-platforms --debug --docker-cross-compile --skip-docker-cloud +echo "--- Build Kibana artifacts" +node scripts/build --all-platforms --debug --docker-cross-compile $(echo "$BUILD_ARGS") -echo "--- Build dependencies report" -node scripts/licenses_csv_report "--csv=target/dependencies-$VERSION.csv" - -# Release verification -if [[ "${RELEASE_BUILD:-}" == "true" ]]; then - echo "--- Build and push Kibana Cloud Distribution" - # This doesn't meet the requirements for a release image, implementation TBD - # Beats artifacts will need to match a specific commit sha that matches other stack iamges - # For now this is a placeholder step that will allow us to run automated Cloud tests - # against a best guess approximation of a release image - echo "$KIBANA_DOCKER_PASSWORD" | docker login -u "$KIBANA_DOCKER_USERNAME" --password-stdin docker.elastic.co - trap 'docker logout docker.elastic.co' EXIT +echo "--- Extract default i18n messages" +mkdir -p target/i18n +node scripts/i18n_extract --output-dir=target/i18n - node scripts/build \ - "$RELEASE_ARG" \ - --skip-initialize \ - --skip-generic-folders \ - --skip-platform-folders \ - --skip-archives \ - --docker-images \ - --docker-tag-qualifier="$GIT_COMMIT" \ - --docker-push \ - --skip-docker-ubi \ - --skip-docker-ubuntu \ - --skip-docker-contexts -fi +echo "--- Build dependencies report" +node scripts/licenses_csv_report "--csv=target/dependencies-$FULL_VERSION.csv" +(cd target; sha512sum "dependencies-$FULL_VERSION.csv" > "dependencies-$FULL_VERSION.csv.sha512.txt") +echo "--- Upload Kibana Artifacts" cd target -buildkite-agent artifact upload "*" -cd - \ No newline at end of file +buildkite-agent artifact upload 'kibana-*' +buildkite-agent artifact upload "dependencies-$FULL_VERSION.csv" +buildkite-agent artifact upload "dependencies-$FULL_VERSION.csv.sha512.txt" +buildkite-agent artifact upload 'i18n/*.json' +cd - diff --git a/.buildkite/scripts/steps/artifacts/cloud.sh b/.buildkite/scripts/steps/artifacts/cloud.sh new file mode 100644 index 0000000000000..8fa04a5d176b0 --- /dev/null +++ b/.buildkite/scripts/steps/artifacts/cloud.sh @@ -0,0 +1,81 @@ +#!/bin/bash + +set -euo pipefail + +.buildkite/scripts/bootstrap.sh + +source .buildkite/scripts/steps/artifacts/env.sh + +echo "--- Publish Cloud image" +mkdir -p target +cd target + +buildkite-agent artifact download "kibana-cloud-$FULL_VERSION-docker-image.tar.gz" . --build "${KIBANA_BUILD_ID:-$BUILDKITE_BUILD_ID}" +docker load --input kibana-cloud-$FULL_VERSION-docker-image.tar.gz + +TAG="$FULL_VERSION-$GIT_COMMIT" +KIBANA_BASE_IMAGE="docker.elastic.co/kibana-ci/kibana-cloud:$FULL_VERSION" +KIBANA_TEST_IMAGE="docker.elastic.co/kibana-ci/kibana-cloud:$TAG" + +docker tag "$KIBANA_BASE_IMAGE" "$KIBANA_TEST_IMAGE" + +echo "$KIBANA_DOCKER_PASSWORD" | docker login -u "$KIBANA_DOCKER_USERNAME" --password-stdin docker.elastic.co +trap 'docker logout docker.elastic.co' EXIT + +docker push "$KIBANA_TEST_IMAGE" +docker logout docker.elastic.co + +cd - + +echo "--- Create deployment" +CLOUD_DEPLOYMENT_NAME="kibana-artifacts-$TAG" + +LOGS=$(mktemp --suffix ".json") +DEPLOYMENT_SPEC=$(mktemp --suffix ".json") + +jq ' + .name = "'$CLOUD_DEPLOYMENT_NAME'" | + .resources.kibana[0].plan.kibana.docker_image = "'$KIBANA_TEST_IMAGE'" | + .resources.kibana[0].plan.kibana.version = "'$FULL_VERSION'" | + .resources.elasticsearch[0].plan.elasticsearch.version = "'$FULL_VERSION'" | + .resources.enterprise_search[0].plan.enterprise_search.version = "'$FULL_VERSION'" | + .resources.integrations_server[0].plan.integrations_server.version = "'$FULL_VERSION'" + ' .buildkite/scripts/steps/cloud/deploy.json > "$DEPLOYMENT_SPEC" + +ecctl deployment create --track --output json --file "$DEPLOYMENT_SPEC" &> "$LOGS" +CLOUD_DEPLOYMENT_USERNAME=$(jq --slurp '.[]|select(.resources).resources[] | select(.credentials).credentials.username' "$LOGS") +CLOUD_DEPLOYMENT_PASSWORD=$(jq --slurp '.[]|select(.resources).resources[] | select(.credentials).credentials.password' "$LOGS") +CLOUD_DEPLOYMENT_ID=$(jq -r --slurp '.[0].id' "$LOGS") +CLOUD_DEPLOYMENT_STATUS_MESSAGES=$(jq --slurp '[.[]|select(.resources == null)]' "$LOGS") + +CLOUD_DEPLOYMENT_KIBANA_URL=$(ecctl deployment show "$CLOUD_DEPLOYMENT_ID" | jq -r '.resources.kibana[0].info.metadata.aliased_url') +CLOUD_DEPLOYMENT_ELASTICSEARCH_URL=$(ecctl deployment show "$CLOUD_DEPLOYMENT_ID" | jq -r '.resources.elasticsearch[0].info.metadata.aliased_url') + +# NOTE: disabled pending log sanitization +# echo "--- Setup FTR" +# export TEST_KIBANA_PROTOCOL=$(node -e "console.log(new URL('$CLOUD_DEPLOYMENT_KIBANA_URL').protocol)") +# export TEST_KIBANA_HOSTNAME=$(node -e "console.log(new URL('$CLOUD_DEPLOYMENT_KIBANA_URL').hostname)") +# export TEST_KIBANA_PORT=$(node -e "console.log(new URL('$CLOUD_DEPLOYMENT_KIBANA_URL').port)") +# export TEST_KIBANA_USERNAME=$CLOUD_DEPLOYMENT_USERNAME" +# export TEST_KIBANA_PASS=$CLOUD_DEPLOYMENT_PASSWORD" + +# export TEST_ES_PROTOCOL=$(node -e "console.log(new URL('$CLOUD_DEPLOYMENT_KIBANA_URL').protocol)") +# export TEST_ES_HOSTNAME==$(node -e "console.log(new URL('$CLOUD_DEPLOYMENT_KIBANA_URL').hostname)") +# export TEST_ES_PORT=$(node -e "console.log(new URL('$CLOUD_DEPLOYMENT_KIBANA_URL').port)") +# export TEST_ES_USER="$CLOUD_DEPLOYMENT_USERNAME" +# export TEST_ES_PASS="$CLOUD_DEPLOYMENT_PASSWORD" + +# export TEST_BROWSER_HEADLESS=1 + +# Error: attempted to use the "es" service to fetch Elasticsearch version info but the request failed: ConnectionError: self signed certificate in certificate chain +# export NODE_TLS_REJECT_UNAUTHORIZED=0 + +# echo "--- Run default functional tests" +# node --no-warnings scripts/functional_test_runner.js --include-tag=cloud -exclude-tag=skipCloud + +# echo "--- Run x-pack functional tests" +# cd x-pack +# node --no-warnings scripts/functional_test_runner.js --include-tag=cloud -exclude-tag=skipCloud + +echo "--- Shutdown deployment" +ecctl deployment shutdown "$CLOUD_DEPLOYMENT_ID" --force --track --output json &> "$LOGS" diff --git a/.buildkite/scripts/steps/artifacts/docker_context.sh b/.buildkite/scripts/steps/artifacts/docker_context.sh index 787f5d278febc..a20544de18fd9 100644 --- a/.buildkite/scripts/steps/artifacts/docker_context.sh +++ b/.buildkite/scripts/steps/artifacts/docker_context.sh @@ -4,17 +4,11 @@ set -euo pipefail .buildkite/scripts/bootstrap.sh -if [[ "${RELEASE_BUILD:-}" == "true" ]]; then - VERSION="$(jq -r '.version' package.json)" - RELEASE_ARG="--release" -else - VERSION="$(jq -r '.version' package.json)-SNAPSHOT" - RELEASE_ARG="" -fi +source .buildkite/scripts/steps/artifacts/env.sh echo "--- Create contexts" mkdir -p target -node scripts/build "$RELEASE_ARG" --skip-initialize --skip-generic-folders --skip-platform-folders --skip-archives --docker-context-use-local-artifact +node scripts/build --skip-initialize --skip-generic-folders --skip-platform-folders --skip-archives --docker-context-use-local-artifact $(echo "$BUILD_ARGS") echo "--- Setup default context" DOCKER_BUILD_FOLDER=$(mktemp -d) @@ -22,7 +16,7 @@ DOCKER_BUILD_FOLDER=$(mktemp -d) tar -xf target/kibana-[0-9]*-docker-build-context.tar.gz -C "$DOCKER_BUILD_FOLDER" cd $DOCKER_BUILD_FOLDER -buildkite-agent artifact download "kibana-$VERSION-linux-x86_64.tar.gz" . --build "${KIBANA_BUILD_ID:-$BUILDKITE_BUILD_ID}" +buildkite-agent artifact download "kibana-$FULL_VERSION-linux-x86_64.tar.gz" . --build "${KIBANA_BUILD_ID:-$BUILDKITE_BUILD_ID}" echo "--- Build context" docker build . diff --git a/.buildkite/scripts/steps/artifacts/env.sh b/.buildkite/scripts/steps/artifacts/env.sh new file mode 100755 index 0000000000000..ea2850ff9a38a --- /dev/null +++ b/.buildkite/scripts/steps/artifacts/env.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash + +set -euo pipefail + +RELEASE_BUILD="${RELEASE_BUILD:="false"}" +VERSION_QUALIFIER="${VERSION_QUALIFIER:=""}" + +BASE_VERSION="$(jq -r '.version' package.json)" + +if [[ "$VERSION_QUALIFIER" == "" ]]; then + QUALIFIER_VERSION="$BASE_VERSION" +else + QUALIFIER_VERSION="$BASE_VERSION-$VERSION_QUALIFIER" +fi + +if [[ "$RELEASE_BUILD" == "true" ]]; then + FULL_VERSION="$QUALIFIER_VERSION" + + # Beats artifacts will need to match a specific commit sha that matches other stack images + # for release builds. For now we are skipping Cloud builds until there's a pointer. + BUILD_ARGS="--release --skip-docker-cloud --version-qualifier=$VERSION_QUALIFIER" + WORKFLOW="staging" +else + FULL_VERSION="$QUALIFIER_VERSION-SNAPSHOT" + BUILD_ARGS="--version-qualifier=$VERSION_QUALIFIER" + WORKFLOW="snapshot" +fi + +export VERSION_QUALIFIER +export BASE_VERSION +export QUALIFIER_VERSION +export FULL_VERSION +export BUILD_ARGS +export WORKFLOW diff --git a/.buildkite/scripts/steps/artifacts/publish.sh b/.buildkite/scripts/steps/artifacts/publish.sh new file mode 100644 index 0000000000000..ed4cb5ca1d4b9 --- /dev/null +++ b/.buildkite/scripts/steps/artifacts/publish.sh @@ -0,0 +1,86 @@ +#!/usr/bin/env bash + +set -euo pipefail + +source .buildkite/scripts/common/util.sh +source .buildkite/scripts/steps/artifacts/env.sh + +echo "--- Download and verify artifacts" +function download { + buildkite-agent artifact download "$1" . --build "${KIBANA_BUILD_ID:-$BUILDKITE_BUILD_ID}" + buildkite-agent artifact download "$1.sha512.txt" . --build "${KIBANA_BUILD_ID:-$BUILDKITE_BUILD_ID}" + sha512sum -c "$1.sha512.txt" + rm "$1.sha512.txt" +} + +mkdir -p target +cd target + +download "kibana-$FULL_VERSION-docker-image.tar.gz" +download "kibana-$FULL_VERSION-docker-image-aarch64.tar.gz" +download "kibana-ubi8-$FULL_VERSION-docker-image.tar.gz" + +download "kibana-$FULL_VERSION-arm64.deb" +download "kibana-$FULL_VERSION-amd64.deb" +download "kibana-$FULL_VERSION-x86_64.rpm" +download "kibana-$FULL_VERSION-aarch64.rpm" + +download "kibana-$FULL_VERSION-docker-build-context.tar.gz" +download "kibana-cloud-$FULL_VERSION-docker-build-context.tar.gz" +download "kibana-ironbank-$FULL_VERSION-docker-build-context.tar.gz" +download "kibana-ubi8-$FULL_VERSION-docker-build-context.tar.gz" + +download "kibana-$FULL_VERSION-linux-aarch64.tar.gz" +download "kibana-$FULL_VERSION-linux-x86_64.tar.gz" + +download "kibana-$FULL_VERSION-darwin-x86_64.tar.gz" +download "kibana-$FULL_VERSION-darwin-aarch64.tar.gz" + +download "kibana-$FULL_VERSION-windows-x86_64.zip" + +download "dependencies-$FULL_VERSION.csv" + +cd - + +echo "--- Set artifact permissions" +chmod -R a+r target/* +chmod -R a+w target + +echo "--- Pull latest Release Manager CLI" +echo "$KIBANA_DOCKER_PASSWORD" | docker login -u "$KIBANA_DOCKER_USERNAME" --password-stdin docker.elastic.co +trap 'docker logout docker.elastic.co' EXIT +docker pull docker.elastic.co/infra/release-manager:latest + +echo "--- Publish artifacts" +if [[ "$BUILDKITE_BRANCH" == "$KIBANA_BASE_BRANCH" ]]; then + export VAULT_ROLE_ID="$(retry 5 15 gcloud secrets versions access latest --secret=kibana-buildkite-vault-role-id)" + export VAULT_SECRET_ID="$(retry 5 15 gcloud secrets versions access latest --secret=kibana-buildkite-vault-secret-id)" + export VAULT_ADDR="https://secrets.elastic.co:8200" + docker run --rm \ + --name release-manager \ + -e VAULT_ADDR \ + -e VAULT_ROLE_ID \ + -e VAULT_SECRET_ID \ + --mount type=bind,readonly=false,src="$PWD/target",target=/artifacts/target \ + docker.elastic.co/infra/release-manager:latest \ + cli collect \ + --project kibana \ + --branch "$KIBANA_BASE_BRANCH" \ + --commit "$GIT_COMMIT" \ + --workflow "$WORKFLOW" \ + --version "$BASE_VERSION" \ + --qualifier "$VERSION_QUALIFIER" \ + --artifact-set main + + ARTIFACTS_SUBDOMAIN="artifacts-$WORKFLOW" + ARTIFACTS_SUMMARY=$(curl -s "https://$ARTIFACTS_SUBDOMAIN.elastic.co/kibana/latest/$FULL_VERSION.json" | jq -re '.summary_url') + + cat << EOF | buildkite-agent annotate --style "info" --context artifacts-summary + ### Artifacts Summary + + $ARTIFACTS_SUMMARY +EOF + +else + echo "Skipping publish for untracked branch $BUILDKITE_BRANCH" +fi diff --git a/.buildkite/scripts/steps/cloud/deploy.json b/.buildkite/scripts/steps/cloud/deploy.json index 62edb7b6a11c9..c43294a42a83b 100644 --- a/.buildkite/scripts/steps/cloud/deploy.json +++ b/.buildkite/scripts/steps/cloud/deploy.json @@ -207,7 +207,7 @@ "zone_count": 1, "size": { "resource": "memory", - "value": 1024 + "value": 2048 } } ], diff --git a/.buildkite/scripts/steps/es_snapshots/create_manifest.js b/.buildkite/scripts/steps/es_snapshots/create_manifest.js index 9357cd72fff06..e20a3262e66e0 100644 --- a/.buildkite/scripts/steps/es_snapshots/create_manifest.js +++ b/.buildkite/scripts/steps/es_snapshots/create_manifest.js @@ -8,7 +8,7 @@ const fs = require('fs'); const { execSync } = require('child_process'); -const { BASE_BUCKET_DAILY } = require('./bucket_config.js'); +const { BASE_BUCKET_DAILY } = require('./bucket_config'); (async () => { console.log('--- Create ES Snapshot Manifest'); diff --git a/.buildkite/scripts/steps/es_snapshots/promote_manifest.js b/.buildkite/scripts/steps/es_snapshots/promote_manifest.js index d7ff670755712..1ba60ae6cd25e 100644 --- a/.buildkite/scripts/steps/es_snapshots/promote_manifest.js +++ b/.buildkite/scripts/steps/es_snapshots/promote_manifest.js @@ -8,7 +8,7 @@ const fs = require('fs'); const { execSync } = require('child_process'); -const { BASE_BUCKET_DAILY, BASE_BUCKET_PERMANENT } = require('./bucket_config.js'); +const { BASE_BUCKET_DAILY, BASE_BUCKET_PERMANENT } = require('./bucket_config'); (async () => { try { diff --git a/.buildkite/scripts/steps/functional/performance_playwright.sh b/.buildkite/scripts/steps/functional/performance_playwright.sh index d739f136992e7..dad75c9f66a98 100644 --- a/.buildkite/scripts/steps/functional/performance_playwright.sh +++ b/.buildkite/scripts/steps/functional/performance_playwright.sh @@ -20,7 +20,7 @@ sleep 120 cd "$XPACK_DIR" -journeys=("login" "ecommerce_dashboard" "flight_dashboard" "web_logs_dashboard" "promotion_tracking_dashboard") +journeys=("login" "ecommerce_dashboard" "flight_dashboard" "web_logs_dashboard" "promotion_tracking_dashboard" "many_fields_discover") for i in "${journeys[@]}"; do echo "JOURNEY[${i}] is running" @@ -28,7 +28,7 @@ for i in "${journeys[@]}"; do export TEST_PERFORMANCE_PHASE=WARMUP export ELASTIC_APM_ACTIVE=false export JOURNEY_NAME="${i}" - + checks-reporter-with-killswitch "Run Performance Tests with Playwright Config (Journey:${i},Phase: WARMUP)" \ node scripts/functional_tests \ --config test/performance/config.playwright.ts \ diff --git a/.buildkite/scripts/steps/functional/uptime.sh b/.buildkite/scripts/steps/functional/uptime.sh index a1c8c2bf6c85b..ce49acadf4deb 100755 --- a/.buildkite/scripts/steps/functional/uptime.sh +++ b/.buildkite/scripts/steps/functional/uptime.sh @@ -13,5 +13,5 @@ echo "--- Uptime @elastic/synthetics Tests" cd "$XPACK_DIR" -checks-reporter-with-killswitch "Uptime @elastic/synthetics Tests" \ - node plugins/uptime/scripts/e2e.js --kibana-install-dir "$KIBANA_BUILD_LOCATION" ${GREP:+--grep \"${GREP}\"} +checks-reporter-with-killswitch "uptime plugin @elastic/synthetics Tests" \ + node plugins/synthetics/scripts/e2e.js --kibana-install-dir "$KIBANA_BUILD_LOCATION" ${GREP:+--grep \"${GREP}\"} diff --git a/.buildkite/scripts/steps/package_testing/test.sh b/.buildkite/scripts/steps/package_testing/test.sh index a9a46502d5b3b..e5ed00f760864 100755 --- a/.buildkite/scripts/steps/package_testing/test.sh +++ b/.buildkite/scripts/steps/package_testing/test.sh @@ -15,12 +15,12 @@ elif [[ "$TEST_PACKAGE" == "rpm" ]]; then buildkite-agent artifact download 'kibana-*.rpm' . --build "${KIBANA_BUILD_ID:-$BUILDKITE_BUILD_ID}" KIBANA_IP_ADDRESS="192.168.56.6" elif [[ "$TEST_PACKAGE" == "docker" ]]; then - buildkite-agent artifact download "kibana-$KIBANA_PKG_VERSION-SNAPSHOT-docker-image.tar.gz" . --build "${KIBANA_BUILD_ID:-$BUILDKITE_BUILD_ID}" + buildkite-agent artifact download "kibana-$KIBANA_PKG_VERSION*-docker-image.tar.gz" . --build "${KIBANA_BUILD_ID:-$BUILDKITE_BUILD_ID}" KIBANA_IP_ADDRESS="192.168.56.7" fi cd .. -export VAGRANT_CWD=test/package +export VAGRANT_CWD=$PWD/test/package vagrant up "$TEST_PACKAGE" --no-provision node scripts/es snapshot \ @@ -29,6 +29,16 @@ node scripts/es snapshot \ --license=trial & while ! timeout 1 bash -c "echo > /dev/tcp/localhost/9200"; do sleep 30; done +function echoKibanaLogs { + echo '--- Kibana logs' + if [[ "$TEST_PACKAGE" == "deb" ]] || [[ "$TEST_PACKAGE" == "rpm" ]]; then + vagrant ssh $TEST_PACKAGE -t -c 'sudo cat /var/log/kibana/kibana.log' + elif [[ "$TEST_PACKAGE" == "docker" ]]; then + vagrant ssh $TEST_PACKAGE -t -c 'sudo docker logs kibana' + fi +} +trap "echoKibanaLogs" EXIT + vagrant provision "$TEST_PACKAGE" export TEST_BROWSER_HEADLESS=1 diff --git a/.buildkite/scripts/steps/test/jest_parallel.sh b/.buildkite/scripts/steps/test/jest_parallel.sh index 0530fe0f84161..27eb9e9216365 100755 --- a/.buildkite/scripts/steps/test/jest_parallel.sh +++ b/.buildkite/scripts/steps/test/jest_parallel.sh @@ -10,10 +10,17 @@ JOB_COUNT=$BUILDKITE_PARALLEL_JOB_COUNT i=0 exitCode=0 +# run unit tests in parallel +if [[ "$1" == 'jest.config.js' ]]; then + parallelism="-w2" +else + parallelism="--runInBand" +fi + while read -r config; do if [ "$((i % JOB_COUNT))" -eq "$JOB" ]; then echo "--- $ node scripts/jest --config $config" - node --max-old-space-size=14336 ./scripts/jest --config="$config" --runInBand --coverage=false --passWithNoTests + node --max-old-space-size=14336 ./scripts/jest --config="$config" "$parallelism" --coverage=false --passWithNoTests lastCode=$? if [ $lastCode -ne 0 ]; then diff --git a/.buildkite/yarn.lock b/.buildkite/yarn.lock index c2d6928d30c5a..c5a4e404ba970 100644 --- a/.buildkite/yarn.lock +++ b/.buildkite/yarn.lock @@ -3,93 +3,93 @@ "@octokit/auth-token@^2.4.4": - "integrity" "sha512-r5FVUJCOLl19AxiuZD2VRZ/ORjp/4IN98Of6YJoJOkY75CIBuYfmiNHGrDwXr+aLGG55igl9QrxX3hbiXlLb+g==" - "resolved" "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-2.5.0.tgz" - "version" "2.5.0" + version "2.5.0" + resolved "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-2.5.0.tgz" + integrity sha512-r5FVUJCOLl19AxiuZD2VRZ/ORjp/4IN98Of6YJoJOkY75CIBuYfmiNHGrDwXr+aLGG55igl9QrxX3hbiXlLb+g== dependencies: "@octokit/types" "^6.0.3" -"@octokit/core@^3.5.1", "@octokit/core@>=2", "@octokit/core@>=3": - "integrity" "sha512-omncwpLVxMP+GLpLPgeGJBF6IWJFjXDS5flY5VbppePYX9XehevbDykRH9PdCdvqt9TS5AOTiDide7h0qrkHjw==" - "resolved" "https://registry.npmjs.org/@octokit/core/-/core-3.5.1.tgz" - "version" "3.5.1" +"@octokit/core@^3.5.1": + version "3.5.1" + resolved "https://registry.npmjs.org/@octokit/core/-/core-3.5.1.tgz" + integrity sha512-omncwpLVxMP+GLpLPgeGJBF6IWJFjXDS5flY5VbppePYX9XehevbDykRH9PdCdvqt9TS5AOTiDide7h0qrkHjw== dependencies: "@octokit/auth-token" "^2.4.4" "@octokit/graphql" "^4.5.8" "@octokit/request" "^5.6.0" "@octokit/request-error" "^2.0.5" "@octokit/types" "^6.0.3" - "before-after-hook" "^2.2.0" - "universal-user-agent" "^6.0.0" + before-after-hook "^2.2.0" + universal-user-agent "^6.0.0" "@octokit/endpoint@^6.0.1": - "integrity" "sha512-lF3puPwkQWGfkMClXb4k/eUT/nZKQfxinRWJrdZaJO85Dqwo/G0yOC434Jr2ojwafWJMYqFGFa5ms4jJUgujdA==" - "resolved" "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-6.0.12.tgz" - "version" "6.0.12" + version "6.0.12" + resolved "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-6.0.12.tgz" + integrity sha512-lF3puPwkQWGfkMClXb4k/eUT/nZKQfxinRWJrdZaJO85Dqwo/G0yOC434Jr2ojwafWJMYqFGFa5ms4jJUgujdA== dependencies: "@octokit/types" "^6.0.3" - "is-plain-object" "^5.0.0" - "universal-user-agent" "^6.0.0" + is-plain-object "^5.0.0" + universal-user-agent "^6.0.0" "@octokit/graphql@^4.5.8": - "integrity" "sha512-0gv+qLSBLKF0z8TKaSKTsS39scVKF9dbMxJpj3U0vC7wjNWFuIpL/z76Qe2fiuCbDRcJSavkXsVtMS6/dtQQsg==" - "resolved" "https://registry.npmjs.org/@octokit/graphql/-/graphql-4.8.0.tgz" - "version" "4.8.0" + version "4.8.0" + resolved "https://registry.npmjs.org/@octokit/graphql/-/graphql-4.8.0.tgz" + integrity sha512-0gv+qLSBLKF0z8TKaSKTsS39scVKF9dbMxJpj3U0vC7wjNWFuIpL/z76Qe2fiuCbDRcJSavkXsVtMS6/dtQQsg== dependencies: "@octokit/request" "^5.6.0" "@octokit/types" "^6.0.3" - "universal-user-agent" "^6.0.0" + universal-user-agent "^6.0.0" "@octokit/openapi-types@^11.2.0": - "integrity" "sha512-PBsVO+15KSlGmiI8QAzaqvsNlZlrDlyAJYcrXBCvVUxCp7VnXjkwPoFHgjEJXx3WF9BAwkA6nfCUA7i9sODzKA==" - "resolved" "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-11.2.0.tgz" - "version" "11.2.0" + version "11.2.0" + resolved "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-11.2.0.tgz" + integrity sha512-PBsVO+15KSlGmiI8QAzaqvsNlZlrDlyAJYcrXBCvVUxCp7VnXjkwPoFHgjEJXx3WF9BAwkA6nfCUA7i9sODzKA== "@octokit/plugin-paginate-rest@^2.16.8": - "integrity" "sha512-tzMbrbnam2Mt4AhuyCHvpRkS0oZ5MvwwcQPYGtMv4tUa5kkzG58SVB0fcsLulOZQeRnOgdkZWkRUiyBlh0Bkyw==" - "resolved" "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.17.0.tgz" - "version" "2.17.0" + version "2.17.0" + resolved "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.17.0.tgz" + integrity sha512-tzMbrbnam2Mt4AhuyCHvpRkS0oZ5MvwwcQPYGtMv4tUa5kkzG58SVB0fcsLulOZQeRnOgdkZWkRUiyBlh0Bkyw== dependencies: "@octokit/types" "^6.34.0" "@octokit/plugin-request-log@^1.0.4": - "integrity" "sha512-mLUsMkgP7K/cnFEw07kWqXGF5LKrOkD+lhCrKvPHXWDywAwuDUeDwWBpc69XK3pNX0uKiVt8g5z96PJ6z9xCFA==" - "resolved" "https://registry.npmjs.org/@octokit/plugin-request-log/-/plugin-request-log-1.0.4.tgz" - "version" "1.0.4" + version "1.0.4" + resolved "https://registry.npmjs.org/@octokit/plugin-request-log/-/plugin-request-log-1.0.4.tgz" + integrity sha512-mLUsMkgP7K/cnFEw07kWqXGF5LKrOkD+lhCrKvPHXWDywAwuDUeDwWBpc69XK3pNX0uKiVt8g5z96PJ6z9xCFA== "@octokit/plugin-rest-endpoint-methods@^5.12.0": - "integrity" "sha512-uJjMTkN1KaOIgNtUPMtIXDOjx6dGYysdIFhgA52x4xSadQCz3b/zJexvITDVpANnfKPW/+E0xkOvLntqMYpviA==" - "resolved" "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-5.13.0.tgz" - "version" "5.13.0" + version "5.13.0" + resolved "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-5.13.0.tgz" + integrity sha512-uJjMTkN1KaOIgNtUPMtIXDOjx6dGYysdIFhgA52x4xSadQCz3b/zJexvITDVpANnfKPW/+E0xkOvLntqMYpviA== dependencies: "@octokit/types" "^6.34.0" - "deprecation" "^2.3.1" + deprecation "^2.3.1" "@octokit/request-error@^2.0.5", "@octokit/request-error@^2.1.0": - "integrity" "sha512-1VIvgXxs9WHSjicsRwq8PlR2LR2x6DwsJAaFgzdi0JfJoGSO8mYI/cHJQ+9FbN21aa+DrgNLnwObmyeSC8Rmpg==" - "resolved" "https://registry.npmjs.org/@octokit/request-error/-/request-error-2.1.0.tgz" - "version" "2.1.0" + version "2.1.0" + resolved "https://registry.npmjs.org/@octokit/request-error/-/request-error-2.1.0.tgz" + integrity sha512-1VIvgXxs9WHSjicsRwq8PlR2LR2x6DwsJAaFgzdi0JfJoGSO8mYI/cHJQ+9FbN21aa+DrgNLnwObmyeSC8Rmpg== dependencies: "@octokit/types" "^6.0.3" - "deprecation" "^2.0.0" - "once" "^1.4.0" + deprecation "^2.0.0" + once "^1.4.0" "@octokit/request@^5.6.0": - "integrity" "sha512-je66CvSEVf0jCpRISxkUcCa0UkxmFs6eGDRSbfJtAVwbLH5ceqF+YEyC8lj8ystKyZTy8adWr0qmkY52EfOeLA==" - "resolved" "https://registry.npmjs.org/@octokit/request/-/request-5.6.2.tgz" - "version" "5.6.2" + version "5.6.2" + resolved "https://registry.npmjs.org/@octokit/request/-/request-5.6.2.tgz" + integrity sha512-je66CvSEVf0jCpRISxkUcCa0UkxmFs6eGDRSbfJtAVwbLH5ceqF+YEyC8lj8ystKyZTy8adWr0qmkY52EfOeLA== dependencies: "@octokit/endpoint" "^6.0.1" "@octokit/request-error" "^2.1.0" "@octokit/types" "^6.16.1" - "is-plain-object" "^5.0.0" - "node-fetch" "^2.6.1" - "universal-user-agent" "^6.0.0" + is-plain-object "^5.0.0" + node-fetch "^2.6.1" + universal-user-agent "^6.0.0" "@octokit/rest@^18.10.0": - "integrity" "sha512-gDPiOHlyGavxr72y0guQEhLsemgVjwRePayJ+FcKc2SJqKUbxbkvf5kAZEWA/MKvsfYlQAMVzNJE3ezQcxMJ2Q==" - "resolved" "https://registry.npmjs.org/@octokit/rest/-/rest-18.12.0.tgz" - "version" "18.12.0" + version "18.12.0" + resolved "https://registry.npmjs.org/@octokit/rest/-/rest-18.12.0.tgz" + integrity sha512-gDPiOHlyGavxr72y0guQEhLsemgVjwRePayJ+FcKc2SJqKUbxbkvf5kAZEWA/MKvsfYlQAMVzNJE3ezQcxMJ2Q== dependencies: "@octokit/core" "^3.5.1" "@octokit/plugin-paginate-rest" "^2.16.8" @@ -97,84 +97,84 @@ "@octokit/plugin-rest-endpoint-methods" "^5.12.0" "@octokit/types@^6.0.3", "@octokit/types@^6.16.1", "@octokit/types@^6.34.0": - "integrity" "sha512-s1zLBjWhdEI2zwaoSgyOFoKSl109CUcVBCc7biPJ3aAf6LGLU6szDvi31JPU7bxfla2lqfhjbbg/5DdFNxOwHw==" - "resolved" "https://registry.npmjs.org/@octokit/types/-/types-6.34.0.tgz" - "version" "6.34.0" + version "6.34.0" + resolved "https://registry.npmjs.org/@octokit/types/-/types-6.34.0.tgz" + integrity sha512-s1zLBjWhdEI2zwaoSgyOFoKSl109CUcVBCc7biPJ3aAf6LGLU6szDvi31JPU7bxfla2lqfhjbbg/5DdFNxOwHw== dependencies: "@octokit/openapi-types" "^11.2.0" -"axios@^0.21.4": - "integrity" "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==" - "resolved" "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz" - "version" "0.21.4" +axios@^0.21.4: + version "0.21.4" + resolved "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz" + integrity sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg== dependencies: - "follow-redirects" "^1.14.0" - -"before-after-hook@^2.2.0": - "integrity" "sha512-3pZEU3NT5BFUo/AD5ERPWOgQOCZITni6iavr5AUw5AUwQjMlI0kzu5btnyD39AF0gUEsDPwJT+oY1ORBJijPjQ==" - "resolved" "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.2.tgz" - "version" "2.2.2" - -"deprecation@^2.0.0", "deprecation@^2.3.1": - "integrity" "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==" - "resolved" "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz" - "version" "2.3.1" - -"follow-redirects@^1.14.0": - "integrity" "sha512-wtphSXy7d4/OR+MvIFbCVBDzZ5520qV8XfPklSN5QtxuMUJZ+b0Wnst1e1lCDocfzuCkHqj8k0FpZqO+UIaKNA==" - "resolved" "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.5.tgz" - "version" "1.14.5" - -"is-plain-object@^5.0.0": - "integrity" "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==" - "resolved" "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz" - "version" "5.0.0" - -"kibana-buildkite-library@github:elastic/kibana-buildkite-library": - "resolved" "git+ssh://git@github.com/elastic/kibana-buildkite-library.git#ccf5b824c4294d1fdf3569d32218d3bdb0958121" - "version" "1.0.0" + follow-redirects "^1.14.0" + +before-after-hook@^2.2.0: + version "2.2.2" + resolved "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.2.tgz" + integrity sha512-3pZEU3NT5BFUo/AD5ERPWOgQOCZITni6iavr5AUw5AUwQjMlI0kzu5btnyD39AF0gUEsDPwJT+oY1ORBJijPjQ== + +deprecation@^2.0.0, deprecation@^2.3.1: + version "2.3.1" + resolved "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz" + integrity sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ== + +follow-redirects@^1.14.0: + version "1.14.5" + resolved "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.5.tgz" + integrity sha512-wtphSXy7d4/OR+MvIFbCVBDzZ5520qV8XfPklSN5QtxuMUJZ+b0Wnst1e1lCDocfzuCkHqj8k0FpZqO+UIaKNA== + +is-plain-object@^5.0.0: + version "5.0.0" + resolved "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz" + integrity sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q== + +kibana-buildkite-library@elastic/kibana-buildkite-library: + version "1.0.0" + resolved "https://codeload.github.com/elastic/kibana-buildkite-library/tar.gz/bd0bec4c7af5f64a12c781d03cedb9fb2386bfbd" dependencies: "@octokit/rest" "^18.10.0" - "axios" "^0.21.4" + axios "^0.21.4" -"node-fetch@^2.6.1": - "integrity" "sha512-Z8/6vRlTUChSdIgMa51jxQ4lrw/Jy5SOW10ObaA47/RElsAN2c5Pn8bTgFGWn/ibwzXTE8qwr1Yzx28vsecXEA==" - "resolved" "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.6.tgz" - "version" "2.6.6" +node-fetch@^2.6.1: + version "2.6.6" + resolved "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.6.tgz" + integrity sha512-Z8/6vRlTUChSdIgMa51jxQ4lrw/Jy5SOW10ObaA47/RElsAN2c5Pn8bTgFGWn/ibwzXTE8qwr1Yzx28vsecXEA== dependencies: - "whatwg-url" "^5.0.0" + whatwg-url "^5.0.0" -"once@^1.4.0": - "integrity" "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=" - "resolved" "https://registry.npmjs.org/once/-/once-1.4.0.tgz" - "version" "1.4.0" +once@^1.4.0: + version "1.4.0" + resolved "https://registry.npmjs.org/once/-/once-1.4.0.tgz" + integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= dependencies: - "wrappy" "1" - -"tr46@~0.0.3": - "integrity" "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=" - "resolved" "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz" - "version" "0.0.3" - -"universal-user-agent@^6.0.0": - "integrity" "sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w==" - "resolved" "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz" - "version" "6.0.0" - -"webidl-conversions@^3.0.0": - "integrity" "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=" - "resolved" "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz" - "version" "3.0.1" - -"whatwg-url@^5.0.0": - "integrity" "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=" - "resolved" "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz" - "version" "5.0.0" + wrappy "1" + +tr46@~0.0.3: + version "0.0.3" + resolved "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz" + integrity sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o= + +universal-user-agent@^6.0.0: + version "6.0.0" + resolved "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz" + integrity sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w== + +webidl-conversions@^3.0.0: + version "3.0.1" + resolved "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz" + integrity sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE= + +whatwg-url@^5.0.0: + version "5.0.0" + resolved "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz" + integrity sha1-lmRU6HZUYuN2RNNib2dCzotwll0= dependencies: - "tr46" "~0.0.3" - "webidl-conversions" "^3.0.0" + tr46 "~0.0.3" + webidl-conversions "^3.0.0" -"wrappy@1": - "integrity" "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" - "resolved" "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz" - "version" "1.0.2" +wrappy@1: + version "1.0.2" + resolved "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz" + integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= diff --git a/.ci/.storybook/main.js b/.ci/.storybook/main.js index 37f3391337308..c4e017179021a 100644 --- a/.ci/.storybook/main.js +++ b/.ci/.storybook/main.js @@ -7,7 +7,7 @@ */ const config = require('@kbn/storybook').defaultConfig; -const aliases = require('../../src/dev/storybook/aliases.ts').storybookAliases; +const aliases = require('../../src/dev/storybook/aliases').storybookAliases; config.refs = {}; diff --git a/.ci/ci_groups.yml b/.ci/ci_groups.yml index 1be6e8c196a2d..c3786f299d4c0 100644 --- a/.ci/ci_groups.yml +++ b/.ci/ci_groups.yml @@ -39,4 +39,7 @@ xpack: - ciGroup25 - ciGroup26 - ciGroup27 - - ciGroupDocker + - ciGroup28 + - ciGroup29 + - ciGroup30 + - ciGroup31 diff --git a/.eslintrc.js b/.eslintrc.js index 08af34d24e7f5..dfbdd4de96f0a 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -840,7 +840,10 @@ module.exports = { }, ], 'react-hooks/rules-of-hooks': 'error', // Checks rules of Hooks - 'react-hooks/exhaustive-deps': ['error', { additionalHooks: '^useFetcher$' }], + 'react-hooks/exhaustive-deps': [ + 'error', + { additionalHooks: '^(useFetcher|useProgressiveFetcher)$' }, + ], }, }, { @@ -1452,6 +1455,20 @@ module.exports = { plugins: ['react', '@typescript-eslint'], files: ['x-pack/plugins/osquery/**/*.{js,mjs,ts,tsx}'], rules: { + 'padding-line-between-statements': [ + 'error', + { + blankLine: 'always', + prev: ['block-like'], + next: ['*'], + }, + { + blankLine: 'always', + prev: ['*'], + next: ['return'], + }, + ], + 'padded-blocks': ['error', 'always'], 'arrow-body-style': ['error', 'as-needed'], 'prefer-arrow-callback': 'error', 'no-unused-vars': 'off', diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index a06ddaf49822f..869160bfa0fd1 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -133,7 +133,7 @@ #CC# /x-pack/plugins/observability/ @elastic/apm-ui # Uptime -/x-pack/plugins/uptime @elastic/uptime +/x-pack/plugins/synthetics @elastic/uptime /x-pack/plugins/ux @elastic/uptime /x-pack/test/functional_with_es_ssl/apps/uptime @elastic/uptime /x-pack/test/functional/apps/uptime @elastic/uptime @@ -220,12 +220,14 @@ /packages/kbn-ambient-ui-types/ @elastic/kibana-operations /packages/kbn-ambient-storybook-types/ @elastic/kibana-operations /packages/kbn-bazel-packages/ @elastic/kibana-operations +/packages/kbn-bazel-runner/ @elastic/kibana-operations /packages/kbn-cli-dev-mode/ @elastic/kibana-operations /packages/kbn-dev-utils*/ @elastic/kibana-operations /packages/kbn-es-archiver/ @elastic/kibana-operations /packages/kbn-es/ @elastic/kibana-operations /packages/kbn-eslint-plugin-imports/ @elastic/kibana-operations /packages/kbn-generate/ @elastic/kibana-operations +/packages/kbn-import-resolver/ @elastic/kibana-operations /packages/kbn-optimizer/ @elastic/kibana-operations /packages/kbn-plugin-discovery/ @elastic/kibana-operations /packages/kbn-pm/ @elastic/kibana-operations @@ -268,7 +270,7 @@ /x-pack/plugins/saved_objects_tagging/ @elastic/kibana-core /x-pack/test/saved_objects_field_count/ @elastic/kibana-core /x-pack/test/saved_object_tagging/ @elastic/kibana-core -/packages/elastic-analytics/ @elastic/kibana-core +/packages/analytics/ @elastic/kibana-core /packages/kbn-config-schema/ @elastic/kibana-core /packages/kbn-std/ @elastic/kibana-core /packages/kbn-config/ @elastic/kibana-core @@ -400,8 +402,149 @@ #CC# /x-pack/plugins/security_solution/ @elastic/security-solution # Security Solution sub teams -/x-pack/plugins/timelines @elastic/security-threat-hunting -/x-pack/plugins/lists @elastic/security-detections-response + +## Security Solution sub teams - Threat Hunting Investigations +/x-pack/plugins/timelines @elastic/security-threat-hunting-investigations + +/x-pack/plugins/security_solution/common/search_strategy/timeline @elastic/security-threat-hunting-investigations +/x-pack/plugins/security_solution/common/types/timeline @elastic/security-threat-hunting-investigations + +/x-pack/plugins/security_solution/cypress/integration/timeline_templates @elastic/security-threat-hunting-investigations +/x-pack/plugins/security_solution/cypress/integration/timeline @elastic/security-threat-hunting-investigations +/x-pack/plugins/security_solution/cypress/integration/detection_alerts @elastic/security-threat-hunting-investigations +/x-pack/plugins/security_solution/cypress/integration/urls @elastic/security-threat-hunting-investigations + +/x-pack/plugins/security_solution/public/common/components/alerts_viewer @elastic/security-threat-hunting-investigations +/x-pack/plugins/security_solution/public/common/components/event_details @elastic/security-threat-hunting-investigations +/x-pack/plugins/security_solution/public/common/components/events_viewer @elastic/security-threat-hunting-investigations +/x-pack/plugins/security_solution/public/common/components/markdown_editor @elastic/security-threat-hunting-investigations +/x-pack/plugins/security_solution/public/detections/components/alerts_kpis @elastic/security-threat-hunting-investigations +/x-pack/plugins/security_solution/public/detections/components/alerts_table @elastic/security-threat-hunting-investigations +/x-pack/plugins/security_solution/public/detections/components/alerts_info @elastic/security-threat-hunting-investigations +/x-pack/plugins/security_solution/public/resolver @elastic/security-threat-hunting-investigations +/x-pack/plugins/security_solution/public/timelines @elastic/security-threat-hunting-investigations + +/x-pack/plugins/security_solution/server/lib/timeline @elastic/security-threat-hunting-investigations + +## Security Solution sub teams - Threat Hunting Explore +/x-pack/plugins/security_solution/common/search_strategy/security_solution/hosts @elastic/security-threat-hunting-explore +/x-pack/plugins/security_solution/common/search_strategy/security_solution/matrix_histogram @elastic/security-threat-hunting-explore +/x-pack/plugins/security_solution/common/search_strategy/security_solution/network @elastic/security-threat-hunting-explore +/x-pack/plugins/security_solution/common/search_strategy/security_solution/user @elastic/security-threat-hunting-explore + +/x-pack/plugins/security_solution/cypress/integration/cases @elastic/security-threat-hunting-explore +/x-pack/plugins/security_solution/cypress/integration/host_details @elastic/security-threat-hunting-explore +/x-pack/plugins/security_solution/cypress/integration/hosts @elastic/security-threat-hunting-explore +/x-pack/plugins/security_solution/cypress/integration/network @elastic/security-threat-hunting-explore +/x-pack/plugins/security_solution/cypress/integration/overview @elastic/security-threat-hunting-explore +/x-pack/plugins/security_solution/cypress/integration/pagination @elastic/security-threat-hunting-explore +/x-pack/plugins/security_solution/cypress/integration/users @elastic/security-threat-hunting-explore +/x-pack/plugins/security_solution/cypress/screens/hosts @elastic/security-threat-hunting-explore +/x-pack/plugins/security_solution/cypress/screens/network @elastic/security-threat-hunting-explore +/x-pack/plugins/security_solution/cypress/tasks/hosts @elastic/security-threat-hunting-explore +/x-pack/plugins/security_solution/cypress/tasks/network @elastic/security-threat-hunting-explore +/x-pack/plugins/security_solution/cypress/upgrade_integration/threat_hunting/cases @elastic/security-threat-hunting-explore + +/x-pack/plugins/security_solution/public/common/components/charts @elastic/security-threat-hunting-explore +/x-pack/plugins/security_solution/public/common/components/header_page @elastic/security-threat-hunting-explore +/x-pack/plugins/security_solution/public/common/components/header_section @elastic/security-threat-hunting-explore +/x-pack/plugins/security_solution/public/common/components/inspect @elastic/security-threat-hunting-explore +/x-pack/plugins/security_solution/public/common/components/last_event_time @elastic/security-threat-hunting-explore +/x-pack/plugins/security_solution/public/common/components/links @elastic/security-threat-hunting-explore +/x-pack/plugins/security_solution/public/common/components/matrix_histogram @elastic/security-threat-hunting-explore +/x-pack/plugins/security_solution/public/common/components/navigation @elastic/security-threat-hunting-explore +/x-pack/plugins/security_solution/public/common/components/news_feed @elastic/security-threat-hunting-explore +/x-pack/plugins/security_solution/public/common/components/overview_description_list @elastic/security-threat-hunting-explore +/x-pack/plugins/security_solution/public/common/components/paginated_table @elastic/security-threat-hunting-explore +/x-pack/plugins/security_solution/public/common/components/sidebar_header @elastic/security-threat-hunting-explore +/x-pack/plugins/security_solution/public/common/components/stat_items @elastic/security-threat-hunting-explore +/x-pack/plugins/security_solution/public/common/components/tables @elastic/security-threat-hunting-explore +/x-pack/plugins/security_solution/public/common/components/top_n @elastic/security-threat-hunting-explore +/x-pack/plugins/security_solution/public/common/components/with_hover_actions @elastic/security-threat-hunting-explore +/x-pack/plugins/security_solution/public/common/containers/hosts_risk @elastic/security-threat-hunting-explore +/x-pack/plugins/security_solution/public/common/containers/matrix_histogram @elastic/security-threat-hunting-explore +/x-pack/plugins/security_solution/public/common/lib/cell_actions @elastic/security-threat-hunting-explore +/x-pack/plugins/security_solution/public/cases @elastic/security-threat-hunting-explore +/x-pack/plugins/security_solution/public/hosts @elastic/security-threat-hunting-explore +/x-pack/plugins/security_solution/public/network @elastic/security-threat-hunting-explore +/x-pack/plugins/security_solution/public/overview @elastic/security-threat-hunting-explore +/x-pack/plugins/security_solution/public/users @elastic/security-threat-hunting-explore + +/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/hosts @elastic/security-threat-hunting-explore +/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/matrix_histogram @elastic/security-threat-hunting-explore +/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/network @elastic/security-threat-hunting-explore +/x-pack/plugins/security_solution/server/search_strategy/security_solution/factory/users @elastic/security-threat-hunting-explore + +## Security Solution sub teams - Detections and Response Alerts +/x-pack/plugins/security_solution/public/detections/pages/alerts @elastic/security-detections-response-alerts + +/x-pack/plugins/security_solution/server/lib/detection_engine/migrations @elastic/security-detections-response-alerts +/x-pack/plugins/security_solution/server/lib/detection_engine/notifications @elastic/security-detections-response-alerts +/x-pack/plugins/security_solution/server/lib/detection_engine/schemas @elastic/security-detections-response-alerts +/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types @elastic/security-detections-response-alerts +/x-pack/plugins/security_solution/server/lib/detection_engine/signals @elastic/security-detections-response-alerts +/x-pack/plugins/security_solution/server/lib/detection_engine/routes/index @elastic/security-detections-response-alerts +/x-pack/plugins/security_solution/server/lib/detection_engine/routes/signals @elastic/security-detections-response-alerts + + +## Security Solution sub teams - Detections and Response Rules +/x-pack/plugins/security_solution/cypress/integration/detection_rules @elastic/security-detections-response-rules + +/x-pack/plugins/security_solution/public/detections/components/rules @elastic/security-detections-response-rules +/x-pack/plugins/security_solution/public/detections/components/severity @elastic/security-detections-response-rules +/x-pack/plugins/security_solution/public/detections/components/status @elastic/security-detections-response-rules +/x-pack/plugins/security_solution/public/rules @elastic/security-detections-response-rules +/x-pack/plugins/security_solution/public/common/components/health_truncate_text @elastic/security-detections-response-rules +/x-pack/plugins/security_solution/public/common/components/links_to_docs @elastic/security-detections-response-rules +/x-pack/plugins/security_solution/public/common/components/callouts @elastic/security-detections-response-rules +/x-pack/plugins/security_solution/public/detections/components/callouts @elastic/security-detections-response-rules +/x-pack/plugins/security_solution/public/detections/mitre @elastic/security-detections-response-rules +/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules @elastic/security-detections-response-rules +/x-pack/plugins/security_solution/public/detections/containers/detection_engine/rules @elastic/security-detections-response-rules + +/x-pack/plugins/security_solution/server/lib/detection_engine/rule_actions @elastic/security-detections-response-rules +/x-pack/plugins/security_solution/server/lib/detection_engine/rule_execution_log @elastic/security-detections-response-rules +/x-pack/plugins/security_solution/server/lib/detection_engine/rules @elastic/security-detections-response-rules +/x-pack/plugins/security_solution/server/lib/detection_engine/rule_types/factories @elastic/security-detections-response-rules +/x-pack/plugins/security_solution/server/utils @elastic/security-detections-response-rules +/x-pack/plugins/security_solution/server/lib/detection_engine/tags @elastic/security-detections-response-rules + +## Security Solution sub teams - Security Platform +/x-pack/plugins/lists @elastic/security-solution-platform + +/x-pack/plugins/security_solution/cypress/integration/data_sources @elastic/security-solution-platform +/x-pack/plugins/security_solution/cypress/integration/exceptions @elastic/security-solution-platform +/x-pack/plugins/security_solution/cypress/integration/value_lists @elastic/security-solution-platform + +/x-pack/plugins/security_solution/public/common/components/exceptions @elastic/security-solution-platform +/x-pack/plugins/security_solution/public/exceptions @elastic/security-solution-platform +/x-pack/plugins/security_solution/public/detections/containers/detection_engine/lists @elastic/security-solution-platform +/x-pack/plugins/security_solution/public/common/components/sourcerer @elastic/security-solution-platform + +/x-pack/plugins/security_solution/server/lib/sourcerer @elastic/security-solution-platform +/packages/kbn-securitysolution* @elastic/security-solution-platform + +## Security Threat Intelligence - Under Security Platform +/x-pack/plugins/security_solution/public/common/components/threat_match @elastic/security-solution-platform + +## Security Solution cross teams ownership +/x-pack/plugins/security_solution/cypress/downloads @elastic/security-detections-response @elastic/security-threat-hunting +/x-pack/plugins/security_solution/cypress/fixtures @elastic/security-detections-response @elastic/security-threat-hunting +/x-pack/plugins/security_solution/cypress/helpers @elastic/security-detections-response @elastic/security-threat-hunting +/x-pack/plugins/security_solution/cypress/objects @elastic/security-detections-response @elastic/security-threat-hunting +/x-pack/plugins/security_solution/cypress/plugins @elastic/security-detections-response @elastic/security-threat-hunting +/x-pack/plugins/security_solution/cypress/support @elastic/security-detections-response @elastic/security-threat-hunting +/x-pack/plugins/security_solution/cypress/urls @elastic/security-threat-hunting-investigations @elastic/security-solution-platform + +/x-pack/plugins/security_solution/screens/common @elastic/security-detections-response @elastic/security-threat-hunting + +/x-pack/plugins/security_solution/common/ecs @elastic/security-detections-response-rules @elastic/security-threat-hunting-investigations +/x-pack/plugins/security_solution/common/test @elastic/security-detections-response-rules @elastic/security-detections-response-alerts + +/x-pack/plugins/security_solution/public/common/components/hover_actions @elastic/security-threat-hunting-explore @elastic/security-threat-hunting-investigations + +/x-pack/plugins/security_solution/server/routes @elastic/security-detections-response-alerts @elastic/security-detections-response-rules + ## Security Solution sub teams - security-onboarding-and-lifecycle-mgt /x-pack/plugins/security_solution/public/management/ @elastic/security-onboarding-and-lifecycle-mgt @@ -429,15 +572,17 @@ x-pack/test/security_solution_cypress @elastic/security-engineering-productivity ## Security Solution sub teams - adaptive-workload-protection x-pack/plugins/session_view @elastic/awp-platform +x-pack/plugins/security_solution/public/common/components/sessions_viewer @elastic/awp-platform # Security Intelligence And Analytics /x-pack/plugins/security_solution/server/lib/detection_engine/rules/prepackaged_rules @elastic/security-intelligence-analytics + # Security Asset Management /x-pack/plugins/osquery @elastic/security-asset-management # Cloud Security Posture -/x-pack/plugins/cloud_security_posture/ @elastic/cloud-security-posture-control-plane +/x-pack/plugins/cloud_security_posture/ @elastic/kibana-cloud-security-posture # Design (at the bottom for specificity of SASS files) **/*.scss @elastic/kibana-design @@ -462,10 +607,12 @@ x-pack/plugins/session_view @elastic/awp-platform # Reporting /x-pack/examples/reporting_example/ @elastic/kibana-reporting-services @elastic/kibana-app-services +/x-pack/examples/screenshotting_example/ @elastic/kibana-reporting-services @elastic/kibana-app-services /x-pack/plugins/reporting/ @elastic/kibana-reporting-services @elastic/kibana-app-services /x-pack/test/functional/apps/dashboard/reporting/ @elastic/kibana-reporting-services @elastic/kibana-app-services /x-pack/test/functional/apps/reporting/ @elastic/kibana-reporting-services @elastic/kibana-app-services /x-pack/test/functional/apps/reporting_management/ @elastic/kibana-reporting-services @elastic/kibana-app-services +/x-pack/test/examples/screenshotting/ @elastic/kibana-reporting-services @elastic/kibana-app-services /x-pack/test/functional/es_archives/lens/reporting/ @elastic/kibana-reporting-services @elastic/kibana-app-services /x-pack/test/functional/es_archives/reporting/ @elastic/kibana-reporting-services @elastic/kibana-app-services /x-pack/test/functional/fixtures/kbn_archiver/reporting/ @elastic/kibana-reporting-services @elastic/kibana-app-services @@ -484,6 +631,7 @@ x-pack/plugins/session_view @elastic/awp-platform ## Shared UX /src/plugins/shared_ux/ @elastic/shared-ux +/packages/shared-ux/ @elastic/shared-ux /packages/shared-ux-*/ @elastic/shared-ux /src/plugins/kibana_react/ @elastic/shared-ux /src/plugins/kibana_react/public/code_editor @elastic/shared-ux @elastic/kibana-presentation diff --git a/.gitignore b/.gitignore index 588c185b17a0b..7c20367dfe6de 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ node_modules !/src/dev/npm/integration_tests/__fixtures__/fixture1/node_modules !/src/dev/notice/__fixtures__/node_modules +!/packages/kbn-import-resolver/src/__fixtures__/node_modules trash /optimize /built_assets @@ -98,4 +99,5 @@ elastic-agent-* fleet-server-* elastic-agent.yml fleet-server.yml +/packages/kbn-synthetic-package-map/synthetic-packages.json diff --git a/.i18nrc.json b/.i18nrc.json index 573462d497438..a5d1b36ede73d 100644 --- a/.i18nrc.json +++ b/.i18nrc.json @@ -66,6 +66,7 @@ "share": "src/plugins/share", "sharedUX": "src/plugins/shared_ux", "sharedUXComponents": "packages/kbn-shared-ux-components/src", + "sharedUXPackages": "packages/shared-ux", "coloring": "packages/kbn-coloring/src", "statusPage": "src/legacy/core_plugins/status_page", "telemetry": [ diff --git a/WORKSPACE.bazel b/WORKSPACE.bazel index 8100e93bcd4df..891389d803a56 100644 --- a/WORKSPACE.bazel +++ b/WORKSPACE.bazel @@ -10,14 +10,12 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # Fetch Node.js rules http_archive( name = "build_bazel_rules_nodejs", - sha256 = "2b2004784358655f334925e7eadc7ba80f701144363df949b3293e1ae7a2fb7b", - urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/5.4.0/rules_nodejs-5.4.0.tar.gz"], + patch_args = ["-p1"], + patches = ["//:src/dev/bazel/rules_nodejs_patches/normalized_paths_for_windows_runfiles.patch"], + sha256 = "6f15d75f9e99c19d9291ff8e64e4eb594a6b7d25517760a75ad3621a7a48c2df", + urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/4.7.0/rules_nodejs-4.7.0.tar.gz"], ) -# Build Node.js rules dependencies -load("@build_bazel_rules_nodejs//:repositories.bzl", "build_bazel_rules_nodejs_dependencies") -build_bazel_rules_nodejs_dependencies() - # Now that we have the rules let's import from them to complete the work load("@build_bazel_rules_nodejs//:index.bzl", "node_repositories", "yarn_install") @@ -39,7 +37,7 @@ node_repositories( node_urls = [ "https://nodejs.org/dist/v{version}/{filename}", ], - yarn_releases = { + yarn_repositories = { "1.21.1": ("yarn-v1.21.1.tar.gz", "yarn-v1.21.1", "d1d9f4a0f16f5ed484e814afeb98f39b82d4728c6c8beaafb5abc99c02db6674"), }, yarn_version = "1.21.1", diff --git a/config/kibana.yml b/config/kibana.yml index 50ddad9a4b32a..4233bf2882a29 100644 --- a/config/kibana.yml +++ b/config/kibana.yml @@ -159,8 +159,8 @@ # =================== Search Autocomplete =================== # Time in milliseconds to wait for autocomplete suggestions from Elasticsearch. # This value must be a whole number greater than zero. Defaults to 1000ms -#data.autocomplete.valueSuggestions.timeout: 1000 +#unifiedSearch.autocomplete.valueSuggestions.timeout: 1000 # Maximum number of documents loaded by each shard to generate autocomplete suggestions. # This value must be a whole number greater than zero. Defaults to 100_000 -#data.autocomplete.valueSuggestions.terminateAfter: 100000 +#unifiedSearch.autocomplete.valueSuggestions.terminateAfter: 100000 diff --git a/dev_docs/tutorials/screenshotting.mdx b/dev_docs/tutorials/screenshotting.mdx new file mode 100644 index 0000000000000..76f2859928491 --- /dev/null +++ b/dev_docs/tutorials/screenshotting.mdx @@ -0,0 +1,87 @@ +--- +id: kibDevTutorialScreenshotting +slug: /kibana-dev-docs/tutorials/screenshotting +title: Kibana Screenshotting Service +summary: Kibana Screenshotting Service +date: 2022-04-12 +tags: ['kibana', 'onboarding', 'dev', 'architecture'] +--- + +## Screenshotting Plugin + +This plugin provides functionality to take screenshots of the Kibana pages. +It uses Chromium and Puppeteer underneath to run the browser in headless mode. + +If you are planning to integrate with the screenshotting plugin, please get in touch with the App Services team to know all the limitations. + +### Capabilities +- Canvas workpads screenshots. +- Dashboards screenshots. +- Expressions screenshots. +- PDF generation. +- Batch screenshotting. + +### Usage +After listing the `screenshotting` plugin in your dependencies, the plugin will be intitalized on the setup stage. +The intitalization process downloads (if it is not already present) and verifies the Chromium build. + +The start contract exposes a public API to interact with the plugin. +Apart from the actual screenshotting functionality, it also provides a way for self-diagnostics. + +Here is an example of how you can take a screenshot of a Kibana URL. + + +```typescript +import { lastValueFrom } from 'rxjs'; +import type { CoreSetup, Plugin } from 'src/core/server'; +import type { ScreenshottingStart } from 'x-pack/plugins/screenshotting/server'; + + +interface StartDeps { + screenshotting: ScreenshottingStart; +} + +class ExamplePlugin implements Plugin { + setup({ http, getStartServices }: CoreSetup) { + const router = http.createRouter(); + + router.get( + { + path: '/api/capture', + validate: { + query: schema.object({ + id: schema.string(), + }), + }, + }, + async (context, request, response) => { + const [, { screenshotting }] = await getStartServices(); + const { metrics, results } = await lastValueFrom( + screenshotting.getScreenshots({ + request, + urls: [`http://localhost/app/canvas#/workpad/workpad-${request.query.id}`], + }) + ); + + return response.ok({ + body: JSON.stringify({ + metrics, + image: results[0]?.screenshots[0]?.data.toString('base64'), + errors: results[0]?.renderErrors, + } as ScreenshottingExpressionResponse), + }); + } + ); + } + + start() {} +} + +export function plugin() { + return new ExamplePlugin(); +} +``` + + + Check the complete API reference . + diff --git a/docs/api/cases.asciidoc b/docs/api/cases.asciidoc index 3b5bfaeceaff4..9ffe69997f714 100644 --- a/docs/api/cases.asciidoc +++ b/docs/api/cases.asciidoc @@ -8,22 +8,22 @@ these APIs: * <> * <> * <> -* {security-guide}/cases-api-find-alert.html[Find all alerts attached to a case] * <> -* {security-guide}/cases-api-find-cases-by-alert.html[Find cases by alert] * <> +* <> * <> * <> * <> +* <> * <> -* {security-guide}/cases-get-connector.html[Get current connector] +* <> * <> * <> -* {security-guide}/cases-api-push.html[Push case] -* {security-guide}/assign-connector.html[Set default Elastic Security UI connector] -* {security-guide}/case-api-update-connector.html[Update case configurations] +* <> +* <> * <> * <> +* <> //ADD include::cases/cases-api-add-comment.asciidoc[leveloffset=+1] @@ -36,12 +36,20 @@ include::cases/cases-api-delete-comments.asciidoc[leveloffset=+1] include::cases/cases-api-find-cases.asciidoc[leveloffset=+1] include::cases/cases-api-find-connectors.asciidoc[leveloffset=+1] //GET +include::cases/cases-api-get-alerts.asciidoc[leveloffset=+1] include::cases/cases-api-get-case-activity.asciidoc[leveloffset=+1] include::cases/cases-api-get-case.asciidoc[leveloffset=+1] include::cases/cases-api-get-status.asciidoc[leveloffset=+1] +include::cases/cases-api-get-cases-by-alert.asciidoc[leveloffset=+1] include::cases/cases-api-get-comments.asciidoc[leveloffset=+1] +include::cases/cases-api-get-configuration.asciidoc[leveloffset=+1] include::cases/cases-api-get-reporters.asciidoc[leveloffset=+1] include::cases/cases-api-get-tags.asciidoc[leveloffset=+1] +//PUSH +include::cases/cases-api-push.asciidoc[leveloffset=+1] +//SET +include::cases/cases-api-set-configuration.asciidoc[leveloffset=+1] //UPDATE include::cases/cases-api-update.asciidoc[leveloffset=+1] include::cases/cases-api-update-comment.asciidoc[leveloffset=+1] +include::cases/cases-api-update-configuration.asciidoc[leveloffset=+1] diff --git a/docs/api/cases/cases-api-add-comment.asciidoc b/docs/api/cases/cases-api-add-comment.asciidoc index 20b558a89c683..df63cc0ecd65f 100644 --- a/docs/api/cases/cases-api-add-comment.asciidoc +++ b/docs/api/cases/cases-api-add-comment.asciidoc @@ -6,21 +6,20 @@ Adds a comment to a case. -=== Request +=== {api-request-title} `POST :/api/cases//comments` `POST :/s//api/cases//comments` -=== Prerequisite +=== {api-prereq-title} You must have `all` privileges for the *Cases* feature in the *Management*, *{observability}*, or *Security* section of the <>, depending on the `owner` of the case you're updating. - -=== Path parameters +=== {api-path-parms-title} ``:: (Required,string) The identifier for the case. To retrieve case IDs, use @@ -30,7 +29,7 @@ You must have `all` privileges for the *Cases* feature in the *Management*, (Optional, string) An identifier for the space. If it is not specified, the default space is used. -=== Request body +=== {api-request-body-title} `alertId`:: (Required*, string) The alert identifier. It is required only when `type` is @@ -65,12 +64,12 @@ only when `type` is `alert`. preview:[] `type`:: (Required, string) The comment type, which must be `user` or `alert`. -=== Response code +=== {api-response-codes-title} `200`:: Indicates a successful call. -=== Example +=== {api-examples-title} Add a comment to case ID `293f1bc0-74f6-11ea-b83a-553aecdb28b6`: diff --git a/docs/api/cases/cases-api-create.asciidoc b/docs/api/cases/cases-api-create.asciidoc index f08b69998321f..b7a97fc9cb1b2 100644 --- a/docs/api/cases/cases-api-create.asciidoc +++ b/docs/api/cases/cases-api-create.asciidoc @@ -6,26 +6,26 @@ Creates a case. -=== Request +=== {api-request-title} `POST :/api/cases` `POST :/s//api/cases` -=== Prerequisite +=== {api-prereq-title} You must have `all` privileges for the *Cases* feature in the *Management*, *{observability}*, or *Security* section of the <>, depending on the `owner` of the case you're creating. -=== Path parameters +=== {api-path-parms-title} ``:: (Optional, string) An identifier for the space. If it is not specified, the default space is used. -=== Request body +=== {api-request-body-title} `connector`:: (Required, object) An object that contains the connector configuration. @@ -107,8 +107,8 @@ For {swimlane} connectors, specify: `id`:: (Required, string) The identifier for the connector. To create a case without a -connector, use `none`. -//To retrieve connector IDs, use <>). +connector, use `none`. To retrieve connector IDs, use +<>. `name`:: (Required, string) The name of the connector. To create a case without a @@ -147,12 +147,12 @@ categorize cases. It can be an empty array. `title`:: (Required, string) A title for the case. -=== Response code +=== {api-response-codes-title} `200`:: Indicates a successful call. -=== Example +=== {api-examples-title} [source,sh] -------------------------------------------------- diff --git a/docs/api/cases/cases-api-delete-cases.asciidoc b/docs/api/cases/cases-api-delete-cases.asciidoc index 5e4436806f14f..05e9fe3e2898c 100644 --- a/docs/api/cases/cases-api-delete-cases.asciidoc +++ b/docs/api/cases/cases-api-delete-cases.asciidoc @@ -6,26 +6,26 @@ Deletes one or more cases. -=== Request +=== {api-request-title} `DELETE :/api/cases?ids=["",""]` `DELETE :/s//api/cases?ids=["",""]` -=== Prerequisite +=== {api-prereq-title} You must have `all` privileges for the *Cases* feature in the *Management*, *{observability}*, or *Security* section of the <>, depending on the `owner` of the cases you're deleting. -=== Path parameters +=== {api-path-parms-title} ``:: (Optional, string) An identifier for the space. If it is not specified, the default space is used. -=== Query parameters +=== {api-query-parms-title} `ids`:: (Required, string) The cases that you want to remove. To retrieve case IDs, use @@ -33,12 +33,12 @@ default space is used. + NOTE: All non-ASCII characters must be URL encoded. -==== Response code +=== {api-response-codes-title} `204`:: Indicates a successful call. -=== Example +=== {api-examples-title} Delete cases with these IDs: diff --git a/docs/api/cases/cases-api-delete-comments.asciidoc b/docs/api/cases/cases-api-delete-comments.asciidoc index 0b02786e6659d..c89407fb69ab8 100644 --- a/docs/api/cases/cases-api-delete-comments.asciidoc +++ b/docs/api/cases/cases-api-delete-comments.asciidoc @@ -6,7 +6,7 @@ Deletes one or all comments from a case. -=== Request +=== {api-request-title} `DELETE :/api/cases//comments` @@ -16,14 +16,14 @@ Deletes one or all comments from a case. `DELETE :/s//api/cases//comments/` -=== Prerequisite +=== {api-prereq-title} You must have `all` privileges for the *Cases* feature in the *Management*, *{observability}*, or *Security* section of the <>, depending on the `owner` of the cases you're updating. -=== Path parameters +=== {api-path-parms-title} ``:: (Required, string) The identifier for the case. To retrieve case IDs, use @@ -38,12 +38,12 @@ comments are deleted. (Optional, string) An identifier for the space. If it is not specified, the default space is used. -=== Response code +=== {api-response-codes-title} `204`:: Indicates a successful call. -=== Example +=== {api-examples-title} Delete all comments from case ID `9c235210-6834-11ea-a78c-6ffb38a34414`: diff --git a/docs/api/cases/cases-api-find-cases.asciidoc b/docs/api/cases/cases-api-find-cases.asciidoc index b6e87ad502d21..abd4e186ff706 100644 --- a/docs/api/cases/cases-api-find-cases.asciidoc +++ b/docs/api/cases/cases-api-find-cases.asciidoc @@ -6,26 +6,26 @@ Retrieves a paginated subset of cases. -=== Request +=== {api-request-title} `GET :/api/cases/_find` `GET :/s//api/cases/_find` -=== Prerequisite +=== {api-prereq-title} You must have `read` privileges for the *Cases* feature in the *Management*, *{observability}*, or *Security* section of the <>, depending on the `owner` of the cases you're seeking. -=== Path parameters +=== {api-path-parms-title} ``:: (Optional, string) An identifier for the space. If it is not specified, the default space is used. -=== Query parameters +=== {api-query-parms-title} `defaultSearchOperator`:: (Optional, string) The default operator to use for the `simple_query_string`. @@ -84,12 +84,12 @@ Defaults to `desc`. `to`:: (Optional, string) Returns only cases that were created before a specific date. The date must be specified as a <> data range or date match expression. preview:[] -=== Response code +=== {api-response-codes-title} `200`:: Indicates a successful call. -=== Example +=== {api-examples-title} Retrieve the first five cases with the `phishing` tag, in ascending order by last update time: diff --git a/docs/api/cases/cases-api-find-connectors.asciidoc b/docs/api/cases/cases-api-find-connectors.asciidoc index 8643d569c980b..0a1554cfde4f8 100644 --- a/docs/api/cases/cases-api-find-connectors.asciidoc +++ b/docs/api/cases/cases-api-find-connectors.asciidoc @@ -10,30 +10,30 @@ In particular, only the connectors that are supported for use in cases are returned. Refer to the list of supported external incident management systems in <>. -=== Request +=== {api-request-title} `GET :/api/cases/configure/connectors/_find` `GET :/s//api/cases/configure/connectors/_find` -=== Prerequisite +=== {api-prereq-title} You must have `read` privileges for the *Actions and Connectors* feature in the *Management* section of the <>. -=== Path parameters +=== {api-path-parms-title} ``:: (Optional, string) An identifier for the space. If it is not specified, the default space is used. -=== Response code +=== {api-response-codes-title} `200`:: Indicates a successful call. -=== Example +=== {api-examples-title} [source,sh] -------------------------------------------------- diff --git a/docs/api/cases/cases-api-get-alerts.asciidoc b/docs/api/cases/cases-api-get-alerts.asciidoc new file mode 100644 index 0000000000000..7df81f3a8974c --- /dev/null +++ b/docs/api/cases/cases-api-get-alerts.asciidoc @@ -0,0 +1,60 @@ +[[cases-api-get-alerts]] +== Get alerts attached to case API +++++ +Get alerts +++++ + +preview::[] + +Gets all alerts attached to a case. + +=== {api-request-title} + +`GET :/api/cases//alerts` + +`GET :/s//api/cases//alerts` + +=== {api-prereq-title} + +You must have `read` privileges for the *Cases* feature in the *Management*, +*{observability}*, or *Security* section of the +<>, depending on the +`owner` of the cases you're seeking. + +=== {api-path-parms-title} + +``:: +(Required, string) The identifier for the case. To retrieve case IDs, use +<>. + +``:: +(Optional, string) An identifier for the space. If it is not specified, the +default space is used. + +=== {api-response-codes-title} + +`200`:: + Indicates a successful call. + +=== {api-examples-title} + +Return all alerts attached to case `293f1bc0-74f6-11ea-b83a-553aecdb28b6`: + +[source,sh] +-------------------------------------------------- +GET api/cases/293f1bc0-74f6-11ea-b83a-553aecdb28b6/alerts +-------------------------------------------------- +// KIBANA + +The API returns a JSON array listing the alerts. For example: + +[source,json] +-------------------------------------------------- +[ + { + "id": "09f0c261e39e36351d75995b78bb83673774d1bc2cca9df2d15f0e5c0a99a540", + "index": ".internal.alerts-security.alerts-default-000001", + "attached_at": "2022-04-13T21:35:24.602Z" + } +] +-------------------------------------------------- diff --git a/docs/api/cases/cases-api-get-case-activity.asciidoc b/docs/api/cases/cases-api-get-case-activity.asciidoc index 92b16b7862462..25d102dc11ee7 100644 --- a/docs/api/cases/cases-api-get-case-activity.asciidoc +++ b/docs/api/cases/cases-api-get-case-activity.asciidoc @@ -8,20 +8,20 @@ Returns all user activity for the specified case. deprecated::[8.1.0] -=== Request +=== {api-request-title} `GET :/api/cases//user_actions` `GET :/s//api/cases//user_actions` -=== Prerequisite +=== {api-prereq-title} You must have `read` privileges for the *Cases* feature in the *Management*, *{observability}*, or *Security* section of the <>, depending on the `owner` of the cases you're seeking. -=== Path parameters +=== {api-path-parms-title} ``:: (Required, string) An identifier for the case to retrieve. Use @@ -31,12 +31,12 @@ You must have `read` privileges for the *Cases* feature in the *Management*, (Optional, string) An identifier for the space. If it is not specified, the default space is used. -==== Response code +=== {api-response-codes-title} `200`:: Indicates a successful call. -==== Example +=== {api-examples-title} Gets all activity for case ID `a18b38a0-71b0-11ea-a0b2-c51ea50a58e2`: diff --git a/docs/api/cases/cases-api-get-case.asciidoc b/docs/api/cases/cases-api-get-case.asciidoc index 6bd255f6f8326..5abb9ecc1903b 100644 --- a/docs/api/cases/cases-api-get-case.asciidoc +++ b/docs/api/cases/cases-api-get-case.asciidoc @@ -6,20 +6,20 @@ Returns a specified case. -=== Request +=== {api-request-title} `GET :/api/cases/` `GET :/s//api/cases/` -=== Prerequisite +=== {api-prereq-title} You must have `read` privileges for the *Cases* feature in the *Management*, *{observability}*, or *Security* section of the <>, depending on the `owner` of the cases you're seeking. -=== Path parameters +=== {api-path-parms-title} ``:: (Required, string) An identifier for the case to retrieve. Use @@ -29,19 +29,18 @@ You must have `read` privileges for the *Cases* feature in the *Management*, (Optional, string) An identifier for the space. If it is not specified, the default space is used. -=== Query parameters +=== {api-query-parms-title} `includeComments`:: (Optional, boolean) Determines whether case comments are returned. Defaults to `true`. deprecated:[8.1.0, "The `includeComments` query parameter is deprecated and will be removed in a future release."] - -==== Response code +=== {api-response-codes-title} `200`:: Indicates a successful call. -==== Example +=== {api-examples-title} Returns case ID `a18b38a0-71b0-11ea-a0b2-c51ea50a58e2` without comments: diff --git a/docs/api/cases/cases-api-get-cases-by-alert.asciidoc b/docs/api/cases/cases-api-get-cases-by-alert.asciidoc new file mode 100644 index 0000000000000..3bd2e8debb3cd --- /dev/null +++ b/docs/api/cases/cases-api-get-cases-by-alert.asciidoc @@ -0,0 +1,72 @@ +[[cases-api-get-cases-by-alert]] +== Get cases by alert API +++++ +Get cases by alert +++++ + +preview::[] + +Returns the cases associated with a specific alert. + +=== {api-request-title} + +`GET :/api/cases/alerts/` + +`GET :/s//api/cases/alerts/` + +=== {api-prereq-title} + +You must have `read` privileges for the *Cases* feature in the *Management*, +*{observability}*, or *Security* section of the +<>, depending on the +`owner` of the cases you're seeking. + +=== {api-path-parms-title} + +``:: +(Required, string) The alert identifier. + +``:: +(Optional, string) An identifier for the space. If it is not specified, the +default space is used. + +=== {api-query-parms-title} + +`owner`:: +(Optional, string or array of strings) A filter to limit the retrieved cases to +a specific set of applications. Valid values are: `cases`, `observability`, +and `securitySolution`. If this parameter is omitted, the response contains all +cases that the user has access to read. + +=== {api-response-codes-title} + +`200`:: + Indicates a successful call. + +=== {api-examples-title} + +Return cases associated with the alert ID +`09f0c261e39e36351d75995b78bb83673774d1bc2cca9df2d15f0e5c0a99a540`: + +[source,sh] +-------------------------------------------------- +GET api/cases/alerts/09f0c261e39e36351d75995b78bb83673774d1bc2cca9df2d15f0e5c0a99a540 +-------------------------------------------------- +// KIBANA + +The API returns a JSON array containing the identifier and title of the cases. +For example: + +[source,json] +-------------------------------------------------- +[ + { + "id": "8af6ac20-74f6-11ea-b83a-553aecdb28b6", + "title": "Case 1" + }, + { + "id": "a18b38a0-71b0-11ea-a0b2-c51ea50a58e2", + "title": "Case 2" + } +] +-------------------------------------------------- \ No newline at end of file diff --git a/docs/api/cases/cases-api-get-comments.asciidoc b/docs/api/cases/cases-api-get-comments.asciidoc index 6e88b6ffdf004..103731cd04dd7 100644 --- a/docs/api/cases/cases-api-get-comments.asciidoc +++ b/docs/api/cases/cases-api-get-comments.asciidoc @@ -6,7 +6,7 @@ Gets a comment or all comments for a case. -=== Request +=== {api-request-title} `GET :/api/cases//comments/` @@ -16,14 +16,14 @@ Gets a comment or all comments for a case. `GET :/s//api/cases//comments` deprecated:[8.1.0] -=== Prerequisite +=== {api-prereq-title} You must have `read` privileges for the *Cases* feature in the *Management*, *{observability}*, or *Security* section of the <>, depending on the `owner` of the cases with the comments you're seeking. -=== Path parameters +=== {api-path-parms-title} ``:: (Required, string) The identifier for the case. To retrieve case IDs, use @@ -40,12 +40,12 @@ deprecated:[8.1.0,The comment identifier will no longer be optional.] (Optional, string) An identifier for the space. If it is not specified, the default space is used. -=== Response code +=== {api-response-codes-title} `200`:: Indicates a successful call. -=== Example +=== {api-examples-title} Retrieves comment ID `71ec1870-725b-11ea-a0b2-c51ea50a58e2` from case ID `a18b38a0-71b0-11ea-a0b2-c51ea50a58e2`: diff --git a/docs/api/cases/cases-api-get-configuration.asciidoc b/docs/api/cases/cases-api-get-configuration.asciidoc new file mode 100644 index 0000000000000..778e95949e3f5 --- /dev/null +++ b/docs/api/cases/cases-api-get-configuration.asciidoc @@ -0,0 +1,95 @@ +[[cases-get-configuration]] +== Get case configuration API +++++ +Get configuration +++++ + +Retrieves external connection details, such as the closure type and +default connector for cases. + +=== {api-request-title} + +`GET :/api/cases/configure` + +`GET :/s//api/cases/configure` + +=== {api-prereq-title} + +You must have `read` privileges for the *Cases* feature in the *Management*, +*{observability}*, or *Security* section of the +<>, depending on the +`owner` of the case configuration. + +=== {api-path-parms-title} + +``:: +(Optional, string) An identifier for the space. If it is not specified, the +default space is used. + +=== {api-query-parms-title} + +`owner`:: +(Optional, string or array of strings) A filter to limit the retrieved +details to a specific set of applications. Valid values are: `cases`, +`observability`, and `securitySolution`. If this parameter is omitted, the +response contains information for all applications that the user has access to +read. + +=== Response code + +`200`:: + Indicates a successful call. + +=== Example + +[source,sh] +-------------------------------------------------- +GET api/cases/configure?owner=securitySolution +-------------------------------------------------- +// KIBANA + +The API returns the following type of information: + +[source,json] +-------------------------------------------------- +[ + { + "owner": "securitySolution", + "closure_type": "close-by-user", + "created_at": "2020-03-30T13:31:38.083Z", + "created_by": { + "email": "admin@hms.gov.uk", + "full_name": "Mr Admin", + "username": "admin" + }, + "updated_at": null, + "updated_by": null, + "connector": { + "id": "131d4448-abe0-4789-939d-8ef60680b498", + "name": "my-jira", + "type": ".jira", + "fields": null + }, + "mappings": [ + { + "source": "title", + "target": "summary", + "action_type": "overwrite" + }, + { + "source": "description", + "target": "description", + "action_type": "overwrite" + }, + { + "source": "comments", + "target": "comments", + "action_type": "append" + } + ], + "version": "WzE3NywxXQ==", + "error": null, + "id": "7349772f-421a-4de3-b8bb-2d9b22ccee30" + } +] +-------------------------------------------------- diff --git a/docs/api/cases/cases-api-get-reporters.asciidoc b/docs/api/cases/cases-api-get-reporters.asciidoc index eca8d3e45173f..331be71e9123a 100644 --- a/docs/api/cases/cases-api-get-reporters.asciidoc +++ b/docs/api/cases/cases-api-get-reporters.asciidoc @@ -6,32 +6,32 @@ Returns information about the users who opened cases. -=== Request +=== {api-request-title} `GET :/api/cases/reporters` `GET :/s/api/cases/reporters` -=== Prerequisite +=== {api-prereq-title} You must have `read` privileges for the *Cases* feature in the *Management*, *{observability}*, or *Security* section of the <>, depending on the `owner` of the cases you're seeking. -=== Query parameters +=== {api-query-parms-title} `owner`:: (Optional, string or array of strings) A filter to limit the retrieved reporters to a specific set of applications. If this parameter is omitted, the response will contain all reporters from cases that the user has access to read. -==== Response code +=== {api-response-codes-title} `200`:: Indicates a successful call. -==== Example +=== {api-examples-title} Returns all case reporters: diff --git a/docs/api/cases/cases-api-get-status.asciidoc b/docs/api/cases/cases-api-get-status.asciidoc index 62a8181feba8e..f96747dcc1116 100644 --- a/docs/api/cases/cases-api-get-status.asciidoc +++ b/docs/api/cases/cases-api-get-status.asciidoc @@ -8,26 +8,26 @@ Returns the number of cases that are open, closed, and in progress. deprecated::[8.1.0] -=== Request +=== {api-request-title} `GET :/api/cases/status` `GET :/s//api/cases/status` -=== Prerequisite +=== {api-prereq-title} You must have `read` privileges for the *Cases* feature in the *Management*, *{observability}*, or *Security* section of the <>, depending on the `owner` of the cases you're seeking. -=== Path parameters +=== {api-path-parms-title} :: (Optional, string) An identifier for the space. If it is not specified, the default space is used. -=== Query parameters +=== {api-query-parms-title} `owner`:: (Optional, string or array of strings) A filter to limit the retrieved case @@ -35,12 +35,12 @@ statistics to a specific set of applications. Valid values are: `cases`, `observability`, and `securitySolution`. If this parameter is omitted, the response contains all cases that the user has access to read. -=== Response code +=== {api-response-codes-title} `200`:: Indicates a successful call. -=== Example +=== {api-examples-title} [source,sh] -------------------------------------------------- diff --git a/docs/api/cases/cases-api-get-tags.asciidoc b/docs/api/cases/cases-api-get-tags.asciidoc index 426a7e91a0f47..5008411f37bdb 100644 --- a/docs/api/cases/cases-api-get-tags.asciidoc +++ b/docs/api/cases/cases-api-get-tags.asciidoc @@ -4,46 +4,40 @@ Get tags ++++ -Aggregates and returns all unique tags from all cases. +Aggregates and returns a list of case tags. -=== Request +=== {api-request-title} `GET :/api/cases/tags` `GET :/s//api/cases/tags` -=== Prerequisite +=== {api-prereq-title} You must have `read` privileges for the *Cases* feature in the *Management*, *{observability}*, or *Security* section of the <>, depending on the `owner` of the cases you're seeking. -=== Path parameters - -``:: -(Required, string) An identifier for the case to retrieve. Use -<> to retrieve case IDs. +=== {api-path-parms-title} ``:: (Optional, string) An identifier for the space. If it is not specified, the default space is used. -=== Query parameters +=== {api-query-parms-title} `owner`:: -(Optional, string or array of strings) Specifies the set of applications to -limit the retrieved tags. If not specified, the response contains all tags from -cases that the user has access to read. +(Optional, string or array of strings) A filter to limit the retrieved tags to a specific set of applications. +Valid values are: `cases`, `observability`, and `securitySolution`. If this parameter is omitted, the response +contains tags from all cases that the user has access to read. -==== Response code +=== {api-response-codes-title} `200`:: Indicates a successful call. -==== Example - -Gets all tags for all cases: +=== {api-examples-title} [source,sh] -------------------------------------------------- @@ -51,8 +45,7 @@ GET api/cases/tags -------------------------------------------------- // KIBANA -The API returns a JSON object with the names and email addresses of users who -opened cases. For example: +The API returns a JSON object with tags from all the cases that the user has access to read. For example: [source,json] -------------------------------------------------- @@ -62,4 +55,4 @@ opened cases. For example: "social engineering", "bubblegum" ] --------------------------------------------------- \ No newline at end of file +-------------------------------------------------- diff --git a/docs/api/cases/cases-api-push.asciidoc b/docs/api/cases/cases-api-push.asciidoc new file mode 100644 index 0000000000000..5b3e4d7c9ef78 --- /dev/null +++ b/docs/api/cases/cases-api-push.asciidoc @@ -0,0 +1,110 @@ +[[cases-api-push]] +== Push case API +++++ +Push case +++++ + +Pushes a case to an external service. + +=== {api-request-title} + +`POST :/api/cases//connector//_push` + +`POST :/s//api/cases//connector//_push` + +=== {api-prereq-title} + +You must have `all` privileges for the *Actions and Connectors* feature in the +*Management* section of the +<>. You must also have `all` +privileges for the *Cases* feature in the *Management*, *{observability}*, or +*Security* section of the {kib} feature privileges, depending on the +`owner` of the case you're pushing. + +=== {api-path-parms-title} + +``:: +(Required, string) The identifier for the case. To retrieve case IDs, use +<>. + +``:: +(Required, string) The identifier for the connector. To retrieve connector IDs, +use <>. + +:: +(Optional, string) An identifier for the space. If it is not specified, the +default space is used. + +=== {api-response-codes-title} + +`200`:: + Indicates a successful call. + +=== {api-examples-title} + +Push the case to an external service: + +[source,sh] +-------------------------------------------------- +POST api/cases/7349772f-421a-4de3-b8bb-2d9b22ccee30/connector/abed3a70-71bd-11ea-a0b2-c51ea50a58e2/_push +{} +-------------------------------------------------- +// KIBANA + +The API returns a JSON object representing the pushed case. For example: + +[source,json] +-------------------------------------------------- +{ + "id": "a18b38a0-71b0-11ea-a0b2-c51ea50a58e2", + "version": "Wzk4LDFd", + "comments": [], + "totalComment": 0, + "totalAlerts": 0, + "title": "This case will self-destruct in 5 seconds", + "tags": [ "phishing", "social engineering", "bubblegum" ], + "description": "James Bond clicked on a highly suspicious email banner advertising cheap holidays for underpaid civil servants. Operation bubblegum is active. Repeat - operation bubblegum is now active!", + "settings": { + "syncAlerts": true + }, + "owner": "securitySolution", + "closed_at": null, + "closed_by": null, + "created_at": "2022-03-29T11:30:02.658Z", + "created_by": { + "email": "ahunley@imf.usa.gov", + "full_name": "Alan Hunley", + "username": "ahunley" + }, + "status": "open", + "updated_at": "2022-03-29T12:01:50.244Z", + "updated_by": { + "full_name": "Classified", + "email": "classified@hms.oo.gov.uk", + "username": "M" + }, + "connector": { + "id": "08046500-bb7b-11ec-89c3-ef74ed34b2e9", + "name": "My connector", + "type": ".jira", + "fields": { + "issueType": "10006", + "priority": "High", + "parent": null + } + }, + "external_service": { + "pushed_at":"2022-07-26T18:19:43.688Z", + "pushed_by":{ + "username":"classified@hms.oo.gov.uk", + "full_name":null, + "email":null + }, + "connector_name":"My connector", + "external_id":"10110", + "external_title":"TPN-103", + "external_url":"https://cases.jira.com", + "connector_id":"08046500-bb7b-11ec-89c3-ef74ed34b2e9", + } +} +-------------------------------------------------- diff --git a/docs/api/cases/cases-api-set-configuration.asciidoc b/docs/api/cases/cases-api-set-configuration.asciidoc new file mode 100644 index 0000000000000..6a7a7c26c66d2 --- /dev/null +++ b/docs/api/cases/cases-api-set-configuration.asciidoc @@ -0,0 +1,163 @@ +[[cases-api-set-configuration]] +== Set case configuration API +++++ +Set configuration +++++ + +Sets external connection details, such as the closure type and +default connector for cases. + +=== {api-request-title} + +`POST :/api/cases/configure` + +`POST :/s//api/cases/configure` + +=== {api-prereq-title} + +You must have `all` privileges for the *Cases* feature in the *Management*, +*{observability}*, or *Security* section of the +<>, depending on the +`owner` of the case configuration. + +=== {api-description-title} + +Connectors are used to interface with external systems. You must create a +connector before you can use it in your cases. Refer to <>. + +If you set a default connector, it is automatically selected when you create +cases in {kib}. If you use the <>, however, +you must still specify all of the connector details. + +=== {api-path-parms-title} + +``:: +(Optional, string) An identifier for the space. If it is not specified, the +default space is used. + +=== {api-request-body-title} + +`closure_type`:: +(Required, string) Specifies whether a case is automatically closed when it is +pushed to external systems. ++ +-- +Valid values are: + +* `close-by-pushing`: Cases are automatically closed when they are pushed. +* `close-by-user`: Cases are not automatically closed. +-- + +`connector`:: +(Required, object) An object that contains the connector configuration. ++ +.Properties of `connector` +[%collapsible%open] +==== +`fields`:: +(Required, object) An object that contains the connector fields. ++ +-- +TIP: The fields specified in the case configuration are not used and are not +propagated to individual cases, therefore it is recommended to set it to `null`. +-- + +`id`:: +(Required, string) The identifier for the connector. If you do not want a +default connector, use `none`. To retrieve connector IDs, use +<>. + +`name`:: +(Required, string) The name of the connector. If you do not want a default +connector, use `none`. To retrieve connector names, use +<>. + +`type`:: +(Required, string) The type of the connector. Valid values are: `.jira`, `.none`, +`.resilient`,`.servicenow`, `.servicenow-sir`, and `.swimlane`. +==== + +`owner`:: +(Required, string) The application that owns the case configuration. Valid +values are: `cases`, `observability`, or `securitySolution`. This value affects +whether you're setting case configuration details for {stack-manage-app}, +{observability}, or {security-app}. + +`settings`:: +(Optional, object) +An object that contains the case settings. ++ +.Properties of `settings` +[%collapsible%open] +==== +`syncAlerts`:: +(Required, boolean) Turns alert syncing on or off. +==== + +=== {api-response-codes-title} + +`200`:: + Indicates a successful call. + +=== {api-examples-title} + +Sets the closure type and default connector for cases in **{stack-manage-app}**: + +[source,sh] +-------------------------------------------------- +POST api/cases/configure +{ + "owner": "cases", + "connector": { + "id": "131d4448-abe0-4789-939d-8ef60680b498", + "name": "my-serviceNow", + "type": ".servicenow", + "fields": null, + }, + "closure_type": "close-by-user" +} +-------------------------------------------------- + +The API returns the following response: + +[source,json] +-------------------------------------------------- +{ + "owner": "cases", + "closure_type": "close-by-user", + "created_at": "2022-04-02T01:09:02.303Z", + "created_by": { + "email": "moneypenny@hms.gov.uk", + "full_name": "Ms Moneypenny", + "username": "moneypenny" + }, + "updated_at": null, + "updated_by": null, + "connector": { + "id": "131d4448-abe0-4789-939d-8ef60680b498", + "name": "my-serviceNow", + "type": ".servicenow", + "fields": null, + }, + "mappings": [ + { + "source": "title", + "target": "short_description", + "action_type": "overwrite" + }, + { + "source":"description", + "target":"description", + "action_type":"overwrite" + }, + { + "source":"comments", + "target":"work_notes", + "action_type":"append" + } + ], + "version": "WzE3NywxXQ==", + "error": null, + "id": "7349772f-421a-4de3-b8bb-2d9b22ccee30", +} +-------------------------------------------------- diff --git a/docs/api/cases/cases-api-update-comment.asciidoc b/docs/api/cases/cases-api-update-comment.asciidoc index 98d426cb0c86d..020fe403fa7c5 100644 --- a/docs/api/cases/cases-api-update-comment.asciidoc +++ b/docs/api/cases/cases-api-update-comment.asciidoc @@ -6,20 +6,20 @@ Updates a comment in a case. -=== Request +=== {api-request-title} `PATCH :/api/cases//comments` `PATCH :/s//api/cases//comments` -=== Prerequisite +=== {api-prereq-title} You must have `all` privileges for the *Cases* feature in the *Management*, *{observability}*, or *Security* section of the <>, depending on the `owner` of the case you're updating. -=== Path parameters +=== {api-path-parms-title} ``:: The identifier for the case. To retrieve case IDs, use @@ -29,7 +29,7 @@ The identifier for the case. To retrieve case IDs, use (Optional, string) An identifier for the space. If it is not specified, the default space is used. -=== Request body +=== {api-request-body-title} `alertId`:: (Required*, string) The identifier for the alert. It is required only when @@ -40,8 +40,7 @@ default space is used. `user`. `id`:: -(Required, string) The identifier for the comment. -//To retrieve comment IDs, use <>. +(Required, string) The identifier for the comment. To retrieve comment IDs, use <>. `index`:: (Required*, string) The alert index. It is required only when `type` is `alert`. @@ -75,15 +74,14 @@ The rule that is associated with the alert. It is required only when `type` is NOTE: You cannot change the comment type. `version`:: -(Required, string) The current comment version. -//To retrieve version values, use <>. +(Required, string) The current comment version. To retrieve version values, use <>. -=== Response code +=== {api-response-codes-title} `200`:: Indicates a successful call. -=== Example +=== {api-examples-title} Update comment ID `8af6ac20-74f6-11ea-b83a-553aecdb28b6` (associated with case ID `293f1bc0-74f6-11ea-b83a-553aecdb28b6`): diff --git a/docs/api/cases/cases-api-update-configuration.asciidoc b/docs/api/cases/cases-api-update-configuration.asciidoc new file mode 100644 index 0000000000000..cf7d2ea7d8cfd --- /dev/null +++ b/docs/api/cases/cases-api-update-configuration.asciidoc @@ -0,0 +1,129 @@ +[[cases-api-update-configuration]] +== Update case configuration API +++++ +Update configuration +++++ + +Updates external connection details, such as the closure type and default +connector for cases. + +=== {api-request-title} + +`PATCH :/api/cases/configure/` + +`PATCH :/s//api/cases/configure/` + +=== {api-prereq-title} + +You must have `all` privileges for the *Cases* feature in the *Management*, +*{observability}*, or *Security* section of the +<>, depending on the +`owner` of the case configuration. + +=== {api-description-title} + +Connectors are used to interface with external systems. You must create a +connector before you can it in your cases. Refer to <>. + +=== {api-path-parms-title} + +``:: +The identifier for the configuration. To retrieve the configuration IDs, use +<>. + +``:: +(Optional, string) An identifier for the space. If it is not specified, the +default space is used. + +=== Request body + +`closure_type`:: +(Optional, string) Determines whether a case is automatically closed when it is +pushed to external systems. Valid values are: ++ +-- +* `close-by-pushing`: Cases are automatically closed when they +are pushed. +* `close-by-user`: Cases are not automatically closed. +-- + +`connector`:: +(Optional, object) An object that contains the connector configuration. ++ +.Properties of `connector` +[%collapsible%open] +==== +`fields`:: +(Required, object) An object that contains the connector fields. ++ +-- +TIP: The fields specified in the case configuration are not used and are not +propagated to individual cases, therefore it is recommended to set it to `null`. +-- + +`id`:: +(Required, string) The identifier for the connector. To retrieve connector IDs, +use <>. + +`name`:: +(Required, string) The name of the connector. + +`type`:: +(Required, string) The type of the connector. Valid values are: `.servicenow`, +`.servicenow-sir`, `.jira`, `.resilient`, `.swimlane`, and `.none`. +==== + +`version`:: +(Required, string) The version of the connector. To retrieve the version value, +use <>. + +=== Response code + +`200`:: + Indicates a successful call. + +=== Example + +Change the closure type configuration option: + +[source,sh] +-------------------------------------------------- +PATCH api/cases/configure/3297a0f0-b5ec-11ec-b141-0fdb20a7f9a9 +{ + "closure_type": "close-by-pushing", + "version": "WzIwMiwxXQ==" +} +-------------------------------------------------- +// KIBANA + +The API returns the following: + +[source,json] +-------------------------------------------------- +{ + "closure_type": "close-by-user", + "owner": "cases", + "created_at": "2022-04-06T20:57:40.746Z", + "created_by": { + "email": "admin@hms.gov.uk", + "full_name": "Ms Admin", + "username": "admin" + }, + "updated_at": "2022-04-12T22:41:09.262Z", + "updated_by": { + "email": "admin@hms.gov.uk", + "full_name": "Ms Admin", + "username": "admin" + }, + "connector": { + "id": "none", + "name": "none", + "type": ".none", + "fields": null + }, + "mappings": [], + "version": "WzkwNiw1XQ==", + "error": null, + "id": "3297a0f0-b5ec-11ec-b141-0fdb20a7f9a9" +} +-------------------------------------------------- diff --git a/docs/api/cases/cases-api-update.asciidoc b/docs/api/cases/cases-api-update.asciidoc index 522300591d8b7..7a63d0e8a6a33 100644 --- a/docs/api/cases/cases-api-update.asciidoc +++ b/docs/api/cases/cases-api-update.asciidoc @@ -6,26 +6,26 @@ Updates one or more cases. -=== Request +=== {api-request-title} `PATCH :/api/cases` `PATCH :/s//api/cases` -=== Prerequisite +=== {api-prereq-title} You must have `all` privileges for the *Cases* feature in the *Management*, *{observability}*, or *Security* section of the <>, depending on the `owner` of the cases you're updating. -=== Path parameters +=== {api-path-parms-title} ``:: (Optional, string) An identifier for the space. If it is not specified, the default space is used. -=== Request body +=== {api-request-body-title} `cases`:: (Required, array of objects) Array containing one or more case objects. @@ -114,8 +114,7 @@ For {swimlane} connectors, specify: `id`:: (Required, string) The identifier for the connector. To remove the connector, -use `none`. -//To retrieve connector IDs, use <>). +use `none`. To retrieve connector IDs, use <>). `name`:: (Required, string) The name of the connector. To remove the connector, use @@ -159,12 +158,12 @@ and `open`. (Required, string) The current version of the case. To determine this value, use <> or <>. ==== -=== Response code +=== {api-response-codes-title} `200`:: Indicates a successful call. -=== Example +=== {api-examples-title} Update the description, tags, and connector of case ID `a18b38a0-71b0-11ea-a0b2-c51ea50a58e2`: diff --git a/docs/api/data-views/update-fields.asciidoc b/docs/api/data-views/update-fields.asciidoc index babe689ce6b23..3ec4b7c84694a 100644 --- a/docs/api/data-views/update-fields.asciidoc +++ b/docs/api/data-views/update-fields.asciidoc @@ -49,7 +49,7 @@ Set popularity `count` for field `foo`: [source,sh] -------------------------------------------------- -$ curl -X POST api/saved_objects/data-view/my-view/fields +$ curl -X POST api/data_views/data-view/my-view/fields { "fields": { "foo": { @@ -64,7 +64,7 @@ Update multiple metadata fields in one request: [source,sh] -------------------------------------------------- -$ curl -X POST api/saved_objects/data-view/my-view/fields +$ curl -X POST api/data_views/data-view/my-view/fields { "fields": { "foo": { @@ -82,7 +82,7 @@ $ curl -X POST api/saved_objects/data-view/my-view/fields Use `null` value to delete metadata: [source,sh] -------------------------------------------------- -$ curl -X POST api/saved_objects/data-view/my-pattern/fields +$ curl -X POST api/data_views/data-view/my-pattern/fields { "fields": { "foo": { diff --git a/docs/api/data-views/update.asciidoc b/docs/api/data-views/update.asciidoc index b86a13682cb0b..c1473b8f7079b 100644 --- a/docs/api/data-views/update.asciidoc +++ b/docs/api/data-views/update.asciidoc @@ -61,7 +61,7 @@ Update a title of the `` data view: [source,sh] -------------------------------------------------- -$ curl -X POST api/saved_objects/data-view/my-view +$ curl -X POST api/data_views/data-view/my-view { "data_view": { "title": "some-other-view-*" @@ -74,7 +74,7 @@ Customize the update behavior: [source,sh] -------------------------------------------------- -$ curl -X POST api/saved_objects/data-view/my-view +$ curl -X POST api/data_views/data-view/my-view { "refresh_fields": true, "data_view": { @@ -89,7 +89,7 @@ All update fields are optional, but you can specify the following fields: [source,sh] -------------------------------------------------- -$ curl -X POST api/saved_objects/data-view/my-view +$ curl -X POST api/data_views/data-view/my-view { "data_view": { "title": "...", diff --git a/docs/api/index-patterns/update-fields.asciidoc b/docs/api/index-patterns/update-fields.asciidoc index e3ac304745f39..e2655d557e929 100644 --- a/docs/api/index-patterns/update-fields.asciidoc +++ b/docs/api/index-patterns/update-fields.asciidoc @@ -46,7 +46,7 @@ Set popularity `count` for field `foo`: [source,sh] -------------------------------------------------- -$ curl -X POST api/saved_objects/index-pattern/my-pattern/fields +$ curl -X POST api/index_patterns/index-pattern/my-pattern/fields { "fields": { "foo": { @@ -61,7 +61,7 @@ Update multiple metadata fields in one request: [source,sh] -------------------------------------------------- -$ curl -X POST api/saved_objects/index-pattern/my-pattern/fields +$ curl -X POST api/index_patterns/index-pattern/my-pattern/fields { "fields": { "foo": { @@ -79,7 +79,7 @@ $ curl -X POST api/saved_objects/index-pattern/my-pattern/fields Use `null` value to delete metadata: [source,sh] -------------------------------------------------- -$ curl -X POST api/saved_objects/index-pattern/my-pattern/fields +$ curl -X POST api/index_patterns/index-pattern/my-pattern/fields { "fields": { "foo": { diff --git a/docs/api/index-patterns/update.asciidoc b/docs/api/index-patterns/update.asciidoc index 366afd336d15a..64479f00ef5c5 100644 --- a/docs/api/index-patterns/update.asciidoc +++ b/docs/api/index-patterns/update.asciidoc @@ -58,7 +58,7 @@ Update a title of the `` index pattern: [source,sh] -------------------------------------------------- -$ curl -X POST api/saved_objects/index-pattern/my-pattern +$ curl -X POST api/index_patterns/index-pattern/my-pattern { "index_pattern": { "title": "some-other-pattern-*" @@ -71,7 +71,7 @@ Customize the update behavior: [source,sh] -------------------------------------------------- -$ curl -X POST api/saved_objects/index-pattern/my-pattern +$ curl -X POST api/index_patterns/index-pattern/my-pattern { "refresh_fields": true, "index_pattern": { @@ -86,7 +86,7 @@ All update fields are optional, but you can specify the following fields: [source,sh] -------------------------------------------------- -$ curl -X POST api/saved_objects/index-pattern/my-pattern +$ curl -X POST api/index_patterns/index-pattern/my-pattern { "index_pattern": { "title": "...", diff --git a/docs/api/machine-learning/sync.asciidoc b/docs/api/machine-learning/sync.asciidoc index 5f19bc17ab2fb..ba7e98a12dde6 100644 --- a/docs/api/machine-learning/sync.asciidoc +++ b/docs/api/machine-learning/sync.asciidoc @@ -4,32 +4,42 @@ Sync {ml} saved objects ++++ -Synchronizes {kib} saved objects for {ml} jobs. +Synchronizes {kib} saved objects for {ml} jobs and trained models. [[machine-learning-api-sync-request]] -==== Request +==== {api-request-title} `GET :/api/ml/saved_objects/sync` `GET :/s//api/ml/saved_objects/sync` +[[machine-learning-api-sync-prereq]] +==== {api-prereq-title} + +You must have `all` privileges for the *Machine Learning* feature in the *Analytics* section of the +<>. + +[[machine-learning-api-sync-desc]] +==== {api-description-title} + +This API runs automatically when you start {kib} and periodically thereafter. [[machine-learning-api-sync-path-params]] -==== Path parameters +==== {api-path-parms-title} `space_id`:: (Optional, string) An identifier for the space. If `space_id` is not provided in the URL the default space is used. [[machine-learning-api-sync-query-params]] -==== Query parameters +==== {api-query-parms-title} `simulate`:: (Optional, boolean) When `true`, simulates the synchronization by only returning the list actions that _would_ be performed. [[machine-learning-api-sync-response-body]] -==== Response body +==== {api-response-body-title} `datafeedsAdded`:: (array) If a saved object for an {anomaly-job} is missing a {dfeed} identifier, @@ -42,23 +52,23 @@ deleted. This list contains the {dfeed} identifiers and indicates whether the synchronization was successful. `savedObjectsCreated`:: -(array) If saved objects are missing for {ml} jobs, they are created. This -list contains the job identifiers and indicates whether the synchronization was -successful. +(array) If saved objects are missing for {ml} jobs or trained models, they are +created. This list contains the job and model identifiers and indicates whether +the synchronization was successful. `savedObjectsDeleted`:: -(array) If saved objects exist for jobs that no longer exist, they are deleted. -This list contains the job identifiers and indicates whether the synchronization -was successful. +(array) If saved objects exist for {ml} jobs or trained models that no longer +exist, they are deleted. This list contains the job and model identifiers and +indicates whether the synchronization was successful. [[machine-learning-api-sync-codes]] -==== Response code +==== {api-response-codes-title} `200`:: Indicates a successful call. [[machine-learning-api-sync-example]] -==== Example +==== {api-examples-title} Retrieve the list of {ml} saved objects that require synchronization: @@ -68,12 +78,12 @@ $ curl -X GET api/ml/saved_objects/sync?simulate=true -------------------------------------------------- // KIBANA -If there are two jobs and a {dfeed} that need to be synchronized, for example, -the API returns the following: +If there are two jobs that need to be synchronized, for example, the API returns +the following response: [source,sh] -------------------------------------------------- -{{"savedObjectsCreated":{"myjob1":{"success":true},"myjob2":{"success":true}},"savedObjectsDeleted":{},"datafeedsAdded":{},"datafeedsRemoved":{"myfeed3":{"success":true}}} +{{"savedObjectsCreated":{"anomaly_detector":{"myjob1":{"success":true},"myjob2":{"success":true}}},"savedObjectsDeleted":{},"datafeedsAdded":{},"datafeedsRemoved":{}} -------------------------------------------------- To perform the synchronization, re-run the API and omit the `simulate` parameter. \ No newline at end of file diff --git a/docs/api/saved-objects/create.asciidoc b/docs/api/saved-objects/create.asciidoc index d250b0602adb7..73339946ea0c0 100644 --- a/docs/api/saved-objects/create.asciidoc +++ b/docs/api/saved-objects/create.asciidoc @@ -72,7 +72,7 @@ used to specify a single space, and the "All spaces" identifier (`'*'`) is not a [source,sh] -------------------------------------------------- -$ curl -X POST api/saved_objects/index-pattern/my-pattern -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d ' +$ curl -X POST api/index_patterns/index-pattern/my-pattern -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d ' { "attributes": { "title": "my-pattern-*" diff --git a/docs/api/saved-objects/delete.asciidoc b/docs/api/saved-objects/delete.asciidoc index eca46e202beda..6cc31b6563aa3 100644 --- a/docs/api/saved-objects/delete.asciidoc +++ b/docs/api/saved-objects/delete.asciidoc @@ -47,6 +47,6 @@ Delete {a-data-source} object with the `my-pattern` ID: [source,sh] -------------------------------------------------- -$ curl -X DELETE api/saved_objects/index-pattern/my-pattern +$ curl -X DELETE api/index_patterns/index-pattern/my-pattern -------------------------------------------------- // KIBANA diff --git a/docs/api/saved-objects/get.asciidoc b/docs/api/saved-objects/get.asciidoc index 174587b400993..3f4b6037cd806 100644 --- a/docs/api/saved-objects/get.asciidoc +++ b/docs/api/saved-objects/get.asciidoc @@ -39,7 +39,7 @@ Retrieve the {data-source} object with the `my-pattern` ID: [source,sh] -------------------------------------------------- -$ curl -X GET api/saved_objects/index-pattern/my-pattern +$ curl -X GET api/index_patterns/index-pattern/my-pattern -------------------------------------------------- // KIBANA diff --git a/docs/api/saved-objects/update.asciidoc b/docs/api/saved-objects/update.asciidoc index fb7decccabd4c..0559c49625fee 100644 --- a/docs/api/saved-objects/update.asciidoc +++ b/docs/api/saved-objects/update.asciidoc @@ -58,7 +58,7 @@ Update an existing {data-source} object,`my-pattern`, with a different title: [source,sh] -------------------------------------------------- -$ curl -X PUT api/saved_objects/index-pattern/my-pattern +$ curl -X PUT api/index_patterns/index-pattern/my-pattern { "attributes": { "title": "some-other-pattern-*" diff --git a/docs/concepts/data-views.asciidoc b/docs/concepts/data-views.asciidoc index 807b829c7481a..f8040d1885907 100644 --- a/docs/concepts/data-views.asciidoc +++ b/docs/concepts/data-views.asciidoc @@ -1,11 +1,11 @@ [[data-views]] -=== Create a data view +=== Create a {data-source} -{kib} requires a data view to access the {es} data that you want to explore. -A data view selects the data to use and allows you to define properties of the fields. +{kib} requires a {data-source} to access the {es} data that you want to explore. +A {data-source} selects the data to use and allows you to define properties of the fields. -A data view can point to one or more indices, {ref}/data-streams.html[data stream], or {ref}/alias.html[index aliases]. -For example, a data view can point to your log data from yesterday, +A {data-source} can point to one or more indices, {ref}/data-streams.html[data streams], or {ref}/alias.html[index aliases]. +For example, a {data-source} can point to your log data from yesterday, or all indices that contain your data. [float] @@ -15,12 +15,12 @@ or all indices that contain your data. * Access to *Data Views* requires the <> `Data View Management`. -* To create a data view, you must have the <> +* To create a {data-source}, you must have the <> `view_index_metadata`. * If a read-only indicator appears in {kib}, you have insufficient privileges -to create or save data views. The buttons to create new data views or -save existing data views are not visible. For more information, +to create or save {data-sources}. The buttons to create {data-sources} or +save existing {data-sources} are not visible. For more information, refer to <>. [float] @@ -29,12 +29,12 @@ refer to <>. If you collected data using one of the {kib} <>, uploaded a file, or added sample data, -you get a data view for free, and can start exploring your data. -If you loaded your own data, follow these steps to create a data view. +you get a {data-source} for free, and can start exploring your data. +If you loaded your own data, follow these steps to create a {data-source}. . Open the main menu, then click *Stack Management > Data Views*. -. Click *Create data view*. +. Click *Create {data-source}*. . Start typing in the *name* field, and {kib} looks for the names of indices, data streams, and aliases that match your input. @@ -61,21 +61,25 @@ global time filters on your dashboards. This is useful if you have multiple time fields and want to create dashboards that combine visualizations based on different timestamps. -. Click *Create data view*. +. To display all indices, click *Show advanced settings*, then select *Allow hidden and system indices*. + +. To specify your own {data-source} name, click *Show advanced settings*, then enter the name in the *Custom {data-source} ID* field. For example, enter your {es} index alias name. + +. Click *Create {data-source}*. + [[reload-fields]] {kib} is now configured to use your {es} data. When a new field is added to an index, -the data view field list is updated -the next time the data view is loaded, for example, when you load the page or +the {data-source} field list is updated +the next time the {data-source} is loaded, for example, when you load the page or move between {kib} apps. -. Select this data view when you search and visualize your data. +. Select this {data-source} when you search and visualize your data. [float] [[rollup-data-view]] ==== Create a data view for rolled up data -A data view can match one rollup index. For a combination rollup -data view with both raw and rolled up data, use the standard notation: +A {data-source} can match one rollup index. For a combination rollup +{data-source} with both raw and rolled up data, use the standard notation: ```ts rollup_logstash,kibana_sample_data_logs @@ -130,20 +134,20 @@ To exclude a cluster having a name starting with `cluster_`: `cluster_*:logstash-*,cluster_one:-*` ``` -Once you configure a data view to use the {ccs} syntax, all searches and -aggregations using that data view in {kib} take advantage of {ccs}. +Once you configure a {data-source} to use the {ccs} syntax, all searches and +aggregations using that {data-source} in {kib} take advantage of {ccs}. [float] [[delete-data-view]] -=== Delete data views +=== Delete {data-sources} -When you delete a data view, you cannot recover the associated field formatters, runtime fields, source filters, -and field popularity data. Deleting a data view does not remove any indices or data documents from {es}. +When you delete a {data-source}, you cannot recover the associated field formatters, runtime fields, source filters, +and field popularity data. Deleting a {data-source} does not remove any indices or data documents from {es}. -WARNING: Deleting a data view breaks all visualizations, saved searches, and other saved objects that reference the data view. +WARNING: Deleting a {data-source} breaks all visualizations, saved searches, and other saved objects that reference the data view. . Open the main menu, then click *Stack Management > Data Views*. -. Click the data view to delete. +. Click the {data-source} to delete. -. Delete (image:management/index-patterns/images/delete.png[Delete icon]) the data view. +. Delete (image:management/index-patterns/images/delete.png[Delete icon]) the {data-source}. diff --git a/docs/developer/getting-started/monorepo-packages.asciidoc b/docs/developer/getting-started/monorepo-packages.asciidoc index 0216d26023a78..eed060d253a28 100644 --- a/docs/developer/getting-started/monorepo-packages.asciidoc +++ b/docs/developer/getting-started/monorepo-packages.asciidoc @@ -57,7 +57,6 @@ yarn kbn watch - @kbn/analytics - @kbn/apm-config-loader - @kbn/apm-utils -- @kbn/babel-code-parser - @kbn/babel-preset - @kbn/cli-dev-mode - @kbn/config diff --git a/docs/developer/plugin-list.asciidoc b/docs/developer/plugin-list.asciidoc index e96f1cd819186..90bf3d3c29b41 100644 --- a/docs/developer/plugin-list.asciidoc +++ b/docs/developer/plugin-list.asciidoc @@ -613,6 +613,11 @@ the alertTypes by the Stack in the alerting plugin, register associated HTTP routes, etc. +|{kib-repo}blob/{branch}/x-pack/plugins/synthetics/README.md[synthetics] +|The purpose of this plugin is to provide users of Heartbeat more visibility of what's happening +in their infrastructure. + + |{kib-repo}blob/{branch}/x-pack/plugins/task_manager/README.md[taskManager] |The task manager is a generic system for running background tasks. Documentation: https://www.elastic.co/guide/en/kibana/master/task-manager-production-considerations.html @@ -648,11 +653,6 @@ As a developer you can reuse and extend built-in alerts and actions UI functiona |Upgrade Assistant helps users prepare their Stack for being upgraded to the next major. It will only be enabled on the last minor before the next major release. This is controlled via the config: xpack.upgrade_assistant.readonly (#101296). -|{kib-repo}blob/{branch}/x-pack/plugins/uptime/README.md[uptime] -|The purpose of this plugin is to provide users of Heartbeat more visibility of what's happening -in their infrastructure. - - |{kib-repo}blob/{branch}/x-pack/plugins/drilldowns/url_drilldown/README.md[urlDrilldown] |NOTE: This plugin contains implementation of URL drilldown. For drilldowns infrastructure code refer to ui_actions_enhanced plugin. diff --git a/docs/development/core/public/kibana-plugin-core-public.savedobjectreferencewithcontext.md b/docs/development/core/public/kibana-plugin-core-public.savedobjectreferencewithcontext.md index 39e14607d861f..2b43bafbede5c 100644 --- a/docs/development/core/public/kibana-plugin-core-public.savedobjectreferencewithcontext.md +++ b/docs/development/core/public/kibana-plugin-core-public.savedobjectreferencewithcontext.md @@ -19,7 +19,9 @@ export interface SavedObjectReferenceWithContext | [id](./kibana-plugin-core-public.savedobjectreferencewithcontext.id.md) | string | The ID of the referenced object | | [inboundReferences](./kibana-plugin-core-public.savedobjectreferencewithcontext.inboundreferences.md) | Array<{ type: string; id: string; name: string; }> | References to this object; note that this does not contain \_all inbound references everywhere for this object\_, it only contains inbound references for the scope of this operation | | [isMissing?](./kibana-plugin-core-public.savedobjectreferencewithcontext.ismissing.md) | boolean | (Optional) Whether or not this object or reference is missing | +| [originId?](./kibana-plugin-core-public.savedobjectreferencewithcontext.originid.md) | string | (Optional) The origin ID of the referenced object (if it has one) | | [spaces](./kibana-plugin-core-public.savedobjectreferencewithcontext.spaces.md) | string\[\] | The space(s) that the referenced object exists in | | [spacesWithMatchingAliases?](./kibana-plugin-core-public.savedobjectreferencewithcontext.spaceswithmatchingaliases.md) | string\[\] | (Optional) The space(s) that legacy URL aliases matching this type/id exist in | +| [spacesWithMatchingOrigins?](./kibana-plugin-core-public.savedobjectreferencewithcontext.spaceswithmatchingorigins.md) | string\[\] | (Optional) The space(s) that objects matching this origin exist in (including this one) | | [type](./kibana-plugin-core-public.savedobjectreferencewithcontext.type.md) | string | The type of the referenced object | diff --git a/docs/development/core/public/kibana-plugin-core-public.savedobjectreferencewithcontext.originid.md b/docs/development/core/public/kibana-plugin-core-public.savedobjectreferencewithcontext.originid.md new file mode 100644 index 0000000000000..418041ea5df60 --- /dev/null +++ b/docs/development/core/public/kibana-plugin-core-public.savedobjectreferencewithcontext.originid.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [SavedObjectReferenceWithContext](./kibana-plugin-core-public.savedobjectreferencewithcontext.md) > [originId](./kibana-plugin-core-public.savedobjectreferencewithcontext.originid.md) + +## SavedObjectReferenceWithContext.originId property + +The origin ID of the referenced object (if it has one) + +Signature: + +```typescript +originId?: string; +``` diff --git a/docs/development/core/public/kibana-plugin-core-public.savedobjectreferencewithcontext.spaceswithmatchingorigins.md b/docs/development/core/public/kibana-plugin-core-public.savedobjectreferencewithcontext.spaceswithmatchingorigins.md new file mode 100644 index 0000000000000..88a7ebb5f2234 --- /dev/null +++ b/docs/development/core/public/kibana-plugin-core-public.savedobjectreferencewithcontext.spaceswithmatchingorigins.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [kibana-plugin-core-public](./kibana-plugin-core-public.md) > [SavedObjectReferenceWithContext](./kibana-plugin-core-public.savedobjectreferencewithcontext.md) > [spacesWithMatchingOrigins](./kibana-plugin-core-public.savedobjectreferencewithcontext.spaceswithmatchingorigins.md) + +## SavedObjectReferenceWithContext.spacesWithMatchingOrigins property + +The space(s) that objects matching this origin exist in (including this one) + +Signature: + +```typescript +spacesWithMatchingOrigins?: string[]; +``` diff --git a/docs/development/core/server/kibana-plugin-core-server.corerequesthandlercontext.deprecations.md b/docs/development/core/server/kibana-plugin-core-server.corerequesthandlercontext.deprecations.md new file mode 100644 index 0000000000000..51d93371e518e --- /dev/null +++ b/docs/development/core/server/kibana-plugin-core-server.corerequesthandlercontext.deprecations.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [CoreRequestHandlerContext](./kibana-plugin-core-server.corerequesthandlercontext.md) > [deprecations](./kibana-plugin-core-server.corerequesthandlercontext.deprecations.md) + +## CoreRequestHandlerContext.deprecations property + +Signature: + +```typescript +deprecations: { + client: DeprecationsClient; + }; +``` diff --git a/docs/development/core/server/kibana-plugin-core-server.corerequesthandlercontext.elasticsearch.md b/docs/development/core/server/kibana-plugin-core-server.corerequesthandlercontext.elasticsearch.md new file mode 100644 index 0000000000000..22ff84ce1cb57 --- /dev/null +++ b/docs/development/core/server/kibana-plugin-core-server.corerequesthandlercontext.elasticsearch.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [CoreRequestHandlerContext](./kibana-plugin-core-server.corerequesthandlercontext.md) > [elasticsearch](./kibana-plugin-core-server.corerequesthandlercontext.elasticsearch.md) + +## CoreRequestHandlerContext.elasticsearch property + +Signature: + +```typescript +elasticsearch: { + client: IScopedClusterClient; + }; +``` diff --git a/docs/development/core/server/kibana-plugin-core-server.corerequesthandlercontext.md b/docs/development/core/server/kibana-plugin-core-server.corerequesthandlercontext.md new file mode 100644 index 0000000000000..47297bcddc906 --- /dev/null +++ b/docs/development/core/server/kibana-plugin-core-server.corerequesthandlercontext.md @@ -0,0 +1,25 @@ + + +[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [CoreRequestHandlerContext](./kibana-plugin-core-server.corerequesthandlercontext.md) + +## CoreRequestHandlerContext interface + +The `core` context provided to route handler. + +Provides the following clients and services: - [savedObjects.client](./kibana-plugin-core-server.savedobjectsclient.md) - Saved Objects client which uses the credentials of the incoming request - [savedObjects.typeRegistry](./kibana-plugin-core-server.isavedobjecttyperegistry.md) - Type registry containing all the registered types. - [elasticsearch.client](./kibana-plugin-core-server.iscopedclusterclient.md) - Elasticsearch data client which uses the credentials of the incoming request - [uiSettings.client](./kibana-plugin-core-server.iuisettingsclient.md) - uiSettings client which uses the credentials of the incoming request + +Signature: + +```typescript +export interface CoreRequestHandlerContext +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [deprecations](./kibana-plugin-core-server.corerequesthandlercontext.deprecations.md) | { client: DeprecationsClient; } | | +| [elasticsearch](./kibana-plugin-core-server.corerequesthandlercontext.elasticsearch.md) | { client: IScopedClusterClient; } | | +| [savedObjects](./kibana-plugin-core-server.corerequesthandlercontext.savedobjects.md) | { client: SavedObjectsClientContract; typeRegistry: ISavedObjectTypeRegistry; getClient: (options?: SavedObjectsClientProviderOptions) => SavedObjectsClientContract; getExporter: (client: SavedObjectsClientContract) => ISavedObjectsExporter; getImporter: (client: SavedObjectsClientContract) => ISavedObjectsImporter; } | | +| [uiSettings](./kibana-plugin-core-server.corerequesthandlercontext.uisettings.md) | { client: IUiSettingsClient; } | | + diff --git a/docs/development/core/server/kibana-plugin-core-server.corerequesthandlercontext.savedobjects.md b/docs/development/core/server/kibana-plugin-core-server.corerequesthandlercontext.savedobjects.md new file mode 100644 index 0000000000000..6d1aa0a8bb5f1 --- /dev/null +++ b/docs/development/core/server/kibana-plugin-core-server.corerequesthandlercontext.savedobjects.md @@ -0,0 +1,17 @@ + + +[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [CoreRequestHandlerContext](./kibana-plugin-core-server.corerequesthandlercontext.md) > [savedObjects](./kibana-plugin-core-server.corerequesthandlercontext.savedobjects.md) + +## CoreRequestHandlerContext.savedObjects property + +Signature: + +```typescript +savedObjects: { + client: SavedObjectsClientContract; + typeRegistry: ISavedObjectTypeRegistry; + getClient: (options?: SavedObjectsClientProviderOptions) => SavedObjectsClientContract; + getExporter: (client: SavedObjectsClientContract) => ISavedObjectsExporter; + getImporter: (client: SavedObjectsClientContract) => ISavedObjectsImporter; + }; +``` diff --git a/docs/development/core/server/kibana-plugin-core-server.corerequesthandlercontext.uisettings.md b/docs/development/core/server/kibana-plugin-core-server.corerequesthandlercontext.uisettings.md new file mode 100644 index 0000000000000..f76dcc8965a03 --- /dev/null +++ b/docs/development/core/server/kibana-plugin-core-server.corerequesthandlercontext.uisettings.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [CoreRequestHandlerContext](./kibana-plugin-core-server.corerequesthandlercontext.md) > [uiSettings](./kibana-plugin-core-server.corerequesthandlercontext.uisettings.md) + +## CoreRequestHandlerContext.uiSettings property + +Signature: + +```typescript +uiSettings: { + client: IUiSettingsClient; + }; +``` diff --git a/docs/development/core/server/kibana-plugin-core-server.customrequesthandlercontext.md b/docs/development/core/server/kibana-plugin-core-server.customrequesthandlercontext.md new file mode 100644 index 0000000000000..afaf8c278565a --- /dev/null +++ b/docs/development/core/server/kibana-plugin-core-server.customrequesthandlercontext.md @@ -0,0 +1,14 @@ + + +[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [CustomRequestHandlerContext](./kibana-plugin-core-server.customrequesthandlercontext.md) + +## CustomRequestHandlerContext type + + +Signature: + +```typescript +export declare type CustomRequestHandlerContext = RequestHandlerContext & { + [Key in keyof T]: T[Key] extends Promise ? T[Key] : Promise; +}; +``` diff --git a/docs/development/core/server/kibana-plugin-core-server.httpservicesetup.md b/docs/development/core/server/kibana-plugin-core-server.httpservicesetup.md index f3be1a9130b9c..bb03887e547e2 100644 --- a/docs/development/core/server/kibana-plugin-core-server.httpservicesetup.md +++ b/docs/development/core/server/kibana-plugin-core-server.httpservicesetup.md @@ -87,5 +87,5 @@ async (context, request, response) => { | [registerOnPreAuth](./kibana-plugin-core-server.httpservicesetup.registeronpreauth.md) | (handler: OnPreAuthHandler) => void | To define custom logic to perform for incoming requests before the Auth interceptor performs a check that user has access to requested resources. | | [registerOnPreResponse](./kibana-plugin-core-server.httpservicesetup.registeronpreresponse.md) | (handler: OnPreResponseHandler) => void | To define custom logic to perform for the server response. | | [registerOnPreRouting](./kibana-plugin-core-server.httpservicesetup.registeronprerouting.md) | (handler: OnPreRoutingHandler) => void | To define custom logic to perform for incoming requests before server performs a route lookup. | -| [registerRouteHandlerContext](./kibana-plugin-core-server.httpservicesetup.registerroutehandlercontext.md) | <Context extends RequestHandlerContext, ContextName extends keyof Context>(contextName: ContextName, provider: RequestHandlerContextProvider<Context, ContextName>) => RequestHandlerContextContainer | Register a context provider for a route handler. | +| [registerRouteHandlerContext](./kibana-plugin-core-server.httpservicesetup.registerroutehandlercontext.md) | <Context extends RequestHandlerContext, ContextName extends keyof Omit<Context, 'resolve'>>(contextName: ContextName, provider: RequestHandlerContextProvider<Context, ContextName>) => RequestHandlerContextContainer | Register a context provider for a route handler. | diff --git a/docs/development/core/server/kibana-plugin-core-server.httpservicesetup.registerroutehandlercontext.md b/docs/development/core/server/kibana-plugin-core-server.httpservicesetup.registerroutehandlercontext.md index c793080305d0c..23e009864dcd6 100644 --- a/docs/development/core/server/kibana-plugin-core-server.httpservicesetup.registerroutehandlercontext.md +++ b/docs/development/core/server/kibana-plugin-core-server.httpservicesetup.registerroutehandlercontext.md @@ -9,7 +9,7 @@ Register a context provider for a route handler. Signature: ```typescript -registerRouteHandlerContext: (contextName: ContextName, provider: RequestHandlerContextProvider) => RequestHandlerContextContainer; +registerRouteHandlerContext: >(contextName: ContextName, provider: RequestHandlerContextProvider) => RequestHandlerContextContainer; ``` ## Example diff --git a/docs/development/core/server/kibana-plugin-core-server.icontextprovider.md b/docs/development/core/server/kibana-plugin-core-server.icontextprovider.md index ddd8a0e92f465..eb2ec3cbf90b8 100644 --- a/docs/development/core/server/kibana-plugin-core-server.icontextprovider.md +++ b/docs/development/core/server/kibana-plugin-core-server.icontextprovider.md @@ -9,7 +9,7 @@ A function that returns a context value for a specific key of given context type Signature: ```typescript -export declare type IContextProvider = (context: Omit, ...rest: HandlerParameters) => Promise | Context[ContextName]; +export declare type IContextProvider = (context: Omit, ...rest: HandlerParameters) => MaybePromise>; ``` ## Remarks diff --git a/docs/development/core/server/kibana-plugin-core-server.kibanaresponsefactory.md b/docs/development/core/server/kibana-plugin-core-server.kibanaresponsefactory.md index 91cb6c370d759..d5ba98c06ef02 100644 --- a/docs/development/core/server/kibana-plugin-core-server.kibanaresponsefactory.md +++ b/docs/development/core/server/kibana-plugin-core-server.kibanaresponsefactory.md @@ -34,7 +34,7 @@ kibanaResponseFactory: { message: string | Error; attributes?: ResponseErrorAttributes | undefined; }>; - customError: (options: CustomHttpResponseOptions) => KibanaResponse) => KibanaResponse; diff --git a/docs/development/core/server/kibana-plugin-core-server.md b/docs/development/core/server/kibana-plugin-core-server.md index d142579e1ced3..e33beb19e01a4 100644 --- a/docs/development/core/server/kibana-plugin-core-server.md +++ b/docs/development/core/server/kibana-plugin-core-server.md @@ -60,6 +60,7 @@ The plugin integrates with the core system via lifecycle events: `setup` | [ConfigDeprecationDetails](./kibana-plugin-core-server.configdeprecationdetails.md) | | | [ContextSetup](./kibana-plugin-core-server.contextsetup.md) | An object that handles registration of context providers and configuring handlers with context. | | [CorePreboot](./kibana-plugin-core-server.corepreboot.md) | Context passed to the setup method of preboot plugins. | +| [CoreRequestHandlerContext](./kibana-plugin-core-server.corerequesthandlercontext.md) | The core context provided to route handler.Provides the following clients and services: - [savedObjects.client](./kibana-plugin-core-server.savedobjectsclient.md) - Saved Objects client which uses the credentials of the incoming request - [savedObjects.typeRegistry](./kibana-plugin-core-server.isavedobjecttyperegistry.md) - Type registry containing all the registered types. - [elasticsearch.client](./kibana-plugin-core-server.iscopedclusterclient.md) - Elasticsearch data client which uses the credentials of the incoming request - [uiSettings.client](./kibana-plugin-core-server.iuisettingsclient.md) - uiSettings client which uses the credentials of the incoming request | | [CoreSetup](./kibana-plugin-core-server.coresetup.md) | Context passed to the setup method of standard plugins. | | [CoreStart](./kibana-plugin-core-server.corestart.md) | Context passed to the plugins start method. | | [CoreStatus](./kibana-plugin-core-server.corestatus.md) | Status of core services. | @@ -133,7 +134,8 @@ The plugin integrates with the core system via lifecycle events: `setup` | [PrebootPlugin](./kibana-plugin-core-server.prebootplugin.md) | The interface that should be returned by a PluginInitializer for a preboot plugin. | | [PrebootServicePreboot](./kibana-plugin-core-server.prebootservicepreboot.md) | Kibana Preboot Service allows to control the boot flow of Kibana. Preboot plugins can use it to hold the boot until certain condition is met. | | [RegisterDeprecationsConfig](./kibana-plugin-core-server.registerdeprecationsconfig.md) | | -| [RequestHandlerContext](./kibana-plugin-core-server.requesthandlercontext.md) | Plugin specific context passed to a route handler.Provides the following clients and services: - [savedObjects.client](./kibana-plugin-core-server.savedobjectsclient.md) - Saved Objects client which uses the credentials of the incoming request - [savedObjects.typeRegistry](./kibana-plugin-core-server.isavedobjecttyperegistry.md) - Type registry containing all the registered types. - [elasticsearch.client](./kibana-plugin-core-server.iscopedclusterclient.md) - Elasticsearch data client which uses the credentials of the incoming request - [uiSettings.client](./kibana-plugin-core-server.iuisettingsclient.md) - uiSettings client which uses the credentials of the incoming request | +| [RequestHandlerContext](./kibana-plugin-core-server.requesthandlercontext.md) | Base context passed to a route handler. | +| [RequestHandlerContextBase](./kibana-plugin-core-server.requesthandlercontextbase.md) | \* | | [ResolveCapabilitiesOptions](./kibana-plugin-core-server.resolvecapabilitiesoptions.md) | Defines a set of additional options for the resolveCapabilities method of [CapabilitiesStart](./kibana-plugin-core-server.capabilitiesstart.md). | | [RouteConfig](./kibana-plugin-core-server.routeconfig.md) | Route specific configuration. | | [RouteConfigOptions](./kibana-plugin-core-server.routeconfigoptions.md) | Additional route options. | @@ -262,6 +264,7 @@ The plugin integrates with the core system via lifecycle events: `setup` | [AuthResult](./kibana-plugin-core-server.authresult.md) | | | [CapabilitiesProvider](./kibana-plugin-core-server.capabilitiesprovider.md) | See [CapabilitiesSetup](./kibana-plugin-core-server.capabilitiessetup.md) | | [CapabilitiesSwitcher](./kibana-plugin-core-server.capabilitiesswitcher.md) | See [CapabilitiesSetup](./kibana-plugin-core-server.capabilitiessetup.md) | +| [CustomRequestHandlerContext](./kibana-plugin-core-server.customrequesthandlercontext.md) | | | [DeprecationsDetails](./kibana-plugin-core-server.deprecationsdetails.md) | | | [DestructiveRouteMethod](./kibana-plugin-core-server.destructiveroutemethod.md) | Set of HTTP methods changing the state of the server. | | [DocLinksServiceStart](./kibana-plugin-core-server.doclinksservicestart.md) | | diff --git a/docs/development/core/server/kibana-plugin-core-server.requesthandlercontext.core.md b/docs/development/core/server/kibana-plugin-core-server.requesthandlercontext.core.md index dcf6975c5fa70..8d0b715fdef7b 100644 --- a/docs/development/core/server/kibana-plugin-core-server.requesthandlercontext.core.md +++ b/docs/development/core/server/kibana-plugin-core-server.requesthandlercontext.core.md @@ -7,22 +7,5 @@ Signature: ```typescript -core: { - savedObjects: { - client: SavedObjectsClientContract; - typeRegistry: ISavedObjectTypeRegistry; - getClient: (options?: SavedObjectsClientProviderOptions) => SavedObjectsClientContract; - getExporter: (client: SavedObjectsClientContract) => ISavedObjectsExporter; - getImporter: (client: SavedObjectsClientContract) => ISavedObjectsImporter; - }; - elasticsearch: { - client: IScopedClusterClient; - }; - uiSettings: { - client: IUiSettingsClient; - }; - deprecations: { - client: DeprecationsClient; - }; - }; +core: Promise; ``` diff --git a/docs/development/core/server/kibana-plugin-core-server.requesthandlercontext.md b/docs/development/core/server/kibana-plugin-core-server.requesthandlercontext.md index 0d705c9daa333..214f8a6f6ba5c 100644 --- a/docs/development/core/server/kibana-plugin-core-server.requesthandlercontext.md +++ b/docs/development/core/server/kibana-plugin-core-server.requesthandlercontext.md @@ -4,19 +4,18 @@ ## RequestHandlerContext interface -Plugin specific context passed to a route handler. - -Provides the following clients and services: - [savedObjects.client](./kibana-plugin-core-server.savedobjectsclient.md) - Saved Objects client which uses the credentials of the incoming request - [savedObjects.typeRegistry](./kibana-plugin-core-server.isavedobjecttyperegistry.md) - Type registry containing all the registered types. - [elasticsearch.client](./kibana-plugin-core-server.iscopedclusterclient.md) - Elasticsearch data client which uses the credentials of the incoming request - [uiSettings.client](./kibana-plugin-core-server.iuisettingsclient.md) - uiSettings client which uses the credentials of the incoming request +Base context passed to a route handler. Signature: ```typescript -export interface RequestHandlerContext +export interface RequestHandlerContext extends RequestHandlerContextBase ``` +Extends: RequestHandlerContextBase ## Properties | Property | Type | Description | | --- | --- | --- | -| [core](./kibana-plugin-core-server.requesthandlercontext.core.md) | { savedObjects: { client: SavedObjectsClientContract; typeRegistry: ISavedObjectTypeRegistry; getClient: (options?: SavedObjectsClientProviderOptions) => SavedObjectsClientContract; getExporter: (client: SavedObjectsClientContract) => ISavedObjectsExporter; getImporter: (client: SavedObjectsClientContract) => ISavedObjectsImporter; }; elasticsearch: { client: IScopedClusterClient; }; uiSettings: { client: IUiSettingsClient; }; deprecations: { client: DeprecationsClient; }; } | | +| [core](./kibana-plugin-core-server.requesthandlercontext.core.md) | Promise<CoreRequestHandlerContext> | | diff --git a/docs/development/core/server/kibana-plugin-core-server.requesthandlercontextbase.md b/docs/development/core/server/kibana-plugin-core-server.requesthandlercontextbase.md new file mode 100644 index 0000000000000..33a123eefae63 --- /dev/null +++ b/docs/development/core/server/kibana-plugin-core-server.requesthandlercontextbase.md @@ -0,0 +1,20 @@ + + +[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [RequestHandlerContextBase](./kibana-plugin-core-server.requesthandlercontextbase.md) + +## RequestHandlerContextBase interface + +\* + +Signature: + +```typescript +export interface RequestHandlerContextBase +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [resolve](./kibana-plugin-core-server.requesthandlercontextbase.resolve.md) | <T extends keyof Omit<this, 'resolve'>>(parts: T\[\]) => Promise<AwaitedProperties<Pick<this, T>>> | Await all the specified context parts and return them. | + diff --git a/docs/development/core/server/kibana-plugin-core-server.requesthandlercontextbase.resolve.md b/docs/development/core/server/kibana-plugin-core-server.requesthandlercontextbase.resolve.md new file mode 100644 index 0000000000000..74192c0e1aee8 --- /dev/null +++ b/docs/development/core/server/kibana-plugin-core-server.requesthandlercontextbase.resolve.md @@ -0,0 +1,23 @@ + + +[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [RequestHandlerContextBase](./kibana-plugin-core-server.requesthandlercontextbase.md) > [resolve](./kibana-plugin-core-server.requesthandlercontextbase.resolve.md) + +## RequestHandlerContextBase.resolve property + +Await all the specified context parts and return them. + +Signature: + +```typescript +resolve: >(parts: T[]) => Promise>>; +``` + +## Example + + +```ts +const resolved = await context.resolve(['core', 'pluginA']); +const esClient = resolved.core.elasticsearch.client; +const pluginAService = resolved.pluginA.someService; +``` + diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectreferencewithcontext.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectreferencewithcontext.md index 8cdfbb4fde480..79dd7a40019ec 100644 --- a/docs/development/core/server/kibana-plugin-core-server.savedobjectreferencewithcontext.md +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectreferencewithcontext.md @@ -19,7 +19,9 @@ export interface SavedObjectReferenceWithContext | [id](./kibana-plugin-core-server.savedobjectreferencewithcontext.id.md) | string | The ID of the referenced object | | [inboundReferences](./kibana-plugin-core-server.savedobjectreferencewithcontext.inboundreferences.md) | Array<{ type: string; id: string; name: string; }> | References to this object; note that this does not contain \_all inbound references everywhere for this object\_, it only contains inbound references for the scope of this operation | | [isMissing?](./kibana-plugin-core-server.savedobjectreferencewithcontext.ismissing.md) | boolean | (Optional) Whether or not this object or reference is missing | +| [originId?](./kibana-plugin-core-server.savedobjectreferencewithcontext.originid.md) | string | (Optional) The origin ID of the referenced object (if it has one) | | [spaces](./kibana-plugin-core-server.savedobjectreferencewithcontext.spaces.md) | string\[\] | The space(s) that the referenced object exists in | | [spacesWithMatchingAliases?](./kibana-plugin-core-server.savedobjectreferencewithcontext.spaceswithmatchingaliases.md) | string\[\] | (Optional) The space(s) that legacy URL aliases matching this type/id exist in | +| [spacesWithMatchingOrigins?](./kibana-plugin-core-server.savedobjectreferencewithcontext.spaceswithmatchingorigins.md) | string\[\] | (Optional) The space(s) that objects matching this origin exist in (including this one) | | [type](./kibana-plugin-core-server.savedobjectreferencewithcontext.type.md) | string | The type of the referenced object | diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectreferencewithcontext.originid.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectreferencewithcontext.originid.md new file mode 100644 index 0000000000000..47cac3f423647 --- /dev/null +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectreferencewithcontext.originid.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectReferenceWithContext](./kibana-plugin-core-server.savedobjectreferencewithcontext.md) > [originId](./kibana-plugin-core-server.savedobjectreferencewithcontext.originid.md) + +## SavedObjectReferenceWithContext.originId property + +The origin ID of the referenced object (if it has one) + +Signature: + +```typescript +originId?: string; +``` diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectreferencewithcontext.spaceswithmatchingorigins.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectreferencewithcontext.spaceswithmatchingorigins.md new file mode 100644 index 0000000000000..3fedce753c034 --- /dev/null +++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectreferencewithcontext.spaceswithmatchingorigins.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectReferenceWithContext](./kibana-plugin-core-server.savedobjectreferencewithcontext.md) > [spacesWithMatchingOrigins](./kibana-plugin-core-server.savedobjectreferencewithcontext.spaceswithmatchingorigins.md) + +## SavedObjectReferenceWithContext.spacesWithMatchingOrigins property + +The space(s) that objects matching this origin exist in (including this one) + +Signature: + +```typescript +spacesWithMatchingOrigins?: string[]; +``` diff --git a/docs/discover/document-explorer.asciidoc b/docs/discover/document-explorer.asciidoc index de7b07aa4d784..e0cead0292cf3 100644 --- a/docs/discover/document-explorer.asciidoc +++ b/docs/discover/document-explorer.asciidoc @@ -1,10 +1,11 @@ [[document-explorer]] -== Document Explorer +== Explore your documents -beta::[] -*Discover* has a *Document Explorer* with resizable columns, better data sorting and comparison, -and a fullscreen view. +*Discover* displays your documents in table format, so you can +best explore your data. +Use the document table to resize columns, set row height, +perform multi-column sorting, compare data, and more. ++++