Skip to content

Commit

Permalink
Merge branch 'main' into lens_choropleth_chart
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine authored Mar 17, 2022
2 parents 00a25b1 + b53dfe7 commit 497b462
Show file tree
Hide file tree
Showing 968 changed files with 32,307 additions and 104,727 deletions.
2 changes: 1 addition & 1 deletion .buildkite/scripts/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if ! yarn kbn bootstrap; then
fi

if [[ "$DISABLE_BOOTSTRAP_VALIDATION" != "true" ]]; then
verify_no_git_changes 'yarn kbn bootstrap'
check_for_changed_files 'yarn kbn bootstrap'
fi

###
Expand Down
39 changes: 34 additions & 5 deletions .buildkite/scripts/common/util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,46 @@ is_pr() {
false
}

verify_no_git_changes() {
check_for_changed_files() {
RED='\033[0;31m'
YELLOW='\033[0;33m'
C_RESET='\033[0m' # Reset color

SHOULD_AUTO_COMMIT_CHANGES="${2:-}"
GIT_CHANGES="$(git ls-files --modified -- . ':!:.bazelrc')"

if [ "$GIT_CHANGES" ]; then
echo -e "\n${RED}ERROR: '$1' caused changes to the following files:${C_RESET}\n"
echo -e "$GIT_CHANGES\n"
echo -e "\n${YELLOW}TO FIX: Run '$1' locally, commit the changes and push to your branch${C_RESET}\n"
exit 1
if [[ "$SHOULD_AUTO_COMMIT_CHANGES" == "true" && "${BUILDKITE_PULL_REQUEST:-}" ]]; then
NEW_COMMIT_MESSAGE="[CI] Auto-commit changed files from '$1'"
PREVIOUS_COMMIT_MESSAGE="$(git log -1 --pretty=%B)"

if [[ "$NEW_COMMIT_MESSAGE" == "$PREVIOUS_COMMIT_MESSAGE" ]]; then
echo -e "\n${RED}ERROR: '$1' caused changes to the following files:${C_RESET}\n"
echo -e "$GIT_CHANGES\n"
echo -e "CI already attempted to commit these changes, but the file(s) seem to have changed again."
echo -e "Please review and fix manually."
exit 1
fi

echo "'$1' caused changes to the following files:"
echo "$GIT_CHANGES"
echo ""
echo "Auto-committing these changes now. A new build should start soon if successful."

git config --global user.name kibanamachine
git config --global user.email '[email protected]'
gh pr checkout "${BUILDKITE_PULL_REQUEST}"
git add -u -- . ':!.bazelrc'

git commit -m "$NEW_COMMIT_MESSAGE"
git push
exit 1
else
echo -e "\n${RED}ERROR: '$1' caused changes to the following files:${C_RESET}\n"
echo -e "$GIT_CHANGES\n"
echo -e "\n${YELLOW}TO FIX: Run '$1' locally, commit the changes and push to your branch${C_RESET}\n"
exit 1
fi
fi
}

Expand Down
4 changes: 3 additions & 1 deletion .buildkite/scripts/steps/checks/bazel_packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ set -euo pipefail
source .buildkite/scripts/common/util.sh

echo --- Check Bazel Packages Manifest
node scripts/generate packages_build_manifest --validate
node scripts/generate packages_build_manifest

check_for_changed_files 'node scripts/generate packages_build_manifest' true
2 changes: 1 addition & 1 deletion .buildkite/scripts/steps/checks/kbn_pm_dist.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ source .buildkite/scripts/common/util.sh
echo "--- Building kbn-pm distributable"
yarn kbn run build -i @kbn/pm

verify_no_git_changes 'yarn kbn run build -i @kbn/pm'
check_for_changed_files 'yarn kbn run build -i @kbn/pm' true
2 changes: 1 addition & 1 deletion .buildkite/scripts/steps/checks/plugin_list_docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ source .buildkite/scripts/common/util.sh
echo "--- Building plugin list docs"
node scripts/build_plugin_list_docs

verify_no_git_changes 'node scripts/build_plugin_list_docs'
check_for_changed_files 'node scripts/build_plugin_list_docs' true
10 changes: 9 additions & 1 deletion .buildkite/scripts/steps/cloud/build_and_deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ node scripts/build \
--skip-docker-ubuntu \
--skip-docker-contexts

ELASTICSEARCH_MANIFEST_URL="https://storage.googleapis.com/kibana-ci-es-snapshots-daily/$(jq -r '.version' package.json)/manifest-latest-verified.json"
ELASTICSEARCH_SHA=$(curl -s $ELASTICSEARCH_MANIFEST_URL | jq -r '.sha')
ELASTICSEARCH_CLOUD_IMAGE="docker.elastic.co/kibana-ci/elasticsearch-cloud:$VERSION-$ELASTICSEARCH_SHA"

CLOUD_IMAGE=$(docker images --format "{{.Repository}}:{{.Tag}}" docker.elastic.co/kibana-ci/kibana-cloud)
CLOUD_DEPLOYMENT_NAME="kibana-pr-$BUILDKITE_PULL_REQUEST"

Expand All @@ -40,6 +44,7 @@ JSON_FILE=$(mktemp --suffix ".json")
if [ -z "${CLOUD_DEPLOYMENT_ID}" ]; then
jq '
.resources.kibana[0].plan.kibana.docker_image = "'$CLOUD_IMAGE'" |
.resources.elasticsearch[0].plan.elasticsearch.docker_image = "'$ELASTICSEARCH_CLOUD_IMAGE'" |
.name = "'$CLOUD_DEPLOYMENT_NAME'" |
.resources.kibana[0].plan.kibana.version = "'$VERSION'" |
.resources.elasticsearch[0].plan.elasticsearch.version = "'$VERSION'" |
Expand Down Expand Up @@ -70,6 +75,7 @@ if [ -z "${CLOUD_DEPLOYMENT_ID}" ]; then
else
ecctl deployment show "$CLOUD_DEPLOYMENT_ID" --generate-update-payload | jq '
.resources.kibana[0].plan.kibana.docker_image = "'$CLOUD_IMAGE'" |
.resources.elasticsearch[0].plan.elasticsearch.docker_image = "'$ELASTICSEARCH_CLOUD_IMAGE'" |
(.. | select(.version? != null).version) = "'$VERSION'"
' > /tmp/deploy.json
ecctl deployment update "$CLOUD_DEPLOYMENT_ID" --track --output json --file /tmp/deploy.json &> "$JSON_FILE"
Expand All @@ -87,7 +93,9 @@ cat << EOF | buildkite-agent annotate --style "info" --context cloud
Credentials: \`vault read secret/kibana-issues/dev/cloud-deploy/$CLOUD_DEPLOYMENT_NAME\`
Image: $CLOUD_IMAGE
Kibana image: \`$CLOUD_IMAGE\`
Elasticsearch image: \`$ELASTICSEARCH_CLOUD_IMAGE\`
EOF

buildkite-agent meta-data set pr_comment:deploy_cloud:head "* [Cloud Deployment](${CLOUD_DEPLOYMENT_KIBANA_URL})"
18 changes: 17 additions & 1 deletion .buildkite/scripts/steps/es_snapshots/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ echo "--- Build Elasticsearch"
:distribution:archives:darwin-aarch64-tar:assemble \
:distribution:archives:darwin-tar:assemble \
:distribution:docker:docker-export:assemble \
:distribution:docker:cloud-docker-export:assemble \
:distribution:archives:linux-aarch64-tar:assemble \
:distribution:archives:linux-tar:assemble \
:distribution:archives:windows-zip:assemble \
Expand All @@ -79,11 +80,26 @@ find distribution -type f \( -name 'elasticsearch-*-*-*-*.tar.gz' -o -name 'elas

ls -alh "$destination"

echo "--- Create docker image archives"
echo "--- Create docker default image archives"
docker images "docker.elastic.co/elasticsearch/elasticsearch"
docker images "docker.elastic.co/elasticsearch/elasticsearch" --format "{{.Tag}}" | xargs -n1 echo 'docker save docker.elastic.co/elasticsearch/elasticsearch:${0} | gzip > ../es-build/elasticsearch-${0}-docker-image.tar.gz'
docker images "docker.elastic.co/elasticsearch/elasticsearch" --format "{{.Tag}}" | xargs -n1 bash -c 'docker save docker.elastic.co/elasticsearch/elasticsearch:${0} | gzip > ../es-build/elasticsearch-${0}-docker-image.tar.gz'

echo "--- Create kibana-ci docker cloud image archives"
ES_CLOUD_ID=$(docker images "docker.elastic.co/elasticsearch-ci/elasticsearch-cloud" --format "{{.ID}}")
ES_CLOUD_VERSION=$(docker images "docker.elastic.co/elasticsearch-ci/elasticsearch-cloud" --format "{{.Tag}}")
KIBANA_ES_CLOUD_VERSION="$ES_CLOUD_VERSION-$ELASTICSEARCH_GIT_COMMIT"
KIBANA_ES_CLOUD_IMAGE="docker.elastic.co/kibana-ci/elasticsearch-cloud:$KIBANA_ES_CLOUD_VERSION"

docker tag "$ES_CLOUD_ID" "$KIBANA_ES_CLOUD_IMAGE"

echo "$KIBANA_DOCKER_PASSWORD" | docker login -u "$KIBANA_DOCKER_USERNAME" --password-stdin docker.elastic.co
trap 'docker logout docker.elastic.co' EXIT
docker image push "$KIBANA_ES_CLOUD_IMAGE"

export ELASTICSEARCH_CLOUD_IMAGE="$KIBANA_ES_CLOUD_IMAGE"
export ELASTICSEARCH_CLOUD_IMAGE_CHECKSUM="$(docker images "$KIBANA_ES_CLOUD_IMAGE" --format "{{.Digest}}")"

echo "--- Create checksums for snapshot files"
cd "$destination"
find ./* -exec bash -c "shasum -a 512 {} > {}.sha512" \;
Expand Down
13 changes: 13 additions & 0 deletions .buildkite/scripts/steps/es_snapshots/create_manifest.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ const { BASE_BUCKET_DAILY } = require('./bucket_config.js');
const destination = process.argv[2] || __dirname + '/test';

const ES_BRANCH = process.env.ELASTICSEARCH_BRANCH;
const ES_CLOUD_IMAGE = process.env.ELASTICSEARCH_CLOUD_IMAGE;
const ES_CLOUD_IMAGE_CHECKSUM = process.env.ELASTICSEARCH_CLOUD_IMAGE_CHECKSUM;
const GIT_COMMIT = process.env.ELASTICSEARCH_GIT_COMMIT;
const GIT_COMMIT_SHORT = process.env.ELASTICSEARCH_GIT_COMMIT_SHORT;

Expand Down Expand Up @@ -59,6 +61,17 @@ const { BASE_BUCKET_DAILY } = require('./bucket_config.js');
};
});

if (ES_CLOUD_IMAGE && ES_CLOUD_IMAGE_CHECKSUM) {
manifestEntries.push({
checksum: ES_CLOUD_IMAGE_CHECKSUM,
url: ES_CLOUD_IMAGE,
version: VERSION,
platform: 'docker',
architecture: 'image',
license: 'default',
});
}

const manifest = {
id: SNAPSHOT_ID,
bucket: `${BASE_BUCKET_DAILY}/${DESTINATION}`.toString(),
Expand Down
4 changes: 4 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,11 @@
/x-pack/test/api_integration/apis/monitoring @elastic/infra-monitoring-ui

# Fleet
/fleet_packages.json @elastic/fleet
/x-pack/plugins/fleet/ @elastic/fleet
/x-pack/test/fleet_api_integration @elastic/fleet
/x-pack/test/fleet_cypress @elastic/fleet
/x-pack/test/fleet_functional @elastic/fleet

# APM
/x-pack/plugins/apm/ @elastic/apm-ui
Expand Down
1 change: 1 addition & 0 deletions .i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
"server": "src/legacy/server",
"share": "src/plugins/share",
"sharedUX": "src/plugins/shared_ux",
"sharedUXComponents": "packages/kbn-shared-ux-components/src",
"statusPage": "src/legacy/core_plugins/status_page",
"telemetry": ["src/plugins/telemetry", "src/plugins/telemetry_management_section"],
"timelion": ["src/plugins/vis_types/timelion"],
Expand Down
4 changes: 4 additions & 0 deletions config/kibana.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@
# must be a positive integer.
#elasticsearch.requestTimeout: 30000

# The maximum number of sockets that can be used for communications with elasticsearch.
# Defaults to `Infinity`.
#elasticsearch.maxSockets: 1024

# Specifies whether Kibana should use compression for communications with elasticsearch
# Defaults to `false`.
#elasticsearch.compression: false
Expand Down
12 changes: 8 additions & 4 deletions docs/apm/api.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -742,20 +742,24 @@ include::api.asciidoc[tag=using-the-APIs]
[[apm-create-agent-key]]
==== Create agent key

Create an APM agent key. Specify privileges in the request body at creation time.
Create an APM agent API key. Specify API key privileges in the request body at creation time.

[[apm-create-agent-key-privileges]]
===== Privileges

Users must have at least the `manage_own_api_key` cluster privilege and the required application privileges.
The user creating an APM agent API key must have at least the `manage_own_api_key` cluster privilege
and the APM application-level privileges that it wishes to grant.

====== Example role:
====== Example role

The example below uses the Kibana <<role-management-api,role management API>> to create a role named `apm_agent_key_user`.
Create and assign this role to a user that wishes to create APM agent API keys.

[source,js]
--------------------------------------------------
POST /_security/role/apm_agent_key_user
{
"cluster": ["manage_own_api_key"],
"cluster": ["manage_own_api_key"],
"applications": [{
"application": "apm",
"privileges": ["event:write", "sourcemap:write", "config_agent:read"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

> Warning: This API is now obsolete.
>
> [AppMountParameters.onAppLeave](./kibana-plugin-core-public.appmountparameters.onappleave.md) has been deprecated in favor of [ScopedHistory.block](./kibana-plugin-core-public.scopedhistory.block.md)
> [AppMountParameters.onAppLeave](./kibana-plugin-core-public.appmountparameters.onappleave.md) has been deprecated in favor of [ScopedHistory.block](./kibana-plugin-core-public.scopedhistory.block.md) 8.8.0
>
A handler that will be executed before leaving the application, either when going to another application or when closing the browser tab or manually changing the url. Should return `confirm` to prompt a message to the user before leaving the page, or `default` to keep the default behavior (doing nothing).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

> Warning: This API is now obsolete.
>
> Use [AppMountParameters.history](./kibana-plugin-core-public.appmountparameters.history.md) instead.
> Use [AppMountParameters.history](./kibana-plugin-core-public.appmountparameters.history.md) instead. 8.8.0
>
The route path for configuring navigation to the application. This string should not include the base path from HTTP.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

> Warning: This API is now obsolete.
>
> [ScopedHistory.block](./kibana-plugin-core-public.scopedhistory.block.md) should be used instead.
> [ScopedHistory.block](./kibana-plugin-core-public.scopedhistory.block.md) should be used instead. 8.8.0
>
A function that can be used to register a handler that will be called when the user is leaving the current application, allowing to prompt a confirmation message before actually changing the page.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

> Warning: This API is now obsolete.
>
> 8.8.0
>
exposed temporarily until https://github.com/elastic/kibana/issues/41990 done use \*only\* to retrieve config values. There is no way to set injected values in the new platform.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

> Warning: This API is now obsolete.
>
> 8.8.0
>
exposed temporarily until https://github.com/elastic/kibana/issues/41990 done use \*only\* to retrieve config values. There is no way to set injected values in the new platform.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@

> Warning: This API is now obsolete.
>
> Provided for legacy compatibility. Prefer the `request` property instead.
> Provided for legacy compatibility. Prefer the `request` property instead. 8.8.0
>
> Note to maintainers: when looking at usages, mind that typical use could be inside a `catch` block, so TS and code-reference navigation might not highlight them.
>
<b>Signature:</b>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@

> Warning: This API is now obsolete.
>
> Provided for legacy compatibility. Prefer the `response` property instead.
> Provided for legacy compatibility. Prefer the `response` property instead. 8.8.0
>
> Note to maintainers: when looking at usages, mind that typical use could be inside a `catch` block, so TS and code-reference navigation might not highlight them.
>
<b>Signature:</b>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

> Warning: This API is now obsolete.
>
> If `createNewCopy` is specified, the new object has a new (undefined) origin ID. This is only needed for the case where `createNewCopies` mode is disabled and ambiguous source conflicts are detected. When `createNewCopies` mode is permanently enabled, this field will be redundant and can be removed.
> Can be removed when https://github.com/elastic/kibana/issues/91615 is done. If `createNewCopy` is specified, the new object has a new (undefined) origin ID. This is only needed for the case where `createNewCopies` mode is disabled and ambiguous source conflicts are detected. When `createNewCopies` mode is permanently enabled, this field will be redundant and can be removed.
>
<b>Signature:</b>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

> Warning: This API is now obsolete.
>
> Asynchronous lifecycles are deprecated, and should be migrated to sync
> Asynchronous lifecycles are deprecated, and should be migrated to sync 8.8.0
>
A plugin with asynchronous lifecycle methods.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Configuration options to be used to create a [cluster client](./kibana-plugin-co
<b>Signature:</b>

```typescript
export declare type ElasticsearchClientConfig = Pick<ElasticsearchConfig, 'customHeaders' | 'compression' | 'sniffOnStart' | 'sniffOnConnectionFault' | 'requestHeadersWhitelist' | 'sniffInterval' | 'hosts' | 'username' | 'password' | 'serviceAccountToken'> & {
export declare type ElasticsearchClientConfig = Pick<ElasticsearchConfig, 'customHeaders' | 'maxSockets' | 'compression' | 'sniffOnStart' | 'sniffOnConnectionFault' | 'requestHeadersWhitelist' | 'sniffInterval' | 'hosts' | 'username' | 'password' | 'serviceAccountToken'> & {
pingTimeout?: ElasticsearchConfig['pingTimeout'] | ClientOptions['pingTimeout'];
requestTimeout?: ElasticsearchConfig['requestTimeout'] | ClientOptions['requestTimeout'];
ssl?: Partial<ElasticsearchConfig['ssl']>;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [ElasticsearchConfig](./kibana-plugin-core-server.elasticsearchconfig.md) &gt; [maxSockets](./kibana-plugin-core-server.elasticsearchconfig.maxsockets.md)

## ElasticsearchConfig.maxSockets property

The maximum number of sockets that can be used for communications with elasticsearch.

<b>Signature:</b>

```typescript
readonly maxSockets: number;
```
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export declare class ElasticsearchConfig
| [healthCheckDelay](./kibana-plugin-core-server.elasticsearchconfig.healthcheckdelay.md) | | Duration | The interval between health check requests Kibana sends to the Elasticsearch. |
| [hosts](./kibana-plugin-core-server.elasticsearchconfig.hosts.md) | | string\[\] | Hosts that the client will connect to. If sniffing is enabled, this list will be used as seeds to discover the rest of your cluster. |
| [ignoreVersionMismatch](./kibana-plugin-core-server.elasticsearchconfig.ignoreversionmismatch.md) | | boolean | Whether to allow kibana to connect to a non-compatible elasticsearch node. |
| [maxSockets](./kibana-plugin-core-server.elasticsearchconfig.maxsockets.md) | | number | The maximum number of sockets that can be used for communications with elasticsearch. |
| [password?](./kibana-plugin-core-server.elasticsearchconfig.password.md) | | string | <i>(Optional)</i> If Elasticsearch is protected with basic authentication, this setting provides the password that the Kibana server uses to perform its administrative functions. |
| [pingTimeout](./kibana-plugin-core-server.elasticsearchconfig.pingtimeout.md) | | Duration | Timeout after which PING HTTP request will be aborted and retried. |
| [requestHeadersWhitelist](./kibana-plugin-core-server.elasticsearchconfig.requestheaderswhitelist.md) | | string\[\] | List of Kibana client-side headers to send to Elasticsearch when request scoped cluster client is used. If this is an empty array then \*no\* client-side will be sent. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

> Warning: This API is now obsolete.
>
> use the processes field instead.
> use the processes field instead. 8.8.0
>
Process related metrics.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

> Warning: This API is now obsolete.
>
> To be deleted when https://github.com/elastic/kibana/issues/101948 is done.
>
Specifies directory names that can be imported by other ui-plugins built using the same instance of the @<!-- -->kbn/optimizer. A temporary measure we plan to replace with better mechanisms for sharing static code between plugins
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

> Warning: This API is now obsolete.
>
> If `createNewCopy` is specified, the new object has a new (undefined) origin ID. This is only needed for the case where `createNewCopies` mode is disabled and ambiguous source conflicts are detected. When `createNewCopies` mode is permanently enabled, this field will be redundant and can be removed.
> Can be removed when https://github.com/elastic/kibana/issues/91615 is done. If `createNewCopy` is specified, the new object has a new (undefined) origin ID. This is only needed for the case where `createNewCopies` mode is disabled and ambiguous source conflicts are detected. When `createNewCopies` mode is permanently enabled, this field will be redundant and can be removed.
>
<b>Signature:</b>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

> Warning: This API is now obsolete.
>
> Use `warn` instead.
> Use `warn` instead. 8.8.0
>
<b>Signature:</b>
Expand Down
Loading

0 comments on commit 497b462

Please sign in to comment.