Skip to content

Commit

Permalink
Merge branch 'main' into 169867-inventory-faad
Browse files Browse the repository at this point in the history
  • Loading branch information
ersin-erdal authored Mar 22, 2024
2 parents ccc902c + 59386ba commit 78e58c6
Show file tree
Hide file tree
Showing 2,399 changed files with 39,929 additions and 33,541 deletions.
1 change: 1 addition & 0 deletions .buildkite/ftr_configs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,7 @@ enabled:
- x-pack/test_serverless/functional/test_suites/security/common_configs/config.group4.ts
- x-pack/test_serverless/functional/test_suites/security/common_configs/config.group5.ts
- x-pack/test_serverless/functional/test_suites/security/common_configs/config.group6.ts
- x-pack/performance/journeys_e2e/aiops_log_rate_analysis.ts
- x-pack/performance/journeys_e2e/ecommerce_dashboard.ts
- x-pack/performance/journeys_e2e/ecommerce_dashboard_map_only.ts
- x-pack/performance/journeys_e2e/flight_dashboard.ts
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# yaml-language-server: $schema=https://gist.githubusercontent.com/elasticmachine/988b80dae436cafea07d9a4a460a011d/raw/rre.schema.json
apiVersion: backstage.io/v1alpha1
kind: Resource
metadata:
name: buildkite-pipeline-serverless-release
description: Initiate kibana serverless releases
links:
- title: Pipeline
url: https://buildkite.com/elastic/kibana-serverless-release-1
spec:
type: buildkite-pipeline
owner: 'group:kibana-operations'
system: buildkite
implementation:
apiVersion: buildkite.elastic.dev/v1
kind: Pipeline
metadata:
name: kibana / serverless / release
description: Initiate kibana serverless releases
spec:
env:
SLACK_NOTIFICATIONS_CHANNEL: '#kibana-operations-alerts'
ELASTIC_SLACK_NOTIFICATIONS_ENABLED: 'false'
default_branch: main
repository: elastic/kibana
pipeline_file: .buildkite/pipelines/serverless_deployment/create_deployment_tag.yml
provider_settings:
build_branches: false
build_pull_requests: false
publish_commit_status: false
trigger_mode: none
build_tags: false
teams:
kibana-release-operators:
access_level: MANAGE_BUILD_AND_READ
schedules:
Weekly automated promotion to QA:
cronline: 0 6 * * 1
message: Weekly automated promotion to QA
env:
AUTO_SELECT_COMMIT: 'true'
branch: main
1 change: 1 addition & 0 deletions .buildkite/pipeline-resource-definitions/locations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ spec:
type: url
targets:
- https://github.com/elastic/kibana/blob/main/.buildkite/pipeline-resource-definitions/kibana-migration-staging.yml
- https://github.com/elastic/kibana/blob/main/.buildkite/pipeline-resource-definitions/kibana-serverless-release.yml
6 changes: 6 additions & 0 deletions .buildkite/pipelines/esql_grammar_sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
steps:
- command: .buildkite/scripts/steps/esql_grammar_sync.sh
label: ES|QL Grammar Sync
timeout_in_minutes: 10
agents:
queue: n2-2-spot
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@ steps:
depends_on: build_image
key: test_execution
steps:
# - command: .buildkite/scripts/pipelines/security_solution_quality_gate/security_solution_cypress/mki_security_solution_cypress.sh cypress:run:qa:serverless:explore
# label: 'Serverless MKI QA Explore - Security Solution Cypress Tests'
# agents:
# queue: n2-4-spot
# # TODO : Revise the timeout when the pipeline will be officially integrated with the quality gate.
# timeout_in_minutes: 300
# parallelism: 4
# retry:
# automatic:
# - exit_status: '*'
# limit: 1
- command: .buildkite/scripts/pipelines/security_solution_quality_gate/security_solution_cypress/mki_security_solution_cypress.sh cypress:run:qa:serverless:explore
label: 'Serverless MKI QA Explore - Security Solution Cypress Tests'
agents:
queue: n2-4-spot
# TODO : Revise the timeout when the pipeline will be officially integrated with the quality gate.
timeout_in_minutes: 300
parallelism: 4
retry:
automatic:
- exit_status: '*'
limit: 1

- command: .buildkite/scripts/pipelines/security_solution_quality_gate/security_solution_cypress/mki_security_solution_cypress.sh cypress:run:qa:serverless:investigations
label: 'Serverless MKI QA Investigations - Security Solution Cypress Tests'
Expand Down Expand Up @@ -110,14 +110,14 @@ steps:
- exit_status: '*'
limit: 1

