Skip to content

Commit

Permalink
Merge branch 'main' into 135678-unified-field-list-sections-in-discov…
Browse files Browse the repository at this point in the history
…er-2
  • Loading branch information
stratoula authored Nov 30, 2022
2 parents 79ac33b + 1c076ee commit 611b747
Show file tree
Hide file tree
Showing 1,302 changed files with 16,914 additions and 10,632 deletions.
1 change: 0 additions & 1 deletion .buildkite/ftr_configs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ enabled:
- x-pack/test/functional_embedded/config.ts
- x-pack/test/functional_enterprise_search/without_host_configured.config.ts
- x-pack/test/functional_execution_context/config.ts
- 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ export async function pickTestGroupRunOrder() {
label: 'Jest Tests',
command: getRequiredEnv('JEST_UNIT_SCRIPT'),
parallelism: unit.count,
timeout_in_minutes: 90,
timeout_in_minutes: 60,
key: 'jest',
agents: {
queue: 'n2-4-spot',
Expand All @@ -409,7 +409,7 @@ export async function pickTestGroupRunOrder() {
label: 'Jest Integration Tests',
command: getRequiredEnv('JEST_INTEGRATION_SCRIPT'),
parallelism: integration.count,
timeout_in_minutes: 120,
timeout_in_minutes: 60,
key: 'jest-integration',
agents: {
queue: 'n2-4-spot',
Expand Down Expand Up @@ -446,7 +446,7 @@ export async function pickTestGroupRunOrder() {
({ title, key, queue = defaultQueue }): BuildkiteStep => ({
label: title,
command: getRequiredEnv('FTR_CONFIGS_SCRIPT'),
timeout_in_minutes: 150,
timeout_in_minutes: 60,
agents: {
queue,
},
Expand Down
16 changes: 13 additions & 3 deletions .buildkite/scripts/steps/cloud/purge_deployments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,26 @@ for (const deployment of prDeployments) {
const prNumber = deployment.name.match(/^kibana-pr-([0-9]+)$/)[1];
const prJson = execSync(`gh pr view '${prNumber}' --json state,labels,commits`).toString();
const pullRequest = JSON.parse(prJson);
const prOpen = pullRequest.state === 'OPEN';

const lastCommit = pullRequest.commits.slice(-1)[0];
const lastCommitTimestamp = new Date(lastCommit.committedDate).getTime() / 1000;

if (pullRequest.state !== 'OPEN') {
const persistDeployment = Boolean(
pullRequest.labels.filter((label: any) => label.name === 'ci:cloud-persist-deployment').length
);
if (prOpen && persistDeployment) {
continue;
}

if (!prOpen) {
console.log(`Pull Request #${prNumber} is no longer open, will delete associated deployment`);
deploymentsToPurge.push(deployment);
} else if (
!pullRequest.labels.filter((label: any) =>
/^ci:(deploy-cloud|cloud-deploy|cloud-redeploy)$/.test(label.name)
!Boolean(
pullRequest.labels.filter((label: any) =>
/^ci:(cloud-deploy|cloud-redeploy)$/.test(label.name)
).length
)
) {
console.log(
Expand Down
118 changes: 3 additions & 115 deletions .buildkite/scripts/steps/functional/performance_playwright.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,117 +7,13 @@ source .buildkite/scripts/common/util.sh
is_test_execution_step

.buildkite/scripts/bootstrap.sh

# These tests are running on static workers so we have to make sure we delete previous build of Kibana
rm -rf "$KIBANA_BUILD_LOCATION"
.buildkite/scripts/download_build_artifacts.sh

function is_running {
kill -0 "$1" &>/dev/null
}

# unset env vars defined in other parts of CI for automatic APM collection of
# Kibana. We manage APM config in our FTR config and performance service, and
# APM treats config in the ENV with a very high precedence.
unset ELASTIC_APM_ENVIRONMENT
unset ELASTIC_APM_TRANSACTION_SAMPLE_RATE
unset ELASTIC_APM_SERVER_URL
unset ELASTIC_APM_SECRET_TOKEN
unset ELASTIC_APM_ACTIVE
unset ELASTIC_APM_CONTEXT_PROPAGATION_ONLY
unset ELASTIC_APM_ACTIVE
unset ELASTIC_APM_SERVER_URL
unset ELASTIC_APM_SECRET_TOKEN
unset ELASTIC_APM_GLOBAL_LABELS

# `kill $esPid` doesn't work, seems that kbn-es doesn't listen to signals correctly, this does work
trap 'killall node -q' EXIT

export TEST_ES_URL=http://elastic:changeme@localhost:9200
export TEST_ES_DISABLE_STARTUP=true

echo "--- determining which journeys to run"

journeys=$(buildkite-agent meta-data get "failed-journeys" --default '')
if [ "$journeys" != "" ]; then
echo "re-running failed journeys:${journeys}"
else
paths=()
for path in x-pack/performance/journeys/*; do
paths+=("$path")
done
journeys=$(printf "%s\n" "${paths[@]}")
echo "running discovered journeys:${journeys}"
fi

# track failed journeys here which might get written to metadata
failedJourneys=()

while read -r journey; do
if [ "$journey" == "" ]; then
continue;
fi

echo "--- $journey - 🔎 Start es"

node scripts/es snapshot&
export esPid=$!

# Pings the es server every second for up to 2 minutes until it is green
curl \
--fail \
--silent \
--retry 120 \
--retry-delay 1 \
--retry-connrefused \
-XGET "${TEST_ES_URL}/_cluster/health?wait_for_nodes=>=1&wait_for_status=yellow" \
> /dev/null

echo "✅ ES is ready and will run in the background"

phases=("WARMUP" "TEST")
status=0
for phase in "${phases[@]}"; do
echo "--- $journey - $phase"

export TEST_PERFORMANCE_PHASE="$phase"

set +e
node scripts/functional_tests \
--config "$journey" \
--kibana-install-dir "$KIBANA_BUILD_LOCATION" \
--debug \
--bail
status=$?
set -e

if [ $status -ne 0 ]; then
failedJourneys+=("$journey")
echo "^^^ +++"
echo "❌ FTR failed with status code: $status"
break
fi
done

# remove trap, we're manually shutting down
trap - EXIT;

echo "--- $journey - 🔎 Shutdown ES"
killall node
echo "waiting for $esPid to exit gracefully";

timeout=30 #seconds
dur=0
while is_running $esPid; do
sleep 1;
((dur=dur+1))
if [ $dur -ge $timeout ]; then
echo "es still running after $dur seconds, killing ES and node forcefully";
killall -SIGKILL java
killall -SIGKILL node
sleep 5;
fi
done
done <<< "$journeys"
echo "--- Running performance tests"
node scripts/run_performance.js --kibana-install-dir "$KIBANA_BUILD_LOCATION"

echo "--- Upload journey step screenshots"
JOURNEY_SCREENSHOTS_DIR="${KIBANA_DIR}/data/journey_screenshots"
Expand All @@ -126,11 +22,3 @@ if [ -d "$JOURNEY_SCREENSHOTS_DIR" ]; then
buildkite-agent artifact upload "**/*fullscreen*.png"
cd "$KIBANA_DIR"
fi

echo "--- report/record failed journeys"
if [ "${failedJourneys[*]}" != "" ]; then
buildkite-agent meta-data set "failed-journeys" "$(printf "%s\n" "${failedJourneys[@]}")"

echo "failed journeys: ${failedJourneys[*]}"
exit 1
fi
1 change: 0 additions & 1 deletion .buildkite/scripts/steps/storybooks/build_and_upload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ const STORYBOOKS = [
'expression_reveal_image',
'expression_shape',
'expression_tagcloud',
'files',
'fleet',
'home',
'infra',
Expand Down
8 changes: 6 additions & 2 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@
/x-pack/test/fleet_api_integration @elastic/fleet
/x-pack/test/fleet_cypress @elastic/fleet
/x-pack/test/fleet_functional @elastic/fleet
/src/dev/build/tasks/bundle_fleet_packages.ts
/src/dev/build/tasks/bundle_fleet_packages.ts @elastic/fleet @elastic/kibana-operations

# APM
/x-pack/plugins/apm/ @elastic/apm-ui
Expand Down Expand Up @@ -1029,9 +1029,13 @@ packages/shared-ux/button/exit_full_screen/types @elastic/kibana-global-experien
packages/shared-ux/card/no_data/impl @elastic/kibana-global-experience
packages/shared-ux/card/no_data/mocks @elastic/kibana-global-experience
packages/shared-ux/card/no_data/types @elastic/kibana-global-experience
packages/shared-ux/file/context @elastic/kibana-global-experience
packages/shared-ux/file/file_picker/impl @elastic/kibana-global-experience
packages/shared-ux/file/file_upload/impl @elastic/kibana-global-experience
packages/shared-ux/file/image/impl @elastic/kibana-global-experience
packages/shared-ux/file/image/mocks @elastic/kibana-global-experience
packages/shared-ux/file/image/types @elastic/kibana-global-experience
packages/shared-ux/file/mocks @elastic/kibana-global-experience
packages/shared-ux/file/types @elastic/kibana-global-experience
packages/shared-ux/file/util @elastic/kibana-global-experience
packages/shared-ux/link/redirect_app/impl @elastic/kibana-global-experience
packages/shared-ux/link/redirect_app/mocks @elastic/kibana-global-experience
Expand Down
2 changes: 1 addition & 1 deletion api_docs/actions.devdocs.json
Original file line number Diff line number Diff line change
Expand Up @@ -1967,7 +1967,7 @@
},
"<",
"ActionTypeConfig",
">[]>; getOAuthAccessToken: ({ type, options }: Readonly<{} & { options: Readonly<{} & { config: Readonly<{} & { clientId: string; jwtKeyId: string; userIdentifierValue: string; }>; tokenUrl: string; secrets: Readonly<{ privateKeyPassword?: string | undefined; } & { clientSecret: string; privateKey: string; }>; }> | Readonly<{} & { scope: string; config: Readonly<{} & { clientId: string; tenantId: string; }>; tokenUrl: string; secrets: Readonly<{} & { clientSecret: string; }>; }>; type: \"client\" | \"jwt\"; }>, configurationUtilities: ",
">[]>; getOAuthAccessToken: ({ type, options }: Readonly<{} & { options: Readonly<{} & { config: Readonly<{} & { clientId: string; jwtKeyId: string; userIdentifierValue: string; }>; tokenUrl: string; secrets: Readonly<{ privateKeyPassword?: string | undefined; } & { clientSecret: string; privateKey: string; }>; }> | Readonly<{} & { scope: string; config: Readonly<{} & { clientId: string; tenantId: string; }>; tokenUrl: string; secrets: Readonly<{} & { clientSecret: string; }>; }>; type: \"jwt\" | \"client\"; }>, configurationUtilities: ",
"ActionsConfigurationUtilities",
") => Promise<{ accessToken: string | null; }>; enqueueExecution: (options: ",
"ExecuteOptions",
Expand Down
2 changes: 1 addition & 1 deletion api_docs/actions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/actions
title: "actions"
image: https://source.unsplash.com/400x175/?github
description: API docs for the actions plugin
date: 2022-11-28
date: 2022-11-30
tags: ['contributor', 'dev', 'apidocs', 'kibana', 'actions']
---
import actionsObj from './actions.devdocs.json';
Expand Down
2 changes: 1 addition & 1 deletion api_docs/advanced_settings.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/advancedSettings
title: "advancedSettings"
image: https://source.unsplash.com/400x175/?github
description: API docs for the advancedSettings plugin
date: 2022-11-28
date: 2022-11-30
tags: ['contributor', 'dev', 'apidocs', 'kibana', 'advancedSettings']
---
import advancedSettingsObj from './advanced_settings.devdocs.json';
Expand Down
2 changes: 1 addition & 1 deletion api_docs/aiops.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/aiops
title: "aiops"
image: https://source.unsplash.com/400x175/?github
description: API docs for the aiops plugin
date: 2022-11-28
date: 2022-11-30
tags: ['contributor', 'dev', 'apidocs', 'kibana', 'aiops']
---
import aiopsObj from './aiops.devdocs.json';
Expand Down
56 changes: 50 additions & 6 deletions api_docs/alerting.devdocs.json
Original file line number Diff line number Diff line change
Expand Up @@ -3010,7 +3010,7 @@
"section": "def-common.SanitizedRule",
"text": "SanitizedRule"
},
"<Params>>; muteAll: ({ id }: { id: string; }) => Promise<void>; getAlertState: ({ id }: { id: string; }) => Promise<void | { alertTypeState?: { [x: string]: unknown; } | undefined; alertInstances?: { [x: string]: { state?: { [x: string]: unknown; } | undefined; meta?: { lastScheduledActions?: ({ subgroup?: string | undefined; } & { group: string; date: Date; }) | undefined; } | undefined; }; } | undefined; previousStartedAt?: Date | null | undefined; }>; getAlertSummary: ({ id, dateStart, numberOfExecutions, }: ",
"<Params>>; muteAll: ({ id }: { id: string; }) => Promise<void>; getAlertState: ({ id }: { id: string; }) => Promise<void | { alertTypeState?: { [x: string]: unknown; } | undefined; alertInstances?: { [x: string]: { state?: { [x: string]: unknown; } | undefined; meta?: { lastScheduledActions?: ({ subgroup?: string | undefined; } & { group: string; date: Date; }) | undefined; flappingHistory?: boolean[] | undefined; flapping?: boolean | undefined; } | undefined; }; } | undefined; alertRecoveredInstances?: { [x: string]: { state?: { [x: string]: unknown; } | undefined; meta?: { lastScheduledActions?: ({ subgroup?: string | undefined; } & { group: string; date: Date; }) | undefined; flappingHistory?: boolean[] | undefined; flapping?: boolean | undefined; } | undefined; }; } | undefined; previousStartedAt?: Date | null | undefined; }>; getAlertSummary: ({ id, dateStart, numberOfExecutions, }: ",
"GetAlertSummaryParams",
") => Promise<",
{
Expand Down Expand Up @@ -6522,7 +6522,7 @@
"label": "AlertInstanceMeta",
"description": [],
"signature": [
"{ lastScheduledActions?: ({ subgroup?: string | undefined; } & { group: string; date: Date; }) | undefined; }"
"{ lastScheduledActions?: ({ subgroup?: string | undefined; } & { group: string; date: Date; }) | undefined; flappingHistory?: boolean[] | undefined; flapping?: boolean | undefined; }"
],
"path": "x-pack/plugins/alerting/common/alert_instance.ts",
"deprecated": false,
Expand Down Expand Up @@ -6716,7 +6716,7 @@
"label": "RawAlertInstance",
"description": [],
"signature": [
"{ state?: { [x: string]: unknown; } | undefined; meta?: { lastScheduledActions?: ({ subgroup?: string | undefined; } & { group: string; date: Date; }) | undefined; } | undefined; }"
"{ state?: { [x: string]: unknown; } | undefined; meta?: { lastScheduledActions?: ({ subgroup?: string | undefined; } & { group: string; date: Date; }) | undefined; flappingHistory?: boolean[] | undefined; flapping?: boolean | undefined; } | undefined; }"
],
"path": "x-pack/plugins/alerting/common/alert_instance.ts",
"deprecated": false,
Expand Down Expand Up @@ -6976,7 +6976,7 @@
"label": "RuleTaskState",
"description": [],
"signature": [
"{ alertTypeState?: { [x: string]: unknown; } | undefined; alertInstances?: { [x: string]: { state?: { [x: string]: unknown; } | undefined; meta?: { lastScheduledActions?: ({ subgroup?: string | undefined; } & { group: string; date: Date; }) | undefined; } | undefined; }; } | undefined; previousStartedAt?: Date | null | undefined; }"
"{ alertTypeState?: { [x: string]: unknown; } | undefined; alertInstances?: { [x: string]: { state?: { [x: string]: unknown; } | undefined; meta?: { lastScheduledActions?: ({ subgroup?: string | undefined; } & { group: string; date: Date; }) | undefined; flappingHistory?: boolean[] | undefined; flapping?: boolean | undefined; } | undefined; }; } | undefined; alertRecoveredInstances?: { [x: string]: { state?: { [x: string]: unknown; } | undefined; meta?: { lastScheduledActions?: ({ subgroup?: string | undefined; } & { group: string; date: Date; }) | undefined; flappingHistory?: boolean[] | undefined; flapping?: boolean | undefined; } | undefined; }; } | undefined; previousStartedAt?: Date | null | undefined; }"
],
"path": "x-pack/plugins/alerting/common/rule_task_instance.ts",
"deprecated": false,
Expand Down Expand Up @@ -7304,7 +7304,13 @@
"StringC",
"; date: ",
"Type",
"<Date, string, unknown>; }>]>; }>; }>"
"<Date, string, unknown>; }>]>; flappingHistory: ",
"ArrayC",
"<",
"BooleanC",
">; flapping: ",
"BooleanC",
"; }>; }>"
],
"path": "x-pack/plugins/alerting/common/alert_instance.ts",
"deprecated": false,
Expand Down Expand Up @@ -7436,7 +7442,45 @@
"StringC",
"; date: ",
"Type",
"<Date, string, unknown>; }>]>; }>; }>>; previousStartedAt: ",
"<Date, string, unknown>; }>]>; flappingHistory: ",
"ArrayC",
"<",
"BooleanC",
">; flapping: ",
"BooleanC",
"; }>; }>>; alertRecoveredInstances: ",
"RecordC",
"<",
"StringC",
", ",
"PartialC",
"<{ state: ",
"RecordC",
"<",
"StringC",
", ",
"UnknownC",
">; meta: ",
"PartialC",
"<{ lastScheduledActions: ",
"IntersectionC",
"<[",
"PartialC",
"<{ subgroup: ",
"StringC",
"; }>, ",
"TypeC",
"<{ group: ",
"StringC",
"; date: ",
"Type",
"<Date, string, unknown>; }>]>; flappingHistory: ",
"ArrayC",
"<",
"BooleanC",
">; flapping: ",
"BooleanC",
"; }>; }>>; previousStartedAt: ",
"UnionC",
"<[",
"NullC",
Expand Down
2 changes: 1 addition & 1 deletion api_docs/alerting.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/alerting
title: "alerting"
image: https://source.unsplash.com/400x175/?github
description: API docs for the alerting plugin
date: 2022-11-28
date: 2022-11-30
tags: ['contributor', 'dev', 'apidocs', 'kibana', 'alerting']
---
import alertingObj from './alerting.devdocs.json';
Expand Down
2 changes: 1 addition & 1 deletion api_docs/apm.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/apm
title: "apm"
image: https://source.unsplash.com/400x175/?github
description: API docs for the apm plugin
date: 2022-11-28
date: 2022-11-30
tags: ['contributor', 'dev', 'apidocs', 'kibana', 'apm']
---
import apmObj from './apm.devdocs.json';
Expand Down
2 changes: 1 addition & 1 deletion api_docs/banners.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/banners
title: "banners"
image: https://source.unsplash.com/400x175/?github
description: API docs for the banners plugin
date: 2022-11-28
date: 2022-11-30
tags: ['contributor', 'dev', 'apidocs', 'kibana', 'banners']
---
import bannersObj from './banners.devdocs.json';
Expand Down
2 changes: 1 addition & 1 deletion api_docs/bfetch.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ slug: /kibana-dev-docs/api/bfetch
title: "bfetch"
image: https://source.unsplash.com/400x175/?github
description: API docs for the bfetch plugin
date: 2022-11-28
date: 2022-11-30
tags: ['contributor', 'dev', 'apidocs', 'kibana', 'bfetch']
---
import bfetchObj from './bfetch.devdocs.json';
Expand Down
Loading

0 comments on commit 611b747

Please sign in to comment.