Skip to content

Commit

Permalink
Merge branch 'main' into buffer-lines-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
marshallmain authored Sep 30, 2024
2 parents 35b5773 + 0dada14 commit 6172ebe
Show file tree
Hide file tree
Showing 6,048 changed files with 256,879 additions and 103,968 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
5 changes: 3 additions & 2 deletions .buildkite/ftr_platform_stateful_configs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ enabled:
- test/api_integration/config.js
- test/examples/config.js
- test/functional/apps/bundles/config.ts
- test/functional/apps/console/monaco/config.ts
- test/functional/apps/console/ace/config.ts
- test/functional/apps/console/config.ts
- test/functional/apps/context/config.ts
- test/functional/apps/dashboard_elements/controls/common/config.ts
- test/functional/apps/dashboard_elements/controls/options_list/config.ts
Expand Down Expand Up @@ -352,6 +351,8 @@ enabled:
- x-pack/performance/journeys_e2e/tsdb_logs_data_visualizer.ts
- x-pack/performance/journeys_e2e/promotion_tracking_dashboard.ts
- x-pack/performance/journeys_e2e/web_logs_dashboard.ts
- x-pack/performance/journeys_e2e/web_logs_dashboard_esql.ts
- x-pack/performance/journeys_e2e/web_logs_dashboard_dataview.ts
- x-pack/performance/journeys_e2e/data_stress_test_lens.ts
- x-pack/performance/journeys_e2e/ecommerce_dashboard_saved_search_only.ts
- x-pack/performance/journeys_e2e/ecommerce_dashboard_tsvb_gauge_only.ts
Expand Down
1 change: 1 addition & 0 deletions .buildkite/ftr_security_serverless_configs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ enabled:
- x-pack/test/security_solution_api_integration/test_suites/genai/knowledge_base/entries/trial_license_complete_tier/configs/serverless.config.ts
- x-pack/test/security_solution_api_integration/test_suites/entity_analytics/risk_engine/trial_license_complete_tier/configs/serverless.config.ts
- x-pack/test/security_solution_api_integration/test_suites/entity_analytics/risk_engine/basic_license_essentials_tier/configs/serverless.config.ts
- x-pack/test/security_solution_api_integration/test_suites/entity_analytics/entity_store/trial_license_complete_tier/configs/serverless.config.ts
- x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/exception_lists_items/trial_license_complete_tier/configs/serverless.config.ts
- x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/lists_items/trial_license_complete_tier/configs/serverless.config.ts
- x-pack/test/security_solution_api_integration/test_suites/explore/hosts/trial_license_complete_tier/configs/serverless.config.ts
Expand Down
1 change: 1 addition & 0 deletions .buildkite/ftr_security_stateful_configs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ enabled:
- x-pack/test/security_solution_api_integration/test_suites/detections_response/user_roles/trial_license_complete_tier/configs/ess.config.ts
- x-pack/test/security_solution_api_integration/test_suites/entity_analytics/risk_engine/trial_license_complete_tier/configs/ess.config.ts
- x-pack/test/security_solution_api_integration/test_suites/entity_analytics/risk_engine/basic_license_essentials_tier/configs/ess.config.ts
- x-pack/test/security_solution_api_integration/test_suites/entity_analytics/entity_store/trial_license_complete_tier/configs/ess.config.ts
- x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/exception_lists_items/trial_license_complete_tier/configs/ess.config.ts
- x-pack/test/security_solution_api_integration/test_suites/lists_and_exception_lists/lists_items/trial_license_complete_tier/configs/ess.config.ts
- x-pack/test/security_solution_api_integration/test_suites/explore/hosts/trial_license_complete_tier/configs/ess.config.ts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,13 @@ async function main() {

const preamble = locationFileLines.slice(0, 1);

// eslint-disable-next-line @kbn/eslint/no_unsafe_js_yaml
const locationObj = jsYaml.load(
locationFileLines.slice(1).join('\n')
) as BackstageLocationResource;
locationObj.spec.targets = pipelines.map(
(fileName) => `${resourceDefinitionsBaseUrl}/${fileName}`
);

// eslint-disable-next-line @kbn/eslint/no_unsafe_js_yaml
const locationYaml = jsYaml.dump(locationObj, { lineWidth: 400 });

fs.writeFileSync(locationFile, `${preamble.join('\n')}\n${locationYaml}`);
Expand Down
1 change: 0 additions & 1 deletion .buildkite/pipeline-utils/agent_images.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/

// eslint-disable-next-line @kbn/eslint/no_unsafe_js_yaml
import { dump } from 'js-yaml';
import { BuildkiteClient, BuildkiteCommandStep } from './buildkite';

Expand Down
1 change: 0 additions & 1 deletion .buildkite/pipeline-utils/buildkite/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import axios, { AxiosInstance } from 'axios';
import { execSync, ExecSyncOptions } from 'child_process';

// eslint-disable-next-line @kbn/eslint/no_unsafe_js_yaml
import { dump } from 'js-yaml';

import { parseLinkHeader } from './parse_link_header';
Expand Down
33 changes: 30 additions & 3 deletions .buildkite/pipeline-utils/ci-stats/pick_test_group_run_order.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import * as Fs from 'fs';
import * as globby from 'globby';
import minimatch from 'minimatch';

// eslint-disable-next-line @kbn/eslint/no_unsafe_js_yaml
import { load as loadYaml } from 'js-yaml';

import { BuildkiteClient, BuildkiteStep } from '../buildkite';
Expand Down Expand Up @@ -197,6 +196,32 @@ function getEnabledFtrConfigs(patterns?: string[]) {
}
}