# - command: .buildkite/scripts/pipelines/security_solution_quality_gate/security_solution_cypress/mki_security_solution_cypress.sh cypress:run:qa:serverless:entity_analytics
# label: 'Serverless MKI QA Entity Analytics - Security Solution Cypress Tests'
# agents:
# queue: n2-4-spot
# # TODO : Revise the timeout when the pipeline will be officially integrated with the quality gate.
# timeout_in_minutes: 300
# parallelism: 2
# retry:
# automatic:
# - exit_status: '*'
# limit: 1
- command: .buildkite/scripts/pipelines/security_solution_quality_gate/security_solution_cypress/mki_security_solution_cypress.sh cypress:run:qa:serverless:entity_analytics
label: 'Serverless MKI QA Entity Analytics - Security Solution Cypress Tests'
agents:
queue: n2-4-spot
# TODO : Revise the timeout when the pipeline will be officially integrated with the quality gate.
timeout_in_minutes: 300
parallelism: 2
retry:
automatic:
- exit_status: '*'
limit: 1
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
## Creates deploy@<timestamp> tag on Kibana

agents:
queue: kibana-default
image: family/kibana-ubuntu-2004
imageProject: elastic-images-qa
provider: gcp
machineType: n2-standard-2

steps:
- label: "List potential commits"
Expand Down
3 changes: 3 additions & 0 deletions .buildkite/scripts/common/env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ export TEST_BROWSER_HEADLESS=1

export ELASTIC_APM_ENVIRONMENT=ci
export ELASTIC_APM_TRANSACTION_SAMPLE_RATE=0.1
export ELASTIC_APM_SERVER_URL=https://kibana-ci-apm.apm.us-central1.gcp.cloud.es.io
# Not really a secret, if APM supported public auth we would use it and APM requires that we use this name
export ELASTIC_APM_SECRET_TOKEN=7YKhoXsO4MzjhXjx2c

if is_pr; then
if is_pr_with_label "ci:collect-apm"; then
Expand Down
6 changes: 0 additions & 6 deletions .buildkite/scripts/common/setup_job_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,6 @@ EOF

SONAR_LOGIN=$(vault_get sonarqube token)
export SONAR_LOGIN

ELASTIC_APM_SERVER_URL=$(vault_get project-kibana-ci-apm apm_server_url)
export ELASTIC_APM_SERVER_URL

ELASTIC_APM_API_KEY=$(vault_get project-kibana-ci-apm apm_server_api_key)
export ELASTIC_APM_API_KEY
}

# Set up GCS Service Account for CDN
Expand Down
128 changes: 128 additions & 0 deletions .buildkite/scripts/steps/esql_grammar_sync.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
#!/usr/bin/env bash
set -euo pipefail

synchronize_lexer_grammar () {
license_header="$1"
source_file="$PARENT_DIR/elasticsearch/x-pack/plugin/esql/src/main/antlr/EsqlBaseLexer.g4"
destination_file="./packages/kbn-monaco/src/esql/antlr/esql_lexer.g4"

# Copy the file
cp "$source_file" "$destination_file"

# Insert the license header
temp_file=$(mktemp)
printf "%s\n\n// DO NOT MODIFY THIS FILE BY HAND. IT IS MANAGED BY A CI JOB.\n\n%s" "$license_header" "$(cat $destination_file)" > "$temp_file"
mv "$temp_file" "$destination_file"

# Replace the line containing "lexer grammar" with "lexer grammar esql_lexer;"
sed -i -e 's/lexer grammar.*$/lexer grammar esql_lexer;/' "$destination_file"

# Insert "options { caseInsensitive = true; }" one line below
sed -i -e '/lexer grammar esql_lexer;/a\
options { caseInsensitive = true; }' "$destination_file"

echo "File copied and modified successfully."
}

synchronize_parser_grammar () {
license_header="$1"
source_file="$PARENT_DIR/elasticsearch/x-pack/plugin/esql/src/main/antlr/EsqlBaseParser.g4"
destination_file="./packages/kbn-monaco/src/esql/antlr/esql_parser.g4"

# Copy the file
cp "$source_file" "$destination_file"

# Insert the license header
temp_file=$(mktemp)
printf "%s\n\n// DO NOT MODIFY THIS FILE BY HAND. IT IS MANAGED BY A CI JOB.\n\n%s" "$license_header" "$(cat ${destination_file})" > "$temp_file"
mv "$temp_file" "$destination_file"

# Replace the line containing "parser grammar" with "parser grammar esql_parser;"
sed -i -e 's/parser grammar.*$/parser grammar esql_parser;/' "$destination_file"

# Replace options {tokenVocab=EsqlBaseLexer;} with options {tokenVocab=esql_lexer;}
sed -i -e 's/options {tokenVocab=EsqlBaseLexer;}/options {tokenVocab=esql_lexer;}/' "$destination_file"

echo "File copied and modified successfully."
}

