Skip to content

Commit

Permalink
Merge branch 'main' into rm-so-decorator
Browse files Browse the repository at this point in the history
  • Loading branch information
rudolf authored Sep 20, 2024
2 parents 2963de9 + 96dd4c7 commit 9d769a8
Show file tree
Hide file tree
Showing 3,361 changed files with 81,995 additions and 67,895 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
4 changes: 2 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,7 @@ 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/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
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-popover"
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
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 @@ -22,7 +22,6 @@ const STORYBOOKS = [
'coloring',
'chart_icons',
'content_management_examples',
'controls',
'custom_integrations',
'dashboard_enhanced',
'dashboard',
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
23 changes: 16 additions & 7 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,12 @@ packages/core/execution-context/core-execution-context-server-mocks @elastic/kib
packages/core/fatal-errors/core-fatal-errors-browser @elastic/kibana-core
packages/core/fatal-errors/core-fatal-errors-browser-internal @elastic/kibana-core
packages/core/fatal-errors/core-fatal-errors-browser-mocks @elastic/kibana-core
packages/core/feature-flags/core-feature-flags-browser @elastic/kibana-core
packages/core/feature-flags/core-feature-flags-browser-internal @elastic/kibana-core
packages/core/feature-flags/core-feature-flags-browser-mocks @elastic/kibana-core
packages/core/feature-flags/core-feature-flags-server @elastic/kibana-core
packages/core/feature-flags/core-feature-flags-server-internal @elastic/kibana-core
packages/core/feature-flags/core-feature-flags-server-mocks @elastic/kibana-core
test/plugin_functional/plugins/core_history_block @elastic/kibana-core
packages/core/http/core-http-browser @elastic/kibana-core
packages/core/http/core-http-browser-internal @elastic/kibana-core
Expand Down Expand Up @@ -348,6 +354,7 @@ x-pack/plugins/data_quality @elastic/obs-ux-logs-team
test/plugin_functional/plugins/data_search @elastic/kibana-data-discovery
packages/kbn-data-service @elastic/kibana-visualizations @elastic/kibana-data-discovery
packages/kbn-data-stream-adapter @elastic/security-threat-hunting-explore
x-pack/plugins/data_usage @elastic/obs-ai-assistant @elastic/security-solution
src/plugins/data_view_editor @elastic/kibana-data-discovery
examples/data_view_field_editor_example @elastic/kibana-data-discovery
src/plugins/data_view_field_editor @elastic/kibana-data-discovery
Expand Down Expand Up @@ -453,6 +460,7 @@ examples/expressions_explorer @elastic/kibana-visualizations
src/plugins/expressions @elastic/kibana-visualizations
packages/kbn-failed-test-reporter-cli @elastic/kibana-operations @elastic/appex-qa
examples/feature_control_examples @elastic/kibana-security
examples/feature_flags_example @elastic/kibana-core
x-pack/test/plugin_api_integration/plugins/feature_usage_test @elastic/kibana-security
x-pack/plugins/features @elastic/kibana-core
x-pack/test/functional_execution_context/plugins/alerts @elastic/kibana-core
Expand All @@ -461,7 +469,7 @@ src/plugins/field_formats @elastic/kibana-data-discovery
packages/kbn-field-types @elastic/kibana-data-discovery
packages/kbn-field-utils @elastic/kibana-data-discovery
x-pack/plugins/fields_metadata @elastic/obs-ux-logs-team
x-pack/plugins/file_upload @elastic/kibana-gis @elastic/ml-ui
x-pack/plugins/file_upload @elastic/kibana-presentation @elastic/ml-ui
examples/files_example @elastic/appex-sharedux
src/plugins/files_management @elastic/appex-sharedux
src/plugins/files @elastic/appex-sharedux
Expand Down Expand Up @@ -583,11 +591,11 @@ packages/kbn-management/settings/types @elastic/kibana-management
packages/kbn-management/settings/utilities @elastic/kibana-management
packages/kbn-management/storybook/config @elastic/kibana-management
test/plugin_functional/plugins/management_test_plugin @elastic/kibana-management
packages/kbn-mapbox-gl @elastic/kibana-gis
x-pack/examples/third_party_maps_source_example @elastic/kibana-gis
src/plugins/maps_ems @elastic/kibana-gis
x-pack/plugins/maps @elastic/kibana-gis
x-pack/packages/maps/vector_tile_utils @elastic/kibana-gis
packages/kbn-mapbox-gl @elastic/kibana-presentation
x-pack/examples/third_party_maps_source_example @elastic/kibana-presentation
src/plugins/maps_ems @elastic/kibana-presentation
x-pack/plugins/maps @elastic/kibana-presentation
x-pack/packages/maps/vector_tile_utils @elastic/kibana-presentation
x-pack/plugins/observability_solution/metrics_data_access @elastic/obs-knowledge-team @elastic/obs-ux-infra_services-team
x-pack/packages/ml/agg_utils @elastic/ml-ui
x-pack/packages/ml/anomaly_utils @elastic/ml-ui
Expand Down Expand Up @@ -1354,6 +1362,7 @@ x-pack/plugins/cloud_integrations/cloud_full_story/server/config.ts @elastic/kib
# Kibana Platform Security
/.github/codeql @elastic/kibana-security
/.github/workflows/codeql.yml @elastic/kibana-security
/.github/workflows/codeql-stats.yml @elastic/kibana-security
/src/dev/eslint/security_eslint_rule_tests.ts @elastic/kibana-security
/src/core/server/integration_tests/config/check_dynamic_config.test.ts @elastic/kibana-security
/src/plugins/telemetry/server/config/telemetry_labels.ts @elastic/kibana-security
Expand Down Expand Up @@ -1759,7 +1768,7 @@ x-pack/plugins/security_solution/server/lib/security_integrations @elastic/secur
/x-pack/plugins/monitoring/**/*.scss @elastic/observability-design

# Ent. Search design
/x-pack/plugins/enterprise_search/**/*.scss @elastic/ent-search-design
/x-pack/plugins/enterprise_search/**/*.scss @elastic/search-design

# Security design
/x-pack/plugins/endpoint/**/*.scss @elastic/security-design
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/codeql-stats.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: CodeQL statistics

on:
schedule:
- cron: '27 0 * * 1' # At 00:27 every Monday

jobs:
stats:
name: CodeQL statistics
runs-on: ubuntu-latest
if: github.repository == 'elastic/kibana' # Hack: Do not run on forks
steps:
- name: Checkout kibana-operations
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
repository: 'elastic/kibana-operations'
ref: main
path: ./kibana-operations
token: ${{secrets.KIBANAMACHINE_TOKEN}}

- name: CodeQL alert statistics
working-directory: ./kibana-operations/triage
env:
GITHUB_TOKEN: ${{secrets.KIBANAMACHINE_TOKEN}}
SLACK_TOKEN: ${{secrets.CODE_SCANNING_SLACK_TOKEN}}
run: |
npm ci --omit=dev
node codeql-alert-stats
22 changes: 22 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,25 @@ jobs:
category: "/language:${{matrix.language}}"
ref: ${{ env.CHECKOUT_REF }}
sha: ${{ env.CHECKOUT_SHA }}
alert:
name: Alert
runs-on: ubuntu-latest
needs: analyze
if: github.repository == 'elastic/kibana' # Hack: Do not run on forks
steps:
- name: Checkout kibana-operations
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
repository: 'elastic/kibana-operations'
ref: main
path: ./kibana-operations
token: ${{secrets.KIBANAMACHINE_TOKEN}}

- name: CodeQL alert
working-directory: ./kibana-operations/triage
env:
GITHUB_TOKEN: ${{secrets.KIBANAMACHINE_TOKEN}}
SLACK_TOKEN: ${{secrets.CODE_SCANNING_SLACK_TOKEN}}
run: |
npm ci --omit=dev
node codeql-alert
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: 2024-09-16
date: 2024-09-20
tags: ['contributor', 'dev', 'apidocs', 'kibana', 'actions']
---
import actionsObj from './actions.devdocs.json';
Expand Down
Loading

0 comments on commit 9d769a8

Please sign in to comment.