/**
* Collects environment variables from labels on the PR
* TODO: extract this (and other functions from this big file) to a separate module
*/
function collectEnvFromLabels() {
const LABEL_MAPPING: Record<string, Record<string, string>> = {
'ci:use-chrome-beta': {
USE_CHROME_BETA: 'true',
},
};

const envFromlabels: Record<string, string> = {};
if (!process.env.GITHUB_PR_LABELS) {
return envFromlabels;
} else {
const labels = process.env.GITHUB_PR_LABELS.split(',');
labels.forEach((label) => {
const env = LABEL_MAPPING[label];
if (env) {
Object.assign(envFromlabels, env);
}
});
return envFromlabels;
}
}

export async function pickTestGroupRunOrder() {
const bk = new BuildkiteClient();
const ciStats = new CiStatsClient();
Expand Down Expand Up @@ -273,9 +298,10 @@ export async function pickTestGroupRunOrder() {
.filter(Boolean)
: ['build'];

const FTR_EXTRA_ARGS: Record<string, string> = process.env.FTR_EXTRA_ARGS
const ftrExtraArgs: Record<string, string> = process.env.FTR_EXTRA_ARGS
? { FTR_EXTRA_ARGS: process.env.FTR_EXTRA_ARGS }
: {};
const envFromlabels: Record<string, string> = collectEnvFromLabels();

const { defaultQueue, ftrConfigsByQueue } = getEnabledFtrConfigs(FTR_CONFIG_PATTERNS);

Expand Down Expand Up @@ -514,7 +540,8 @@ export async function pickTestGroupRunOrder() {
agents: expandAgentQueue(queue),
env: {
FTR_CONFIG_GROUP_KEY: key,
...FTR_EXTRA_ARGS,
...ftrExtraArgs,
...envFromlabels,
},
retry: {
automatic: [
Expand Down
1 change: 1 addition & 0 deletions .buildkite/pull_requests.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"enabled": true,
"allow_org_users": true,
"allowed_repo_permissions": ["admin", "write"],
"allowed_list": ["elastic-vault-github-plugin-prod[bot]"],
"set_commit_status": true,
"commit_status_context": "kibana-ci",
"build_on_commit": true,
Expand Down
1 change: 0 additions & 1 deletion .buildkite/scripts/steps/artifacts/cloud.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ jq '
.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"

Expand Down
6 changes: 3 additions & 3 deletions .buildkite/scripts/steps/artifacts/docker_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,15 @@ steps:
env:
CONTAINER: "$KIBANA_IMAGE"
soft_fail: true
- label: ":argo: Update kibana image tag for kibana-controller using gpctl"
- label: ":serverless::argo: Run synthetics tests and update kibana image tag to ${GIT_ABBREV_COMMIT} for kibana-controller"
branches: main
trigger: gpctl-promote-with-e2e-tests
trigger: gpctl-promote-after-serverless-devenv-synthetics
build:
env:
SERVICE_COMMIT_HASH: "$GIT_ABBREV_COMMIT"
SERVICE: kibana
REMOTE_SERVICE_CONFIG: https://raw.githubusercontent.com/elastic/serverless-gitops/main/gen/gpctl/kibana/dev.yaml
DRY_RUN: "${DRY_RUN:-false}"
GPCTL_PROMOTE_DRY_RUN: ${DRY_RUN:-false}
EOF

else
Expand Down
1 change: 0 additions & 1 deletion .buildkite/scripts/steps/cloud/build_and_deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ if [ -z "${CLOUD_DEPLOYMENT_ID}" ] || [ "${CLOUD_DEPLOYMENT_ID}" = 'null' ]; the
.name = "'$CLOUD_DEPLOYMENT_NAME'" |
.resources.kibana[0].plan.kibana.version = "'$VERSION'" |
.resources.elasticsearch[0].plan.elasticsearch.version = "'$VERSION'" |
.resources.enterprise_search[0].plan.enterprise_search.version = "'$VERSION'" |
.resources.integrations_server[0].plan.integrations_server.version = "'$VERSION'"
' .buildkite/scripts/steps/cloud/deploy.json > /tmp/deploy.json

Expand Down
27 changes: 0 additions & 27 deletions .buildkite/scripts/steps/cloud/deploy.json
Original file line number Diff line number Diff line change
Expand Up @@ -161,33 +161,6 @@
"ref_id": "main-elasticsearch"
}
],
"enterprise_search": [
{
"elasticsearch_cluster_ref_id": "main-elasticsearch",
"region": "gcp-us-west2",
"plan": {
"cluster_topology": [
{
"node_type": {
"connector": true,
"appserver": true,
"worker": true
},
"instance_configuration_id": "gcp.enterprisesearch.1",
"zone_count": 1,
"size": {
"resource": "memory",
"value": 2048
}
}
],
"enterprise_search": {
"version": null
}
},
"ref_id": "main-enterprise_search"
}
],
"kibana": [
{
"elasticsearch_cluster_ref_id": "main-elasticsearch",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set -euo pipefail

VALIDATION_PACKAGE_DIR="packages/kbn-esql-validation-autocomplete"
EDITOR_PACKAGE_DIR="packages/kbn-text-based-editor"
EDITOR_PACKAGE_DIR="packages/kbn-language-documentation"
GIT_SCOPE="$VALIDATION_PACKAGE_DIR/**/* $EDITOR_PACKAGE_DIR/**/*"

report_main_step () {
Expand Down
9 changes: 7 additions & 2 deletions .buildkite/scripts/steps/functional/performance_playwright.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,13 @@ if [ "$BUILDKITE_PIPELINE_SLUG" == "kibana-performance-data-set-extraction" ]; t
node scripts/run_performance.js --kibana-install-dir "$KIBANA_BUILD_LOCATION" --skip-warmup
else
# pipeline should use bare metal static worker
echo "--- Running performance tests"
node scripts/run_performance.js --kibana-install-dir "$KIBANA_BUILD_LOCATION"
if [[ -z "${JOURNEYS_GROUP+x}" ]]; then
echo "--- Running performance tests"
node scripts/run_performance.js --kibana-install-dir "$KIBANA_BUILD_LOCATION"
else
echo "--- Running performance tests: '$JOURNEYS_GROUP' group"
node scripts/run_performance.js --kibana-install-dir "$KIBANA_BUILD_LOCATION" --group "$JOURNEYS_GROUP"
fi
fi

echo "--- Upload journey step screenshots"
Expand Down
3 changes: 3 additions & 0 deletions .buildkite/scripts/steps/openapi_bundling/final_merge.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@ source .buildkite/scripts/common/util.sh
echo --- Merge Kibana OpenAPI specs

(cd oas_docs && make api-docs && make api-docs-lint)
(cd oas_docs && make api-docs-staging && make api-docs-lint)

check_for_changed_files "make api-docs && make api-docs-staging" true
3 changes: 1 addition & 2 deletions .buildkite/scripts/steps/storybooks/build_and_upload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ const STORYBOOKS = [
'coloring',
'chart_icons',
'content_management_examples',
'controls',
'custom_integrations',
'dashboard_enhanced',
'dashboard',
Expand Down Expand Up @@ -55,7 +54,7 @@ const STORYBOOKS = [
'language_documentation_popover',
'unified_search',
'random_sampling',
'text_based_editor',
'esql_editor',
];

const GITHUB_CONTEXT = 'Build and Publish Storybooks';
Expand Down
13 changes: 13 additions & 0 deletions .buildkite/scripts/steps/test/ftr_configs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,19 @@ while read -r config; do

start=$(date +%s)

if [[ "${USE_CHROME_BETA:-}" =~ ^(1|true)$ ]]; then
echo "USE_CHROME_BETA was set - using google-chrome-beta"
export TEST_BROWSER_BINARY_PATH="$(which google-chrome-beta)"

# download the beta version of chromedriver
export CHROMEDRIVER_VERSION=$(curl https://googlechromelabs.github.io/chrome-for-testing/last-known-good-versions.json -s | jq -r '.channels.Beta.version')
export DETECT_CHROMEDRIVER_VERSION=false
node node_modules/chromedriver/install.js --chromedriver-force-download

# set annotation on the build
buildkite-agent annotate --style info --context chrome-beta "This build uses Google Chrome Beta @ ${CHROMEDRIVER_VERSION}"
fi

# prevent non-zero exit code from breaking the loop
set +e;
node ./scripts/functional_tests \
Expand Down
3 changes: 2 additions & 1 deletion .devcontainer/.env.template
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# /bin/bash or /bin/zsh (oh-my-zsh is installed by default as well)
SHELL=/bin/bash
# Switch to 1 to enable FIPS environment, any other value to disable
# Switch to 1 to enable FIPS environment, any other value to disable,
# then close and reopen a new terminal to setup the environment
FIPS=0
7 changes: 6 additions & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8
ENV HOME=/home/vscode
ENV NVM_DIR=${HOME}/nvm
ENV NVM_VERSION=v0.39.1
ENV KBN_DIR=/workspaces/kibana
ENV OPENSSL_PATH=${HOME}/openssl
# Only specific versions are FIPS certified.
ENV OPENSSL_VERSION='3.0.8'
Expand Down Expand Up @@ -49,6 +48,10 @@ WORKDIR ${KBN_DIR}

# Node and NVM setup
COPY .node-version /tmp/

# Mac will have permissions issues if Node and NVM are installed as root
USER vscode

RUN mkdir -p $NVM_DIR && \
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/${NVM_VERSION}/install.sh | bash && \
. "$NVM_DIR/nvm.sh" && \
Expand All @@ -61,6 +64,8 @@ RUN mkdir -p $NVM_DIR && \
echo "source $NVM_DIR/nvm.sh" >> ${HOME}/.zshrc && \
chown -R 1000:1000 "${HOME}/.npm"

USER root

# Reload the env everytime a new shell is opened incase the .env file changed.
RUN echo "source $KBN_DIR/.devcontainer/scripts/env.sh" >> ${HOME}/.bashrc && \
echo "source $KBN_DIR/.devcontainer/scripts/env.sh" >> ${HOME}/.zshrc
Expand Down
5 changes: 4 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@
9230,
9231
],
"postStartCommand": "/workspaces/kibana/.devcontainer/scripts/post_start.sh",
"postStartCommand": "${containerWorkspaceFolder}/.devcontainer/scripts/post_start.sh",
"remoteUser": "vscode",
"containerEnv": {
"KBN_DIR": "${containerWorkspaceFolder}"
},
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {
"version": "latest",
Expand Down
Loading

0 comments on commit 6172ebe

Please sign in to comment.