Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into kbn-xxx-action-test…
Browse files Browse the repository at this point in the history
…s-against-serverless
  • Loading branch information
pgayvallet committed Sep 11, 2023
2 parents a5aefd4 + 6754699 commit 2a3e6cd
Show file tree
Hide file tree
Showing 2,160 changed files with 63,434 additions and 18,842 deletions.
2 changes: 2 additions & 0 deletions .buildkite/ftr_configs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ enabled:
- x-pack/test/alerting_api_integration/security_and_spaces/group1/config.ts
- x-pack/test/alerting_api_integration/security_and_spaces/group2/config.ts
- x-pack/test/alerting_api_integration/security_and_spaces/group3/config.ts
- x-pack/test/alerting_api_integration/security_and_spaces/group3/config_with_schedule_circuit_breaker.ts
- x-pack/test/alerting_api_integration/security_and_spaces/group2/config_non_dedicated_task_runner.ts
- x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group1/config.ts
- x-pack/test/alerting_api_integration/spaces_only/tests/alerting/group2/config.ts
Expand Down Expand Up @@ -416,6 +417,7 @@ enabled:
- x-pack/performance/journeys/many_fields_discover.ts
- x-pack/performance/journeys/many_fields_lens_editor.ts
- x-pack/performance/journeys/many_fields_transform.ts
- x-pack/performance/journeys/tsdb_logs_data_visualizer.ts
- x-pack/performance/journeys/promotion_tracking_dashboard.ts
- x-pack/performance/journeys/web_logs_dashboard.ts
- x-pack/performance/journeys/data_stress_test_lens.ts
Expand Down
8 changes: 7 additions & 1 deletion .buildkite/pipelines/pipeline.kibana-serverless-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,14 @@ steps:
- label: ":releasethekraken: Release kibana"
# https://regex101.com/r/tY52jo/1
if: build.tag =~ /^deploy@\d+\$/
trigger: gpctl-promote
trigger: gpctl-promote-with-e2e-tests
build:
env:
SERVICE_COMMIT_HASH: "${BUILDKITE_COMMIT:0:12}"
REMOTE_SERVICE_CONFIG: https://raw.githubusercontent.com/elastic/serverless-gitops/main/gen/gpctl/kibana/config.yaml
SERVICE: kibana-controller
NAMESPACE: kibana-ci
IMAGE_NAME: kibana-serverless

notify:
- slack: "#kibana-mission-control"
4 changes: 2 additions & 2 deletions .buildkite/pipelines/pull_request/base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ steps:
queue: n2-4-spot
depends_on: build
timeout_in_minutes: 40
parallelism: 16
parallelism: 2
soft_fail: true
retry:
automatic:
Expand All @@ -166,7 +166,7 @@ steps:
queue: n2-4-spot
depends_on: build
timeout_in_minutes: 40
parallelism: 6
parallelism: 2
soft_fail: true
retry:
automatic:
Expand Down
19 changes: 18 additions & 1 deletion .buildkite/pipelines/quality-gates/pipeline.kibana-tests.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,27 @@
# This pipeline serves as the entry point for your service's quality gates definitions. When
# properly configured, it will be invoked automatically as part of the automated
# promotion process once a new version was rolled out in one of the various cloud stages.
#
# The updated environment is provided via ENVIRONMENT variable. The seedling
# step will branch and execute pipeline snippets at the following location:
# pipeline.tests-qa.yaml
# pipeline.tests-staging.yaml
# pipeline.tests-production.yaml
#
# Docs: https://docs.elastic.dev/serverless/qualitygates

env:
TEAM_CHANNEL: "#kibana-mission-control"
ENVIRONMENT: ${ENVIRONMENT?}

steps:
- label: ":pipeline::grey_question::seedling: Trigger Kibana Tests for ${ENVIRONMENT}"
env:
QG_PIPELINE_LOCATION: ".buildkite/pipelines/quality-gates"
command: "make -C /agent run-environment-tests"
command: "make -C /agent run-environment-tests" # will trigger https://buildkite.com/elastic/kibana-tests
agents:
image: "docker.elastic.co/ci-agent-images/quality-gate-seedling:0.0.2"