report_main_step () {
echo "--- $1"
}

main () {
cd "$PARENT_DIR"

report_main_step "Cloning repositories"

rm -rf elasticsearch
git clone https://github.com/elastic/elasticsearch --depth 1

rm -rf open-source
git clone https://github.com/elastic/open-source --depth 1

cd "$KIBANA_DIR"

license_header=$(cat "$PARENT_DIR/open-source/legal/elastic-license-2.0-header.txt")

report_main_step "Synchronizing lexer grammar..."
synchronize_lexer_grammar "$license_header"

report_main_step "Synchronizing parser grammar..."
synchronize_parser_grammar "$license_header"

# Check for differences
set +e
git diff --exit-code --quiet "$destination_file"
if [ $? -eq 0 ]; then
echo "No differences found. Our work is done here."
exit
fi
set -e

report_main_step "Differences found. Checking for an existing pull request."

KIBANA_MACHINE_USERNAME="kibanamachine"
git config --global user.name "$KIBANA_MACHINE_USERNAME"
git config --global user.email '[email protected]'

PR_TITLE='[ES|QL] Update grammars'
PR_BODY='This PR updates the ES|QL grammars (lexer and parser) to match the latest version in Elasticsearch.'

# Check if a PR already exists
pr_search_result=$(gh pr list --search "$PR_TITLE" --state open --author "$KIBANA_MACHINE_USERNAME" --limit 1 --json title -q ".[].title")

if [ "$pr_search_result" == "$PR_TITLE" ]; then
echo "PR already exists. Exiting."
exit
fi

echo "No existing PR found. Proceeding."

report_main_step "Building ANTLR artifacts."

# Bootstrap Kibana
.buildkite/scripts/bootstrap.sh

# Build ANTLR stuff
cd ./packages/kbn-monaco/src
yarn build:antlr4:esql

# Make a commit
BRANCH_NAME="esql_grammar_sync_$(date +%s)"

git checkout -b "$BRANCH_NAME"

git add -A
git commit -m "Update ES|QL grammars"

report_main_step "Changes committed. Creating pull request."

git remote add kibanamachine https://github.com/kibanamachine/kibana.git
git push kibanamachine "$BRANCH_NAME"

# Create a PR
gh pr create --draft --title "$PR_TITLE" --body "$PR_BODY" --base main --head "kibanamachine:${BRANCH_NAME}" --label 'release_note:skip' --label 'Team:Visualizations'
}

