Skip to content

Commit fabd313

Browse files
authored
Merge branch 'main' into esql-enrich-app-connection
2 parents ee6512c + 94bd19d commit fabd313

1,418 files changed

Lines changed: 22079 additions & 6732 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# https://buildkite.com/elastic/kibana-elasticsearch-serverless-verify-and-promote/
2+
agents:
3+
queue: kibana-default
4+
5+
steps:
6+
- label: "Annotate runtime parameters"
7+
command: |
8+
buildkite-agent annotate --context es-serverless-image --style info "ES Serverless image: $ES_SERVERLESS_IMAGE"
9+
buildkite-agent annotate --context kibana-commit --style info "Kibana build hash: $BUILDKITE_BRANCH / $BUILDKITE_COMMIT"
10+
11+
- group: "(:kibana: x :elastic:) Trigger Kibana Serverless suite"
12+
if: "build.env('SKIP_VERIFICATION') != '1' && build.env('SKIP_VERIFICATION') != 'true'"
13+
steps:
14+
- label: "Pre-Build"
15+
command: .buildkite/scripts/lifecycle/pre_build.sh
16+
key: pre-build
17+
timeout_in_minutes: 10
18+
agents:
19+
queue: kibana-default
20+
21+
- label: "Build Kibana Distribution and Plugins"
22+
command: .buildkite/scripts/steps/build_kibana.sh
23+
agents:
24+
queue: n2-16-spot
25+
key: build
26+
depends_on: pre-build
27+
if: "build.env('KIBANA_BUILD_ID') == null || build.env('KIBANA_BUILD_ID') == ''"
28+
timeout_in_minutes: 60
29+
retry:
30+
automatic:
31+
- exit_status: '-1'
32+
limit: 3
33+
34+
- label: "Pick Test Group Run Order"
35+
command: .buildkite/scripts/steps/test/pick_test_group_run_order.sh
36+
agents:
37+
queue: kibana-default
38+
env:
39+
FTR_CONFIGS_SCRIPT: 'TEST_ES_SERVERLESS_IMAGE=$ES_SERVERLESS_IMAGE .buildkite/scripts/steps/test/ftr_configs.sh'
40+
FTR_CONFIG_PATTERNS: '**/test_serverless/**'
41+
LIMIT_CONFIG_TYPE: 'functional'
42+
retry:
43+
automatic:
44+
- exit_status: '*'
45+
limit: 1
46+
47+
- wait: ~
48+
49+
- label: ":arrow_up::elastic::arrow_up: Promote docker image"
50+
command: .buildkite/scripts/steps/es_serverless/promote_es_serverless_image.sh $ES_SERVERLESS_IMAGE
51+
52+
- wait: ~
53+
54+
- label: 'Post-Build'
55+
command: .buildkite/scripts/lifecycle/post_build.sh
56+
timeout_in_minutes: 10
57+
agents:
58+
queue: kibana-default

.buildkite/pipelines/on_merge.yml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -154,15 +154,16 @@ steps:
154154
- exit_status: '-1'
155155
limit: 3
156156

157-
- command: .buildkite/scripts/steps/check_types.sh
158-
label: 'Check Types'
159-
agents:
160-
queue: n2-16-spot
161-
timeout_in_minutes: 60
162-
retry:
163-
automatic:
164-
- exit_status: '-1'
165-
limit: 3
157+
# TODO: Enable in #166813 after fixing types
158+
# - command: .buildkite/scripts/steps/check_types.sh
159+
# label: 'Check Types'
160+
# agents:
161+
# queue: n2-16-spot
162+
# timeout_in_minutes: 60
163+
# retry:
164+
# automatic:
165+
# - exit_status: '-1'
166+
# limit: 3
166167

167168
- command: .buildkite/scripts/steps/storybooks/build_and_upload.sh
168169
label: 'Build Storybooks'

.buildkite/pipelines/pull_request/base.yml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -136,12 +136,13 @@ steps:
136136
- exit_status: '-1'
137137
limit: 3
138138

