Skip to content

Commit

Permalink
Merge branch 'main' into refactor-options-list_2022-08-08
Browse files Browse the repository at this point in the history
  • Loading branch information
Heenawter authored Aug 12, 2022
2 parents 54282cc + a9a1828 commit 2340f62
Show file tree
Hide file tree
Showing 1,151 changed files with 37,051 additions and 15,681 deletions.
2 changes: 2 additions & 0 deletions .buildkite/ftr_configs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ enabled:
- x-pack/test/functional_synthetics/config.js
- x-pack/test/functional_with_es_ssl/config.ts
- x-pack/test/functional/apps/advanced_settings/config.ts
- x-pack/test/functional/apps/aiops/config.ts
- x-pack/test/functional/apps/api_keys/config.ts
- x-pack/test/functional/apps/apm/config.ts
- x-pack/test/functional/apps/canvas/config.ts
Expand Down Expand Up @@ -249,6 +250,7 @@ enabled:
- x-pack/test/security_functional/oidc.config.ts
- x-pack/test/security_functional/saml.config.ts
- x-pack/test/security_functional/insecure_cluster_warning.config.ts
- x-pack/test/security_functional/user_profiles.config.ts
- x-pack/test/security_solution_endpoint_api_int/config.ts
- x-pack/test/security_solution_endpoint/config.ts
- x-pack/test/session_view/basic/config.ts
Expand Down
6 changes: 5 additions & 1 deletion .buildkite/scripts/pipelines/pull_request/pipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,11 @@ const uploadPipeline = (pipelineContent: string | object) => {
pipeline.push(getPipeline('.buildkite/pipelines/pull_request/ux_plugin_e2e.yml'));
}

