Skip to content

Commit

Permalink
Merge branch '8.x' into backport/8.x/pr-199185
Browse files Browse the repository at this point in the history
  • Loading branch information
legrego authored Nov 21, 2024
2 parents aaab4b1 + a36d790 commit e57ace0
Show file tree
Hide file tree
Showing 3,618 changed files with 115,958 additions and 63,858 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
1 change: 1 addition & 0 deletions .buildkite/ftr_platform_stateful_configs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -374,3 +374,4 @@ enabled:
- x-pack/test/custom_branding/config.ts
# stateful config files that run deployment-agnostic tests
- x-pack/test/api_integration/deployment_agnostic/configs/stateful/platform.stateful.config.ts
- x-pack/test/api_integration/apis/cloud/config.ts
2 changes: 2 additions & 0 deletions .buildkite/ftr_security_serverless_configs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,9 @@ disabled:
- x-pack/test/security_solution_api_integration/test_suites/explore/network/trial_license_complete_tier/configs/serverless.config.ts
- x-pack/test/security_solution_api_integration/test_suites/explore/users/trial_license_complete_tier/configs/serverless.config.ts
- x-pack/test/security_solution_api_integration/test_suites/explore/overview/trial_license_complete_tier/configs/serverless.config.ts
- x-pack/test/security_solution_api_integration/test_suites/investigation/saved_objects/basic_license_essentials_tier/configs/serverless.config.ts
- x-pack/test/security_solution_api_integration/test_suites/investigation/saved_objects/trial_license_complete_tier/configs/serverless.config.ts
- x-pack/test/security_solution_api_integration/test_suites/investigation/timeline/basic_license_essentials_tier/configs/serverless.config.ts
- x-pack/test/security_solution_api_integration/test_suites/investigation/timeline/trial_license_complete_tier/configs/serverless.config.ts
- x-pack/test/security_solution_api_integration/test_suites/sources/indices/trial_license_complete_tier/configs/serverless.config.ts
- x-pack/test/security_solution_api_integration/test_suites/edr_workflows/artifacts/trial_license_complete_tier/configs/serverless.config.ts
Expand Down
4 changes: 0 additions & 4 deletions .buildkite/ftr_security_stateful_configs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,9 @@ enabled:
- x-pack/test/security_solution_api_integration/test_suites/explore/users/trial_license_complete_tier/configs/ess.config.ts
- x-pack/test/security_solution_api_integration/test_suites/explore/overview/trial_license_complete_tier/configs/ess.config.ts
- x-pack/test/security_solution_api_integration/test_suites/investigation/saved_objects/basic_license_essentials_tier/configs/ess.config.ts
- x-pack/test/security_solution_api_integration/test_suites/investigation/saved_objects/basic_license_essentials_tier/configs/serverless.config.ts
- x-pack/test/security_solution_api_integration/test_suites/investigation/saved_objects/trial_license_complete_tier/configs/ess.config.ts
- x-pack/test/security_solution_api_integration/test_suites/investigation/saved_objects/trial_license_complete_tier/configs/serverless.config.ts
- x-pack/test/security_solution_api_integration/test_suites/investigation/timeline/trial_license_complete_tier/configs/ess.config.ts
- x-pack/test/security_solution_api_integration/test_suites/investigation/timeline/trial_license_complete_tier/configs/serverless.config.ts
- x-pack/test/security_solution_api_integration/test_suites/investigation/timeline/basic_license_essentials_tier/configs/ess.config.ts
- x-pack/test/security_solution_api_integration/test_suites/investigation/timeline/basic_license_essentials_tier/configs/serverless.config.ts
- x-pack/test/security_solution_api_integration/test_suites/sources/indices/trial_license_complete_tier/configs/ess.config.ts
- x-pack/test/security_solution_api_integration/test_suites/edr_workflows/artifacts/trial_license_complete_tier/configs/ess.config.ts
- x-pack/test/security_solution_api_integration/test_suites/edr_workflows/authentication/trial_license_complete_tier/configs/ess.config.ts
Expand Down
12 changes: 6 additions & 6 deletions .buildkite/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# yaml-language-server: $schema=https://gist.githubusercontent.com/elasticmachine/988b80dae436cafea07d9a4a460a011d/raw/rre.schema.json
apiVersion: backstage.io/v1alpha1
kind: Resource
metadata:
name: bk-kibana-console-definitions-sync
description: Opens a PR if anything changes in the console definitions in elasticsearch-definitions
links:
- url: 'https://buildkite.com/elastic/kibana-console-definitions-sync'
title: Pipeline link
spec:
type: buildkite-pipeline
owner: 'group:kibana-management'
system: buildkite
implementation:
apiVersion: buildkite.elastic.dev/v1
kind: Pipeline
metadata:
name: kibana / Console definitions sync
description: Opens a PR if anything changes in the console definitions in elasticsearch-definitions
spec:
env:
SLACK_NOTIFICATIONS_CHANNEL: '#kibana-management'
ELASTIC_SLACK_NOTIFICATIONS_ENABLED: 'true'
allow_rebuilds: false
branch_configuration: main
default_branch: main
repository: elastic/kibana
pipeline_file: .buildkite/pipelines/console_definitions_sync.yml
provider_settings:
build_branches: false
build_pull_requests: false
publish_commit_status: false
trigger_mode: none
build_tags: false
prefix_pull_request_fork_branch_names: false
skip_pull_request_builds_for_existing_commits: true
teams:
kibana-management:
access_level: MANAGE_BUILD_AND_READ
kibana-operations:
access_level: MANAGE_BUILD_AND_READ
appex-qa:
access_level: MANAGE_BUILD_AND_READ
kibana-tech-leads:
access_level: MANAGE_BUILD_AND_READ
everyone:
access_level: BUILD_AND_READ
schedules:
Weekly build:
cronline: 0 0 * * 1 America/New_York
message: Weekly build
branch: main
tags:
- kibana
10 changes: 10 additions & 0 deletions .buildkite/pipelines/console_definitions_sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
steps:
- command: .buildkite/scripts/steps/console_definitions_sync.sh
label: Console Definitions Sync
timeout_in_minutes: 10
agents:
image: family/kibana-ubuntu-2004
imageProject: elastic-images-prod
provider: gcp
machineType: n2-standard-2
preemptible: true
7 changes: 4 additions & 3 deletions .buildkite/pipelines/fips.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,15 @@ steps:
machineType: n2-standard-2
preemptible: true