139-
- command: .buildkite/scripts/steps/check_types.sh
140-
label: 'Check Types'
141-
agents:
142-
queue: n2-16-spot
143-
timeout_in_minutes: 60
144-
retry:
145-
automatic:
146-
- exit_status: '-1'
147-
limit: 3
139+
# TODO: Enable in #166813 after fixing types
140+
# - command: .buildkite/scripts/steps/check_types.sh
141+
# label: 'Check Types'
142+
# agents:
143+
# queue: n2-16-spot
144+
# timeout_in_minutes: 60
145+
# retry:
146+
# automatic:
147+
# - exit_status: '-1'
148+
# limit: 3
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
steps:
2+
- command: .buildkite/scripts/steps/check_types.sh
3+
label: 'Check Types'
4+
agents:
5+
queue: n2-16-spot
6+
timeout_in_minutes: 60
7+
retry:
8+
automatic:
9+
- exit_status: '-1'
10+
limit: 3
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
steps:
2+
- command: .buildkite/scripts/steps/check_types_commits.sh
3+
label: 'Check Types Commit Diff'
4+
agents:
5+
queue: n2-16-spot
6+
timeout_in_minutes: 60
7+
retry:
8+
automatic:
9+
- exit_status: '-1'
10+
limit: 3

.buildkite/scripts/pipelines/pull_request/pipeline.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,12 @@ const uploadPipeline = (pipelineContent: string | object) => {
5959
pipeline.push(getPipeline('.buildkite/pipelines/pull_request/kbn_handlebars.yml'));
6060
}
6161