notify:
- slack: "${TEAM_CHANNEL?}"
if: build.branch == "main" && build.state == "failed"
25 changes: 12 additions & 13 deletions .buildkite/pipelines/quality-gates/pipeline.tests-production.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
env:
TEAM_CHANNEL: "#kibana-serverless-release"
ENVIRONMENT: "production"
# These pipeline steps constitute the quality gate for your service within the production
# environment. Incorporate any necessary additional logic to validate the service's integrity.
# A failure in this pipeline build will prevent further progression to the subsequent stage.

steps:
- label: ":pipeline::fleet::seedling: Trigger Observability Kibana Tests for ${ENVIRONMENT}"
command: echo "replace me with Observability specific Kibana tests"
agents:
image: "docker.elastic.co/ci-agent-images/basic-buildkite-agent:1688566364"

- label: ":pipeline::lock::seedling: Trigger Security Kibana Tests for ${ENVIRONMENT}"
command: echo "replace me with Security specific Kibana tests"
agents:
image: "docker.elastic.co/ci-agent-images/basic-buildkite-agent:1688566364"
- label: ":pipeline::rocket::seedling: Trigger control-plane e2e tests"
trigger: "ess-k8s-production-e2e-tests" # https://buildkite.com/elastic/ess-k8s-production-e2e-tests
build:
env:
REGION_ID: aws-us-east-1
NAME_PREFIX: ci_test_kibana-promotion_
message: "${BUILDKITE_MESSAGE} (triggered by pipeline.tests-production.yaml)"

- wait: ~

- label: ":judge::seedling: Trigger Manual Tests Phase"
command: "make -C /agent trigger-manual-verification-phase"
if: build.branch == "main"
agents:
image: "docker.elastic.co/ci-agent-images/manual-verification-agent:0.0.1"
image: "docker.elastic.co/ci-agent-images/manual-verification-agent:0.0.2"
51 changes: 31 additions & 20 deletions .buildkite/pipelines/quality-gates/pipeline.tests-qa.yaml
Original file line number Diff line number Diff line change
@@ -1,31 +1,42 @@
env:
TEAM_CHANNEL: "#kibana-serverless-release"
ENVIRONMENT: "qa"
# These pipeline steps constitute the quality gate for your service within the QA environment.
# Incorporate any necessary additional logic to validate the service's integrity. A failure in
# this pipeline build will prevent further progression to the subsequent stage.

steps:
- label: ":pipeline::kibana::seedling: Trigger Kibana Tests for ${ENVIRONMENT}"
command: echo "replace me with Kibana specific tests"
agents:
image: "docker.elastic.co/ci-agent-images/basic-buildkite-agent:1688566364"
- label: ":pipeline::kibana::seedling: Trigger Kibana Serverless Tests for ${ENVIRONMENT}"
trigger: appex-qa-serverless-kibana-ftr-tests # https://buildkite.com/elastic/appex-qa-serverless-kibana-ftr-tests
soft_fail: true # Remove this before release or when tests stabilize
build:
env:
ENVIRONMENT: ${ENVIRONMENT}
message: "${BUILDKITE_MESSAGE} (triggered by pipeline.tests-qa.yaml)"

- label: ":pipeline::fleet::seedling: Trigger Fleet Kibana Tests for ${ENVIRONMENT}"
command: echo "replace me with Fleet specific Kibana tests"
agents:
image: "docker.elastic.co/ci-agent-images/basic-buildkite-agent:1688566364"
- group: ":female-detective: Security Solution Tests"
key: "security"
steps:
- label: ":pipeline::female-detective::seedling: Trigger Security Solution quality gate script"
command: .buildkite/scripts/pipelines/security_solution_quality_gate/pipeline.sh

- label: ":pipeline::lock::seedling: Trigger Security Kibana Tests for ${ENVIRONMENT}"
command: echo "replace me with Security specific Kibana tests"
agents:
image: "docker.elastic.co/ci-agent-images/basic-buildkite-agent:1688566364"
- label: ":pipeline::ship::seedling: Trigger Fleet serverless smoke tests for ${ENVIRONMENT}"
trigger: fleet-smoke-tests # https://buildkite.com/elastic/fleet-smoke-tests
soft_fail: true # Remove this before release
build:
env:
ENVIRONMENT: ${ENVIRONMENT}
message: "${BUILDKITE_MESSAGE} (triggered by pipeline.tests-qa.yaml)"