- command: .buildkite/scripts/steps/fips/smoke_test.sh
label: 'Pick Smoke Test Group Run Order'
- command: .buildkite/scripts/steps/test/pick_test_group_run_order.sh
label: 'Pick Test Group Run Order'
depends_on: build
timeout_in_minutes: 10
env:
FTR_CONFIGS_SCRIPT: '.buildkite/scripts/steps/test/ftr_configs.sh'
FTR_EXTRA_ARGS: '$FTR_EXTRA_ARGS'
LIMIT_CONFIG_TYPE: 'functional'
JEST_UNIT_SCRIPT: '.buildkite/scripts/steps/test/jest.sh'
JEST_INTEGRATION_SCRIPT: '.buildkite/scripts/steps/test/jest_integration.sh'
retry:
automatic:
- exit_status: '*'
Expand Down
15 changes: 15 additions & 0 deletions .buildkite/pipelines/on_merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,21 @@ steps:
- exit_status: '-1'
limit: 3

- command: .buildkite/scripts/steps/openapi_publishing/publish_oas_docs.sh
label: 'Publish OAS docs to bump.sh'
agents:
image: family/kibana-ubuntu-2004
imageProject: elastic-images-prod
provider: gcp
machineType: n2-standard-2
preemptible: true
timeout_in_minutes: 60
soft_fail: true
retry:
automatic:
- exit_status: '-1'
limit: 3

- command: .buildkite/scripts/steps/bazel_cache/bootstrap_linux.sh
label: 'Populate local dev bazel cache (Linux)'
agents:
Expand Down
2 changes: 1 addition & 1 deletion .buildkite/scripts/common/env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ if [[ "${KBN_ENABLE_FIPS:-}" == "true" ]] || is_pr_with_label "ci:enable-fips-ag
fi

if [[ -f "$KIBANA_DIR/config/kibana.yml" ]]; then
echo -e '\nxpack.security.experimental.fipsMode.enabled: true' >>"$KIBANA_DIR/config/kibana.yml"
echo -e '\nxpack.security.fipsMode.enabled: true' >>"$KIBANA_DIR/config/kibana.yml"
fi
fi

Expand Down
68 changes: 68 additions & 0 deletions .buildkite/scripts/steps/console_definitions_sync.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
#!/usr/bin/env bash
set -euo pipefail

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

main () {
cd "$PARENT_DIR"

report_main_step "Cloning repositories"

rm -rf elasticsearch-specification
if ! git clone https://github.com/elastic/elasticsearch-specification --depth 1; then
echo "Error: Failed to clone the elasticsearch-specification repository."
exit 1
fi

cd "$KIBANA_DIR"

report_main_step "Generating console definitions"
node scripts/generate_console_definitions.js --source "$PARENT_DIR/elasticsearch-specification" --emptyDest

# Check if there are any differences
set +e
git diff --exit-code --quiet "$destination_file"
if [ $? -eq 0 ]; then
echo "No differences found. Exiting.."
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='[Console] Update console definitions'
PR_BODY='This PR updates the console definitions to match the latest ones from the @elastic/elasticsearch-specification repo.'

# 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.."

# Commit diff
BRANCH_NAME="console_definitions_sync_$(date +%s)"

git checkout -b "$BRANCH_NAME"

git add src/plugins/console/server/lib/spec_definitions/json/generated/*
git commit -m "Update console definitions"

report_main_step "Changes committed. Creating pull request."

git push origin "$BRANCH_NAME"

# Create PR
gh pr create --title "$PR_TITLE" --body "$PR_BODY" --base main --head "${BRANCH_NAME}" --label 'release_note:skip' --label 'Feature:Console' --label 'Team:Kibana Management'
}

main
24 changes: 0 additions & 24 deletions .buildkite/scripts/steps/fips/smoke_test.sh

This file was deleted.

10 changes: 9 additions & 1 deletion .buildkite/scripts/steps/openapi_bundling/final_merge.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,16 @@ set -euo pipefail

source .buildkite/scripts/common/util.sh

cur_dir=$(pwd)
cd oas_docs

echo --- Installing NPM modules
npm install

echo --- Merge Kibana OpenAPI specs
make api-docs
# make api-docs-lint <-- Relies on JSONPath version with RCE vulnerabilities based on `npm audit`, https://github.com/advisories/GHSA-pppg-cpfq-h7wr

(cd oas_docs && make api-docs && make api-docs-lint)
cd "$cur_dir"

check_for_changed_files "make api-docs" true
Loading

0 comments on commit e57ace0

Please sign in to comment.