if (GITHUB_PR_LABELS.includes('ci:deploy-cloud')) {
if (
GITHUB_PR_LABELS.includes('ci:deploy-cloud') ||
GITHUB_PR_LABELS.includes('ci:cloud-deploy') ||
GITHUB_PR_LABELS.includes('ci:cloud-redeploy')
) {
pipeline.push(getPipeline('.buildkite/pipelines/pull_request/deploy_cloud.yml'));
}

Expand Down
61 changes: 38 additions & 23 deletions .buildkite/scripts/steps/cloud/build_and_deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ source .buildkite/scripts/common/util.sh
export KBN_NP_PLUGINS_BUILT=true

VERSION="$(jq -r '.version' package.json)-SNAPSHOT"
ECCTL_LOGS=$(mktemp --suffix ".json")

echo "--- Download Kibana Distribution"

Expand Down Expand Up @@ -46,9 +47,19 @@ fi

docker logout docker.elastic.co

if is_pr_with_label "ci:cloud-redeploy"; then
echo "--- Shutdown Previous Deployment"
CLOUD_DEPLOYMENT_ID=$(ecctl deployment list --output json | jq -r '.deployments[] | select(.name == "'$CLOUD_DEPLOYMENT_NAME'") | .id')
if [ -z "${CLOUD_DEPLOYMENT_ID}" ]; then
echo "No deployment to remove"
else
echo "Shutting down previous deployment..."
ecctl deployment shutdown "$CLOUD_DEPLOYMENT_ID" --force --track --output json > "$ECCTL_LOGS"
fi
fi

echo "--- Create Deployment"
CLOUD_DEPLOYMENT_ID=$(ecctl deployment list --output json | jq -r '.deployments[] | select(.name == "'$CLOUD_DEPLOYMENT_NAME'") | .id')
JSON_FILE=$(mktemp --suffix ".json")
if [ -z "${CLOUD_DEPLOYMENT_ID}" ]; then
jq '
.resources.kibana[0].plan.kibana.docker_image = "'$KIBANA_CLOUD_IMAGE'" |
Expand All @@ -60,45 +71,49 @@ if [ -z "${CLOUD_DEPLOYMENT_ID}" ]; then
.resources.integrations_server[0].plan.integrations_server.version = "'$VERSION'"
' .buildkite/scripts/steps/cloud/deploy.json > /tmp/deploy.json

echo -n "Creating deployment..."
ecctl deployment create --track --output json --file /tmp/deploy.json > "$JSON_FILE"
echo "done"
echo "Creating deployment..."
ecctl deployment create --track --output json --file /tmp/deploy.json > "$ECCTL_LOGS"

CLOUD_DEPLOYMENT_USERNAME=$(jq --slurp '.[]|select(.resources).resources[] | select(.credentials).credentials.username' "$JSON_FILE")
CLOUD_DEPLOYMENT_PASSWORD=$(jq --slurp '.[]|select(.resources).resources[] | select(.credentials).credentials.password' "$JSON_FILE")
CLOUD_DEPLOYMENT_ID=$(jq -r --slurp '.[0].id' "$JSON_FILE")
CLOUD_DEPLOYMENT_STATUS_MESSAGES=$(jq --slurp '[.[]|select(.resources == null)]' "$JSON_FILE")
CLOUD_DEPLOYMENT_USERNAME=$(jq --slurp '.[]|select(.resources).resources[] | select(.credentials).credentials.username' "$ECCTL_LOGS")
CLOUD_DEPLOYMENT_PASSWORD=$(jq --slurp '.[]|select(.resources).resources[] | select(.credentials).credentials.password' "$ECCTL_LOGS")
CLOUD_DEPLOYMENT_ID=$(jq -r --slurp '.[0].id' "$ECCTL_LOGS")
CLOUD_DEPLOYMENT_STATUS_MESSAGES=$(jq --slurp '[.[]|select(.resources == null)]' "$ECCTL_LOGS")

echo -n "Writing to vault..."
echo "Writing to vault..."
VAULT_ROLE_ID="$(retry 5 15 gcloud secrets versions access latest --secret=kibana-buildkite-vault-role-id)"
VAULT_SECRET_ID="$(retry 5 15 gcloud secrets versions access latest --secret=kibana-buildkite-vault-secret-id)"
VAULT_TOKEN=$(retry 5 30 vault write -field=token auth/approle/login role_id="$VAULT_ROLE_ID" secret_id="$VAULT_SECRET_ID")
retry 5 30 vault login -no-print "$VAULT_TOKEN"
retry 5 5 vault write "secret/kibana-issues/dev/cloud-deploy/$CLOUD_DEPLOYMENT_NAME" username="$CLOUD_DEPLOYMENT_USERNAME" password="$CLOUD_DEPLOYMENT_PASSWORD"

echo -n "Enabling Stack Monitoring..."
echo "Enabling Stack Monitoring..."
jq '
.settings.observability.metrics.destination.deployment_id = "'$CLOUD_DEPLOYMENT_ID'" |
.settings.observability.logging.destination.deployment_id = "'$CLOUD_DEPLOYMENT_ID'"
' .buildkite/scripts/steps/cloud/stack_monitoring.json > /tmp/stack_monitoring.json
ecctl deployment update "$CLOUD_DEPLOYMENT_ID" --track --output json --file /tmp/stack_monitoring.json > "$JSON_FILE"
echo "done"

echo -n "Enabling verbose logging..."
# After a deployment is created, a new Kibana plan is automatically added to update settings
# and restart Kibana. Polling for a plan state isn't especially reliable because it flips
# between empty and queued, and then empty again depending on how quickly setup is run in cloud.
# We want to enable monitoring after the automatic plan has run, if not we get an error:
# * deployments.resource_plan_state_error: Kibana resource [main-kibana] has a plan still pending, cancel that or wait for it to complete (settings.observability.plan)
# This adds a sleep and retry to see if we can make this step more reliable
sleep 120
retry 5 60 ecctl deployment update "$CLOUD_DEPLOYMENT_ID" --track --output json --file /tmp/stack_monitoring.json > "$ECCTL_LOGS"

echo "Enabling verbose logging..."
ecctl deployment show "$CLOUD_DEPLOYMENT_ID" --generate-update-payload | jq '
.resources.kibana[0].plan.kibana.user_settings_yaml = "logging.root.level: all"
' > /tmp/verbose_logging.json
ecctl deployment update "$CLOUD_DEPLOYMENT_ID" --track --output json --file /tmp/verbose_logging.json > "$JSON_FILE"
echo "done"
ecctl deployment update "$CLOUD_DEPLOYMENT_ID" --track --output json --file /tmp/verbose_logging.json > "$ECCTL_LOGS"
else
ecctl deployment show "$CLOUD_DEPLOYMENT_ID" --generate-update-payload | jq '
.resources.kibana[0].plan.kibana.docker_image = "'$KIBANA_CLOUD_IMAGE'" |
(.. | select(.version? != null).version) = "'$VERSION'"
' > /tmp/deploy.json

echo -n "Updating deployment..."
ecctl deployment update "$CLOUD_DEPLOYMENT_ID" --track --output json --file /tmp/deploy.json > "$JSON_FILE"
echo "done"
ecctl deployment show "$CLOUD_DEPLOYMENT_ID" --generate-update-payload | jq '
.resources.kibana[0].plan.kibana.docker_image = "'$KIBANA_CLOUD_IMAGE'" |
(.. | select(.version? != null).version) = "'$VERSION'"
' > /tmp/deploy.json

echo "Updating deployment..."
ecctl deployment update "$CLOUD_DEPLOYMENT_ID" --track --output json --file /tmp/deploy.json > "$ECCTL_LOGS"
fi

CLOUD_DEPLOYMENT_KIBANA_URL=$(ecctl deployment show "$CLOUD_DEPLOYMENT_ID" | jq -r '.resources.kibana[0].info.metadata.aliased_url')
Expand Down
8 changes: 6 additions & 2 deletions .buildkite/scripts/steps/cloud/purge_deployments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,13 @@ for (const deployment of prDeployments) {
if (pullRequest.state !== 'OPEN') {
console.log(`Pull Request #${prNumber} is no longer open, will delete associated deployment`);
deploymentsToPurge.push(deployment);
} else if (!pullRequest.labels.filter((label: any) => label.name === 'ci:deploy-cloud')) {
} else if (
!pullRequest.labels.filter((label: any) =>
/^ci:(deploy-cloud|cloud-deploy|cloud-redeploy)$/.test(label.name)
)
) {
console.log(
`Pull Request #${prNumber} no longer has the ci:deploy-cloud label, will delete associated deployment`
`Pull Request #${prNumber} no longer has the a cloud deployment label, will delete associated deployment`
);
deploymentsToPurge.push(deployment);
} else if (lastCommitTimestamp < NOW - 60 * 60 * 24 * 7) {
Expand Down
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -1341,7 +1341,7 @@ module.exports = {
* Discover overrides
*/
{
files: ['src/plugins/discover/**/*.{ts,tsx}'],
files: ['src/plugins/discover/**/*.{ts,tsx}', 'src/plugins/saved_search/**/*.{ts,tsx}'],
rules: {
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/ban-ts-comment': [
Expand Down
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

# Data Discovery
/src/plugins/discover/ @elastic/kibana-data-discovery
/src/plugins/saved_search/ @elastic/kibana-data-discovery
/x-pack/plugins/discover_enhanced/ @elastic/kibana-data-discovery
/test/functional/apps/discover/ @elastic/kibana-data-discovery
/x-pack/plugins/graph/ @elastic/kibana-data-discovery
Expand Down Expand Up @@ -85,6 +86,7 @@
/x-pack/plugins/runtime_fields @elastic/kibana-app-services
/x-pack/test/search_sessions_integration/ @elastic/kibana-app-services
/src/plugins/dashboard/public/application/embeddable/viewport/print_media @elastic/kibana-app-services
x-pack/plugins/files @elastic/kibana-app-services

### Observability Plugins

Expand Down
1 change: 1 addition & 0 deletions .i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"dataViews": "src/plugins/data_views",
"devTools": "src/plugins/dev_tools",
"discover": "src/plugins/discover",
"savedSearch": "src/plugins/saved_search",
"embeddableApi": "src/plugins/embeddable",
"embeddableExamples": "examples/embeddable_examples",
"esQuery": "packages/kbn-es-query/src",
Expand Down
2 changes: 1 addition & 1 deletion STYLEGUIDE.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
id: kibStyleGuide
slug: /kibana-dev-docs/contributing/styleguide
title: Style Guide
summary: JavaScript/TypeScript styleguide.
description: JavaScript/TypeScript styleguide.
date: 2021-05-06
tags: ['kibana', 'onboarding', 'dev', 'styleguide', 'typescript', 'javascript']
---
Expand Down
9 changes: 6 additions & 3 deletions api_docs/actions.mdx
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
---
####
#### This document is auto-generated and is meant to be viewed inside our experimental, new docs system.
#### Reach out in #docs-engineering for more info.
####
id: kibActionsPluginApi
slug: /kibana-dev-docs/api/actions
title: "actions"
image: https://source.unsplash.com/400x175/?github
summary: API docs for the actions plugin
date: 2022-08-10
description: API docs for the actions plugin
date: 2022-08-12
tags: ['contributor', 'dev', 'apidocs', 'kibana', 'actions']
warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info.
---
import actionsObj from './actions.devdocs.json';

Expand Down
9 changes: 6 additions & 3 deletions api_docs/advanced_settings.mdx
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
---
####
#### This document is auto-generated and is meant to be viewed inside our experimental, new docs system.
#### Reach out in #docs-engineering for more info.
####
id: kibAdvancedSettingsPluginApi
slug: /kibana-dev-docs/api/advancedSettings
title: "advancedSettings"
image: https://source.unsplash.com/400x175/?github
summary: API docs for the advancedSettings plugin
date: 2022-08-10
description: API docs for the advancedSettings plugin
date: 2022-08-12
tags: ['contributor', 'dev', 'apidocs', 'kibana', 'advancedSettings']
warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info.
---
import advancedSettingsObj from './advanced_settings.devdocs.json';

Expand Down
9 changes: 6 additions & 3 deletions api_docs/aiops.mdx
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
---
####
#### This document is auto-generated and is meant to be viewed inside our experimental, new docs system.
#### Reach out in #docs-engineering for more info.
####
id: kibAiopsPluginApi
slug: /kibana-dev-docs/api/aiops
title: "aiops"
image: https://source.unsplash.com/400x175/?github
summary: API docs for the aiops plugin
date: 2022-08-10
description: API docs for the aiops plugin
date: 2022-08-12
tags: ['contributor', 'dev', 'apidocs', 'kibana', 'aiops']
warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info.
---
import aiopsObj from './aiops.devdocs.json';

Expand Down
9 changes: 6 additions & 3 deletions api_docs/alerting.mdx
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
---
####
#### This document is auto-generated and is meant to be viewed inside our experimental, new docs system.
#### Reach out in #docs-engineering for more info.
####
id: kibAlertingPluginApi
slug: /kibana-dev-docs/api/alerting
title: "alerting"
image: https://source.unsplash.com/400x175/?github
summary: API docs for the alerting plugin
date: 2022-08-10
description: API docs for the alerting plugin
date: 2022-08-12
tags: ['contributor', 'dev', 'apidocs', 'kibana', 'alerting']
warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info.
---
import alertingObj from './alerting.devdocs.json';

Expand Down
18 changes: 15 additions & 3 deletions api_docs/apm.devdocs.json
Original file line number Diff line number Diff line change
Expand Up @@ -1242,7 +1242,11 @@
"StringC",
"; transactionType: ",
"StringC",
"; }>, ",
"; durationMin: ",
"Type",
"<number, unknown, unknown>; durationMax: ",
"Type",
"<number, unknown, unknown>; }>, ",
"TypeC",
"<{ environment: ",
"UnionC",
Expand Down Expand Up @@ -1300,7 +1304,11 @@
"StringC",
"; transactionType: ",
"StringC",
"; }>, ",
"; durationMin: ",
"Type",
"<number, unknown, unknown>; durationMax: ",
"Type",
"<number, unknown, unknown>; }>, ",
"TypeC",
"<{ environment: ",
"UnionC",
Expand Down Expand Up @@ -4918,7 +4926,11 @@
"StringC",
", ",
"Type",
"<number, unknown, unknown>]>; }>>; }>, ",
"<number, unknown, unknown>]>; }>>; durationMin: ",
"Type",
"<number, unknown, unknown>; durationMax: ",
"Type",
"<number, unknown, unknown>; }>, ",
"TypeC",
"<{ environment: ",
"UnionC",
Expand Down
9 changes: 6 additions & 3 deletions api_docs/apm.mdx
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
---
####
#### This document is auto-generated and is meant to be viewed inside our experimental, new docs system.
#### Reach out in #docs-engineering for more info.
####
id: kibApmPluginApi
slug: /kibana-dev-docs/api/apm
title: "apm"
image: https://source.unsplash.com/400x175/?github
summary: API docs for the apm plugin
date: 2022-08-10
description: API docs for the apm plugin
date: 2022-08-12
tags: ['contributor', 'dev', 'apidocs', 'kibana', 'apm']
warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info.
---
import apmObj from './apm.devdocs.json';

Expand Down
9 changes: 6 additions & 3 deletions api_docs/banners.mdx
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
---
####
#### This document is auto-generated and is meant to be viewed inside our experimental, new docs system.
#### Reach out in #docs-engineering for more info.
####
id: kibBannersPluginApi
slug: /kibana-dev-docs/api/banners
title: "banners"
image: https://source.unsplash.com/400x175/?github
summary: API docs for the banners plugin
date: 2022-08-10
description: API docs for the banners plugin
date: 2022-08-12
tags: ['contributor', 'dev', 'apidocs', 'kibana', 'banners']
warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info.
---
import bannersObj from './banners.devdocs.json';

Expand Down
9 changes: 6 additions & 3 deletions api_docs/bfetch.mdx
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
---
####
#### This document is auto-generated and is meant to be viewed inside our experimental, new docs system.
#### Reach out in #docs-engineering for more info.
####
id: kibBfetchPluginApi
slug: /kibana-dev-docs/api/bfetch
title: "bfetch"
image: https://source.unsplash.com/400x175/?github
summary: API docs for the bfetch plugin
date: 2022-08-10
description: API docs for the bfetch plugin
date: 2022-08-12
tags: ['contributor', 'dev', 'apidocs', 'kibana', 'bfetch']
warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info.
---
import bfetchObj from './bfetch.devdocs.json';

Expand Down
9 changes: 6 additions & 3 deletions api_docs/canvas.mdx
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
---
####
#### This document is auto-generated and is meant to be viewed inside our experimental, new docs system.
#### Reach out in #docs-engineering for more info.
####
id: kibCanvasPluginApi
slug: /kibana-dev-docs/api/canvas
title: "canvas"
image: https://source.unsplash.com/400x175/?github
summary: API docs for the canvas plugin
date: 2022-08-10
description: API docs for the canvas plugin
date: 2022-08-12
tags: ['contributor', 'dev', 'apidocs', 'kibana', 'canvas']
warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info.
---
import canvasObj from './canvas.devdocs.json';

Expand Down
9 changes: 6 additions & 3 deletions api_docs/cases.mdx
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
---
####
#### This document is auto-generated and is meant to be viewed inside our experimental, new docs system.
#### Reach out in #docs-engineering for more info.
####
id: kibCasesPluginApi
slug: /kibana-dev-docs/api/cases
title: "cases"
image: https://source.unsplash.com/400x175/?github
summary: API docs for the cases plugin
date: 2022-08-10
description: API docs for the cases plugin
date: 2022-08-12
tags: ['contributor', 'dev', 'apidocs', 'kibana', 'cases']
warning: This document is auto-generated and is meant to be viewed inside our experimental, new docs system. Reach out in #docs-engineering for more info.
---
import casesObj from './cases.devdocs.json';

Expand Down
Loading

0 comments on commit 2340f62

Please sign in to comment.