- label: ":pipeline::lock::seedling: Trigger Control Plane Kibana Tests for ${ENVIRONMENT}"
command: echo "replace me with Control Plane specific Kibana tests"
agents:
image: "docker.elastic.co/ci-agent-images/basic-buildkite-agent:1688566364"
- label: ":pipeline::rocket::seedling: Trigger control-plane e2e tests"
trigger: "ess-k8s-qa-e2e-tests-daily" # https://buildkite.com/elastic/ess-k8s-qa-e2e-tests-daily
build:
env:
REGION_ID: aws-eu-west-1
NAME_PREFIX: ci_test_kibana-promotion_
message: "${BUILDKITE_MESSAGE} (triggered by pipeline.tests-qa.yaml)"

- wait: ~

- label: ":judge::seedling: Trigger Manual Tests Phase"
command: "make -C /agent trigger-manual-verification-phase"
if: build.branch == "main"
agents:
image: "docker.elastic.co/ci-agent-images/manual-verification-agent:0.0.1"
image: "docker.elastic.co/ci-agent-images/manual-verification-agent:0.0.2"
25 changes: 12 additions & 13 deletions .buildkite/pipelines/quality-gates/pipeline.tests-staging.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
env:
TEAM_CHANNEL: "#kibana-serverless-release"
ENVIRONMENT: "staging"
# These pipeline steps constitute the quality gate for your service within the staging environment.
# Incorporate any necessary additional logic to validate the service's integrity. A failure in
# this pipeline build will prevent further progression to the subsequent stage.

steps:
- label: ":pipeline::fleet::seedling: Trigger Observability Kibana Tests for ${ENVIRONMENT}"
command: echo "replace me with Observability specific Kibana tests"
agents:
image: "docker.elastic.co/ci-agent-images/basic-buildkite-agent:1688566364"

- label: ":pipeline::lock::seedling: Trigger Security Kibana Tests for ${ENVIRONMENT}"
command: echo "replace me with Security specific Kibana tests"
agents:
image: "docker.elastic.co/ci-agent-images/basic-buildkite-agent:1688566364"
- label: ":pipeline::rocket::seedling: Trigger control-plane e2e tests"
trigger: "ess-k8s-staging-e2e-tests" # https://buildkite.com/elastic/ess-k8s-staging-e2e-tests
build:
env:
REGION_ID: aws-us-east-1
NAME_PREFIX: ci_test_kibana-promotion_
message: "${BUILDKITE_MESSAGE} (triggered by pipeline.tests-staging.yaml)"

- wait: ~

- label: ":judge::seedling: Trigger Manual Tests Phase"
command: "make -C /agent trigger-manual-verification-phase"
if: build.branch == "main"
agents:
image: "docker.elastic.co/ci-agent-images/manual-verification-agent:0.0.1"
image: "docker.elastic.co/ci-agent-images/manual-verification-agent:0.0.2"
19 changes: 10 additions & 9 deletions .buildkite/pipelines/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,32 +105,33 @@ steps:
queue: n2-4-spot
depends_on: build
timeout_in_minutes: 40
parallelism: 16
parallelism: 2
retry:
automatic:
- exit_status: '*'
limit: 1

- command: .buildkite/scripts/steps/functional/security_serverless_explore.sh
label: 'Serverless Explore - Security Solution Cypress Tests'
- command: .buildkite/scripts/steps/functional/security_serverless_investigations.sh
label: 'Serverless Security Investigations Cypress Tests'
agents:
queue: n2-4-spot
depends_on: build
timeout_in_minutes: 60
parallelism: 4
timeout_in_minutes: 120
parallelism: 2
retry:
automatic:
- exit_status: '*'
limit: 1

- command: .buildkite/scripts/steps/functional/security_serverless_investigations.sh
label: 'Serverless Investigations - Security Solution Cypress Tests'
- command: .buildkite/scripts/steps/functional/security_serverless_explore.sh
label: 'Serverless Security Explore Cypress Tests'
agents:
queue: n2-4-spot
depends_on: build
timeout_in_minutes: 120
parallelism: 6
timeout_in_minutes: 60
parallelism: 2
retry:
automatic:
- exit_status: '*'
limit: 1