62+
if (GITHUB_PR_LABELS.includes('ci:hard-typecheck')) {
63+
pipeline.push(getPipeline('.buildkite/pipelines/pull_request/type_check.yml'));
64+
} else {
65+
pipeline.push(getPipeline('.buildkite/pipelines/pull_request/type_check_selective.yml'));
66+
}
67+
6268
if (
6369
(await doAnyChangesMatch([
6470
/^src\/plugins\/controls/,

.buildkite/scripts/steps/build_api_docs.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ set -euo pipefail
44

55
.buildkite/scripts/bootstrap.sh
66

7-
echo "--- Run scripts/type_check to ensure that all build available"
8-
node scripts/type_check
7+
# TODO: Enable in #166813 after fixing types
8+
# echo "--- Run scripts/type_check to ensure that all build available"
9+
# node scripts/type_check
910

1011
echo "--- Build API Docs"
1112
node --max-old-space-size=12000 scripts/build_api_docs
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
5+
6+
if [[ "${CI-}" == "true" ]]; then
7+
.buildkite/scripts/bootstrap.sh
8+
9+
sha1=$(git merge-base $GITHUB_PR_TARGET_BRANCH $GITHUB_PR_TRIGGERED_SHA)
10+
sha2="${GITHUB_PR_TRIGGERED_SHA-}"
11+
else
12+
if [[ "${1-}" == "--cached" ]]; then
13+
# Only check staged files
14+
sha1=$1
15+
sha2=""
16+
else
17+
# Script take between 0 and 2 arguments representing two commit SHA's:
18+
# If 0, it will diff HEAD and HEAD^
19+
# If 1 (SHA1), it will diff SHA1 and SHA1^
20+
# If 2 (SHA1, SHA2), it will diff SHA1 and SHA2
21+
sha1="${1-HEAD}"
22+
sha2="${2-$sha1^}"
23+
fi
24+
fi
25+
26+
uniq_dirs=()
27+
uniq_tsconfigs=()
28+
29+
if [[ "$sha1" == "--cached" ]]; then
30+
echo "Detecting files changed in staging area..."
31+
else
32+
echo "Detecting files changed between $sha1 and $sha2..."
33+
fi
34+
35+
files=($(git diff --name-only $sha1 $sha2))
36+
37+
add_dir () {
38+
new_dir=$1
39+
40+
if [ ${#uniq_dirs[@]} -gt 0 ]; then
41+
for dir in "${uniq_dirs[@]}"
42+
do
43+
if [[ "$new_dir" == "$dir" ]]; then
44+
return
45+
fi
46+
done
47+
fi
48+
49+
uniq_dirs+=($new_dir)
50+
}
51+
52+
add_tsconfig () {
53+
new_tsconfig=$1
54+
55+
if [ ${#uniq_tsconfigs[@]} -gt 0 ]; then
56+
for tsconfig in "${uniq_tsconfigs[@]}"
57+
do
58+
if [[ "$new_tsconfig" == "$tsconfig" ]]; then
59+
return
60+
fi
61+
done
62+
fi
63+
64+
echo " $new_tsconfig"
65+
uniq_tsconfigs+=($new_tsconfig)
66+
}
67+
68+
contains_tsconfig () {
69+
dir=$1
70+
tsconfig="$dir/tsconfig.json"
71+
if [ -f "$tsconfig" ]; then
72+
true
73+
else
74+
false
75+
fi
76+
}
77+
78+
find_tsconfig () {
79+
dir=$1
80+
81+
if [[ "$dir" == "." ]]; then
82+
return
83+
fi
84+
85+
if contains_tsconfig $dir; then
86+
add_tsconfig "$dir/tsconfig.json"
87+
else
88+
find_tsconfig $(dirname -- "$dir")
89+
fi
90+
}
91+
92+
if [ ${#files[@]} -eq 0 ]; then
93+
echo "No files found!"
94+
exit
95+
fi
96+
97+
for file in "${files[@]}"
98+
do
99+
dir=$(dirname -- "$file")
100+
101+
# Ignore buildkite dir because it traverses many kbn packages and emits incorrect results
102+
if [[ "$dir" != .buildkite* ]]; then
103+
add_dir $dir
104+
fi
105+
done
106+
107+
echo "Looking for related tsconfig.json files..."
108+
109+
for dir in "${uniq_dirs[@]}"
110+
do
111+
find_tsconfig $dir
112+
done
113+
114+
if [ ${#uniq_tsconfigs[@]} -eq 0 ]; then
115+
if [[ "$sha1" == "--cached" ]]; then
116+
echo "No tsconfig.json files found for staged changes"
117+
else
118+
echo "No tsconfig.json files found for changes between $sha1 and $sha2"
119+
fi
120+
exit
121+
fi
122+
123+
echo "Running scripts/type_check for each found tsconfig.json file..."
124+
125+
for tsconfig in "${uniq_tsconfigs[@]}"
126+
do
127+
node scripts/type_check --project $tsconfig
128+
done
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
#!/bin/bash
2+
3+
set -euo pipefail
4+
5+
source .buildkite/scripts/common/util.sh
6+
7+
BASE_ES_SERVERLESS_REPO=docker.elastic.co/elasticsearch-ci/elasticsearch-serverless
8+
TARGET_IMAGE=docker.elastic.co/kibana-ci/elasticsearch-serverless:latest-verified
9+
10+
ES_SERVERLESS_BUCKET=kibana-ci-es-serverless-images
11+
MANIFEST_FILE_NAME=latest-verified.json
12+
13+
SOURCE_IMAGE_OR_TAG=$1
14+
if [[ $SOURCE_IMAGE_OR_TAG =~ :[a-zA-Z_-]+$ ]]; then
15+
# $SOURCE_IMAGE_OR_TAG was a full image
16+
SOURCE_IMAGE=$SOURCE_IMAGE_OR_TAG
17+
else
18+
# $SOURCE_IMAGE_OR_TAG was an image tag
19+
SOURCE_IMAGE="$BASE_ES_SERVERLESS_REPO:$SOURCE_IMAGE_OR_TAG"
20+
fi
21+
22+
echo "--- Promoting ${SOURCE_IMAGE_OR_TAG} to ':latest-verified'"
23+
24+
echo "Re-tagging $SOURCE_IMAGE -> $TARGET_IMAGE"
25+
26+
echo "$KIBANA_DOCKER_PASSWORD" | docker login -u "$KIBANA_DOCKER_USERNAME" --password-stdin docker.elastic.co
27+
docker pull "$SOURCE_IMAGE"
28+
docker tag "$SOURCE_IMAGE" "$TARGET_IMAGE"
29+
docker push "$TARGET_IMAGE"
30+
31+
ORIG_IMG_DATA=$(docker inspect "$SOURCE_IMAGE")
32+
ELASTIC_COMMIT_HASH=$(echo $ORIG_IMG_DATA | jq -r '.[].Config.Labels["org.opencontainers.image.revision"]')
33+
34+
docker logout docker.elastic.co
35+
36+
echo "Image push to $TARGET_IMAGE successful."
37+
echo "Promotion successful! Henceforth, thou shall be named Sir $TARGET_IMAGE"
38+
39+
MANIFEST_UPLOAD_PATH="Skipped"
40+
if [[ "$UPLOAD_MANIFEST" =~ ^(1|true)$ && "$SOURCE_IMAGE_OR_TAG" =~ ^git-[0-9a-fA-F]{12}$ ]]; then
41+
echo "--- Uploading latest-verified manifest to GCS"
42+
cat << EOT >> $MANIFEST_FILE_NAME
43+
{
44+
"build_url": "$BUILDKITE_BUILD_URL",
45+
"kibana_commit": "$BUILDKITE_COMMIT",
46+
"kibana_branch": "$BUILDKITE_BRANCH",
47+
"elasticsearch_serverless_tag": "$SOURCE_IMAGE_OR_TAG",
48+
"elasticsearch_serverless_image_url: "$SOURCE_IMAGE",
49+
"elasticsearch_serverless_commit": "TODO: this currently can't be decided",
50+
"elasticsearch_commit": "$ELASTIC_COMMIT_HASH",
51+
"created_at": "`date`",
52+
"timestamp": "`FORCE_COLOR=0 node -p 'Date.now()'`"
53+
}
54+
EOT
55+
56+
gsutil -h "Cache-Control:no-cache, max-age=0, no-transform" \
57+
cp $MANIFEST_FILE_NAME "gs://$ES_SERVERLESS_BUCKET/$MANIFEST_FILE_NAME"
58+
gsutil acl ch -u AllUsers:R "gs://$ES_SERVERLESS_BUCKET/$MANIFEST_FILE_NAME"
59+
MANIFEST_UPLOAD_PATH="<a href=\"https://storage.googleapis.com/$ES_SERVERLESS_BUCKET/$MANIFEST_FILE_NAME\">$MANIFEST_FILE_NAME</a>"
60+
61+
elif [[ "$UPLOAD_MANIFEST" =~ ^(1|true)$ ]]; then
62+
echo "--- Skipping upload of latest-verified manifest to GCS, ES Serverless build tag is not pointing to a hash"
63+
elif [[ "$SOURCE_IMAGE_OR_TAG" =~ ^git-[0-9a-fA-F]{12}$ ]]; then
64+
echo "--- Skipping upload of latest-verified manifest to GCS, flag was not provided"
65+
fi
66+
67+
echo "--- Annotating build with info"
68+
cat << EOT | buildkite-agent annotate --style "success"
69+
<h2>Promotion successful!</h2>
70+
<br/>New image: $TARGET_IMAGE
71+
<br/>Source image: $SOURCE_IMAGE
72+
<br/>Kibana commit: <a href="https://github.com/elastic/kibana/commit/$BUILDKITE_COMMIT">$BUILDKITE_COMMIT</a>
73+
<br/>Elasticsearch commit: <a href="https://github.com/elastic/elasticsearch/commit/$ELASTIC_COMMIT_HASH">$ELASTIC_COMMIT_HASH</a>
74+
<br/>Manifest file: $MANIFEST_UPLOAD_PATH
75+
EOT

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -484,6 +484,7 @@ packages/kbn-management/cards_navigation @elastic/platform-deployment-management
484484
src/plugins/management @elastic/platform-deployment-management
485485
packages/kbn-management/settings/components/field_input @elastic/platform-deployment-management
486486
packages/kbn-management/settings/components/field_row @elastic/platform-deployment-management
487+
packages/kbn-management/settings/components/form @elastic/platform-deployment-management
487488
packages/kbn-management/settings/field_definition @elastic/platform-deployment-management
488489
packages/kbn-management/settings/setting_ids @elastic/appex-sharedux @elastic/platform-deployment-management
489490
packages/kbn-management/settings/section_registry @elastic/appex-sharedux @elastic/platform-deployment-management

0 commit comments

Comments
 (0)