main
2 changes: 2 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -875,6 +875,7 @@ module.exports = {
'x-pack/plugins/observability_solution/observability/**/*.{js,mjs,ts,tsx}',
'x-pack/plugins/observability_solution/exploratory_view/**/*.{js,mjs,ts,tsx}',
'x-pack/plugins/observability_solution/ux/**/*.{js,mjs,ts,tsx}',
'x-pack/plugins/observability_solution/slo/**/*.{js,mjs,ts,tsx}',
],
rules: {
'no-console': ['warn', { allow: ['error'] }],
Expand All @@ -897,6 +898,7 @@ module.exports = {
'x-pack/plugins/observability_solution/apm/**/*.stories.*',
'x-pack/plugins/observability_solution/observability/**/*.stories.*',
'x-pack/plugins/observability_solution/exploratory_view/**/*.stories.*',
'x-pack/plugins/observability_solution/slo/**/*.stories.*',
],
rules: {
'react/function-component-definition': [
Expand Down
11 changes: 10 additions & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ src/plugins/ai_assistant_management/observability @elastic/obs-knowledge-team
src/plugins/ai_assistant_management/selection @elastic/obs-knowledge-team
x-pack/packages/ml/aiops_components @elastic/ml-ui
x-pack/plugins/aiops @elastic/ml-ui
x-pack/packages/ml/aiops_test_utils @elastic/ml-ui
x-pack/packages/ml/aiops_utils @elastic/ml-ui
x-pack/test/alerting_api_integration/packages/helpers @elastic/response-ops
x-pack/test/alerting_api_integration/common/plugins/alerts @elastic/response-ops
Expand Down Expand Up @@ -338,10 +339,13 @@ x-pack/plugins/observability_solution/dataset_quality @elastic/obs-ux-logs-team
packages/kbn-datemath @elastic/kibana-data-discovery
packages/deeplinks/analytics @elastic/kibana-data-discovery @elastic/kibana-presentation @elastic/kibana-visualizations
packages/deeplinks/devtools @elastic/kibana-management
packages/deeplinks/fleet @elastic/fleet
packages/deeplinks/management @elastic/kibana-management
packages/deeplinks/ml @elastic/ml-ui
packages/deeplinks/observability @elastic/obs-ux-logs-team
packages/deeplinks/search @elastic/enterprise-search-frontend
packages/deeplinks/security @elastic/security-solution
packages/deeplinks/shared @elastic/appex-sharedux
packages/default-nav/analytics @elastic/kibana-data-discovery @elastic/kibana-presentation @elastic/kibana-visualizations
packages/default-nav/devtools @elastic/kibana-management
packages/default-nav/management @elastic/kibana-management
Expand Down Expand Up @@ -563,6 +567,7 @@ x-pack/packages/ml/response_stream @elastic/ml-ui
x-pack/packages/ml/route_utils @elastic/ml-ui
x-pack/packages/ml/runtime_field_utils @elastic/ml-ui
x-pack/packages/ml/string_hash @elastic/ml-ui
x-pack/packages/ml/time_buckets @elastic/ml-ui
x-pack/packages/ml/trained_models_utils @elastic/ml-ui
x-pack/packages/ml/ui_actions @elastic/ml-ui
x-pack/packages/ml/url_state @elastic/ml-ui
Expand Down Expand Up @@ -680,6 +685,7 @@ packages/kbn-search-connectors @elastic/enterprise-search-frontend
packages/kbn-search-errors @elastic/kibana-data-discovery
examples/search_examples @elastic/kibana-data-discovery
packages/kbn-search-index-documents @elastic/enterprise-search-frontend
x-pack/plugins/search_playground @elastic/enterprise-search-frontend
packages/kbn-search-response-warnings @elastic/kibana-data-discovery
x-pack/plugins/searchprofiler @elastic/kibana-management
x-pack/test/security_api_integration/packages/helpers @elastic/kibana-security
Expand Down Expand Up @@ -720,7 +726,7 @@ packages/kbn-server-http-tools @elastic/kibana-core
packages/kbn-server-route-repository @elastic/obs-knowledge-team
x-pack/plugins/serverless @elastic/appex-sharedux
packages/serverless/settings/common @elastic/appex-sharedux @elastic/kibana-management
x-pack/plugins/serverless_observability @elastic/appex-sharedux @elastic/obs-ux-management-team
x-pack/plugins/serverless_observability @elastic/obs-ux-management-team
packages/serverless/settings/observability_project @elastic/appex-sharedux @elastic/kibana-management @elastic/obs-ux-management-team
packages/serverless/project_switcher @elastic/appex-sharedux
x-pack/plugins/serverless_search @elastic/enterprise-search-frontend
Expand Down Expand Up @@ -782,6 +788,7 @@ packages/shared-ux/router/types @elastic/appex-sharedux
packages/shared-ux/storybook/config @elastic/appex-sharedux
packages/shared-ux/storybook/mock @elastic/appex-sharedux
packages/kbn-shared-ux-utility @elastic/appex-sharedux
x-pack/plugins/observability_solution/slo @elastic/obs-ux-management-team
x-pack/packages/kbn-slo-schema @elastic/obs-ux-management-team
x-pack/plugins/snapshot_restore @elastic/kibana-management
packages/solution-nav/es @elastic/appex-sharedux
Expand Down Expand Up @@ -1168,6 +1175,8 @@ x-pack/plugins/observability_solution/infra/server/lib/alerting @elastic/obs-ux-
/.bazelversion @elastic/kibana-operations
/WORKSPACE.bazel @elastic/kibana-operations
/.buildkite/ @elastic/kibana-operations
/.buildkite/scripts/steps/esql_grammar_sync.sh @elastic/kibana-visualizations
/.buildkite/pipelines/esql_grammar_sync.yml @elastic/kibana-visualizations
/kbn_pm/ @elastic/kibana-operations
/x-pack/dev-tools @elastic/kibana-operations
/catalog-info.yaml @elastic/kibana-operations @elastic/kibana-tech-leads
Expand Down
5 changes: 4 additions & 1 deletion .i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,10 @@
"packages/kbn-management"
],
"monaco": "packages/kbn-monaco/src",
"navigation": "src/plugins/navigation",
"navigation": [
"src/plugins/navigation",
"packages/solution-nav"
],
"links": "src/plugins/links",
"newsfeed": "src/plugins/newsfeed",
"presentationUtil": "src/plugins/presentation_util",
Expand Down
Loading

0 comments on commit 78e58c6

Please sign in to comment.