6 changes: 4 additions & 2 deletions .buildkite/scripts/lifecycle/post_command.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@ if [[ "$IS_TEST_EXECUTION_STEP" == "true" ]]; then
buildkite-agent artifact upload '.es/**/*.hprof'
buildkite-agent artifact upload 'data/es_debug_*.tar.gz'

echo "--- Run Failed Test Reporter"
node scripts/report_failed_tests --build-url="${BUILDKITE_BUILD_URL}#${BUILDKITE_JOB_ID}" 'target/junit/**/*.xml'
if [[ $BUILDKITE_COMMAND_EXIT_STATUS -ne 0 ]]; then
echo "--- Run Failed Test Reporter"
node scripts/report_failed_tests --build-url="${BUILDKITE_BUILD_URL}#${BUILDKITE_JOB_ID}" 'target/junit/**/*.xml'
fi

if [[ -d 'target/test_failures' ]]; then
buildkite-agent artifact upload 'target/test_failures/**/*'
Expand Down
1 change: 1 addition & 0 deletions .buildkite/scripts/pipelines/pull_request/pipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ const uploadPipeline = (pipelineContent: string | object) => {
) {
pipeline.push(getPipeline('.buildkite/pipelines/pull_request/fleet_cypress.yml'));
pipeline.push(getPipeline('.buildkite/pipelines/pull_request/defend_workflows.yml'));
pipeline.push(getPipeline('.buildkite/pipelines/pull_request/osquery_cypress.yml'));
}

if (
Expand Down
2 changes: 1 addition & 1 deletion .buildkite/scripts/steps/functional/defend_workflows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ echo "--- Defend Workflows Cypress tests"
cd x-pack/plugins/security_solution

set +e
yarn cypress:dw:run; status=$?; yarn junit:merge && exit $status
yarn cypress:dw:run; status=$?; yarn junit:merge || :; exit $status
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ echo "--- Defend Workflows Endpoint Cypress tests"
cd x-pack/plugins/security_solution

set +e
yarn cypress:dw:endpoint:run; status=$?; yarn junit:merge && exit $status
yarn cypress:dw:endpoint:run; status=$?; yarn junit:merge || :; exit $status
3 changes: 1 addition & 2 deletions .buildkite/scripts/steps/functional/osquery_cypress.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,4 @@ echo "--- Osquery Cypress tests"

cd x-pack/plugins/osquery

set +e
yarn cypress:run; status=$?; yarn junit:merge && exit $status
yarn --cwd x-pack/plugins/osquery cypress:run
3 changes: 1 addition & 2 deletions .buildkite/scripts/steps/functional/osquery_cypress_burn.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,4 @@ buildkite-agent meta-data set "${BUILDKITE_JOB_ID}_is_test_execution_step" 'fals

echo "--- Osquery Cypress tests, burning changed specs (Chrome)"

set +e
yarn cypress:changed-specs-only; status=$?; yarn junit:merge && exit $status
yarn --cwd x-pack/plugins/osquery cypress:changed-specs-only
2 changes: 1 addition & 1 deletion .buildkite/scripts/steps/functional/response_ops.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ echo "--- Response Ops Cypress Tests on Security Solution"
cd x-pack/test/security_solution_cypress

set +e
yarn cypress:run:respops:ess; status=$?; yarn junit:merge && exit $status
yarn cypress:run:respops:ess; status=$?; yarn junit:merge || :; exit $status
2 changes: 1 addition & 1 deletion .buildkite/scripts/steps/functional/response_ops_cases.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ echo "--- Response Ops Cases Cypress Tests on Security Solution"
cd x-pack/test/security_solution_cypress

set +e
yarn cypress:run:cases:ess; status=$?; yarn junit:merge && exit $status
yarn cypress:run:cases:ess; status=$?; yarn junit:merge || :; exit $status
2 changes: 1 addition & 1 deletion .buildkite/scripts/steps/functional/security_serverless.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ echo "--- Security Serverless Cypress Tests"
cd x-pack/test/security_solution_cypress

set +e
yarn cypress:run:serverless; status=$?; yarn junit:merge && exit $status
yarn cypress:run:serverless; status=$?; yarn junit:merge || :; exit $status
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ echo "--- Explore - Security Solution Cypress Tests"
cd x-pack/test/security_solution_cypress

set +e
yarn cypress:explore:run:serverless; status=$?; yarn junit:merge && exit $status
yarn cypress:explore:run:serverless; status=$?; yarn junit:merge || :; exit $status
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ echo "--- Investigations Cypress Tests on Serverless"
cd x-pack/test/security_solution_cypress

set +e
yarn cypress:investigations:run:serverless; status=$?; yarn junit:merge && exit $status
yarn cypress:investigations:run:serverless; status=$?; yarn junit:merge || :; exit $status
2 changes: 1 addition & 1 deletion .buildkite/scripts/steps/functional/security_solution.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ echo "--- Security Solution Cypress tests (Chrome)"
cd x-pack/test/security_solution_cypress

set +e
yarn cypress:run:ess; status=$?; yarn junit:merge && exit $status
yarn cypress:run:ess; status=$?; yarn junit:merge || :; exit $status
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ echo "--- Explore Cypress Tests on Security Solution"
cd x-pack/test/security_solution_cypress

set +e
yarn cypress:explore:run:ess; status=$?; yarn junit:merge && exit $status
yarn cypress:explore:run:ess; status=$?; yarn junit:merge || :; exit $status
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ echo "--- Investigations - Security Solution Cypress Tests"
cd x-pack/test/security_solution_cypress

set +e
yarn cypress:investigations:run:ess; status=$?; yarn junit:merge && exit $status
yarn cypress:investigations:run:ess; status=$?; yarn junit:merge || :; exit $status
10 changes: 7 additions & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -909,11 +909,15 @@ module.exports = {
{
files: [
'x-pack/plugins/apm/**/*.{js,mjs,ts,tsx}',
'x-pack/plugins/observability/**/*.{js,mjs,ts,tsx}',
'x-pack/plugins/exploratory_view/**/*.{js,mjs,ts,tsx}',
'x-pack/plugins/ux/**/*.{js,mjs,ts,tsx}',
'x-pack/plugins/synthetics/**/*.{js,mjs,ts,tsx}',
'x-pack/plugins/infra/**/*.{js,mjs,ts,tsx}',
'x-pack/plugins/observability/**/*.{js,mjs,ts,tsx}',
'x-pack/plugins/observability_ai_assistant/**/*.{js,mjs,ts,tsx}',
'x-pack/plugins/observability_onboarding/**/*.{js,mjs,ts,tsx}',
'x-pack/plugins/observability_shared/**/*.{js,mjs,ts,tsx}',
'x-pack/plugins/profiling/**/*.{js,mjs,ts,tsx}',
'x-pack/plugins/synthetics/**/*.{js,mjs,ts,tsx}',
'x-pack/plugins/ux/**/*.{js,mjs,ts,tsx}',
],
rules: {
'@kbn/telemetry/event_generating_elements_should_be_instrumented': 'error',
Expand Down
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,7 @@ src/plugins/screenshot_mode @elastic/appex-sharedux
x-pack/examples/screenshotting_example @elastic/appex-sharedux
x-pack/plugins/screenshotting @elastic/kibana-reporting-services
packages/kbn-search-api-panels @elastic/enterprise-search-frontend
packages/kbn-search-connectors @elastic/enterprise-search-frontend
examples/search_examples @elastic/kibana-data-discovery
packages/kbn-search-response-warnings @elastic/kibana-data-discovery
x-pack/plugins/searchprofiler @elastic/platform-deployment-management
Expand Down Expand Up @@ -1315,6 +1316,7 @@ x-pack/test/security_solution_cypress/config.ts @elastic/security-engineering-pr
x-pack/test/security_solution_cypress/runner.ts @elastic/security-engineering-productivity
x-pack/test/security_solution_cypress/serverless_config.ts @elastic/security-engineering-productivity
x-pack/test/security_solution_cypress/cypress/tags.ts @elastic/security-engineering-productivity
x-pack/plugins/security_solution/scripts/run_cypress @MadameSheema @patrykkopycinski @oatkiller @maximpn @banderror

## Security Solution sub teams - adaptive-workload-protection
x-pack/plugins/security_solution/public/common/components/sessions_viewer @elastic/kibana-cloud-security-posture
Expand Down
Loading

0 comments on commit 2a3e6cd

Please sign in to comment.