Skip to content

Commit

Permalink
Merge into branch
Browse files Browse the repository at this point in the history
  • Loading branch information
qn895 committed Aug 28, 2023
2 parents 7c5964d + 9f83684 commit c1a153c
Show file tree
Hide file tree
Showing 2,525 changed files with 83,884 additions and 62,323 deletions.
4 changes: 3 additions & 1 deletion .buildkite/ftr_configs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ disabled:
- x-pack/plugins/observability_onboarding/e2e/ftr_config_runner.ts
- x-pack/plugins/observability_onboarding/e2e/ftr_config.ts
- x-pack/test/osquery_cypress/cli_config.ts
- x-pack/test/osquery_cypress/serverless_cli_config.ts
- x-pack/test/osquery_cypress/config.ts
- x-pack/test/osquery_cypress/visual_config.ts
- x-pack/test/security_solution_cypress/cli_config.ts
Expand Down Expand Up @@ -265,6 +266,7 @@ enabled:
- x-pack/test/functional_with_es_ssl/apps/cases/group2/config.ts
- x-pack/test/functional_with_es_ssl/apps/discover_ml_uptime/config.ts
- x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/config.ts
- x-pack/test/functional_with_es_ssl/apps/triggers_actions_ui/shared/config.ts
- x-pack/test/functional/apps/advanced_settings/config.ts
- x-pack/test/functional/apps/aiops/config.ts
- x-pack/test/functional/apps/api_keys/config.ts
Expand Down Expand Up @@ -353,7 +355,6 @@ enabled:
- x-pack/test/reporting_functional/reporting_and_deprecated_security.config.ts
- x-pack/test/reporting_functional/reporting_and_security.config.ts
- x-pack/test/reporting_functional/reporting_without_security.config.ts
- x-pack/test/reporting_functional/reporting_and_timeout.config.ts
- x-pack/test/rule_registry/security_and_spaces/config_basic.ts
- x-pack/test/rule_registry/security_and_spaces/config_trial.ts
- x-pack/test/rule_registry/spaces_only/config_basic.ts
Expand Down Expand Up @@ -418,6 +419,7 @@ enabled:
- x-pack/performance/journeys/ecommerce_dashboard_saved_search_only.ts
- x-pack/performance/journeys/ecommerce_dashboard_tsvb_gauge_only.ts
- x-pack/performance/journeys/dashboard_listing_page.ts
- x-pack/performance/journeys/tags_listing_page.ts
- x-pack/performance/journeys/cloud_security_dashboard.ts
- x-pack/performance/journeys/apm_service_inventory.ts
- x-pack/test/custom_branding/config.ts
Expand Down
18 changes: 4 additions & 14 deletions .buildkite/pipelines/on_merge_unsupported_ftrs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,25 +55,21 @@ steps:
queue: n2-4-spot
depends_on: build
timeout_in_minutes: 120
parallelism: 4
parallelism: 14
retry:
automatic:
- exit_status: '-1'
limit: 3
- exit_status: '*'
limit: 1

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

Expand All @@ -86,11 +82,9 @@ steps:
parallelism: 2
retry:
automatic:
- exit_status: '-1'
limit: 3
- exit_status: '*'
limit: 1

- command: .buildkite/scripts/steps/functional/defend_workflows.sh
label: 'Defend Workflows Cypress Tests'
agents:
Expand All @@ -100,8 +94,6 @@ steps:
parallelism: 2
retry:
automatic:
- exit_status: '-1'
limit: 3
- exit_status: '*'
limit: 1
artifact_paths:
Expand All @@ -116,8 +108,6 @@ steps:
parallelism: 6
retry:
automatic:
- exit_status: '-1'
limit: 3
- exit_status: '*'
limit: 1
artifact_paths:
Expand Down
4 changes: 2 additions & 2 deletions .buildkite/pipelines/pull_request/base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ steps:
queue: n2-4-spot
depends_on: build
timeout_in_minutes: 40
parallelism: 10
parallelism: 16
soft_fail: true
retry:
automatic:
Expand Down Expand Up @@ -130,7 +130,7 @@ steps:
queue: n2-4-spot
depends_on: build
timeout_in_minutes: 40
parallelism: 4
parallelism: 6
soft_fail: true
retry:
automatic:
Expand Down
4 changes: 2 additions & 2 deletions .buildkite/pipelines/pull_request/defend_workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ steps:
- command: .buildkite/scripts/steps/functional/defend_workflows_vagrant.sh
label: 'Defend Workflows Endpoint Cypress Tests'
agents:
queue: n2-16-virt
queue: n2-4-virt
depends_on: build
timeout_in_minutes: 120
parallelism: 6
parallelism: 5
retry:
automatic:
- exit_status: '*'
Expand Down
16 changes: 16 additions & 0 deletions .buildkite/pipelines/pull_request/osquery_cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,21 @@ steps:
depends_on: build
timeout_in_minutes: 50
soft_fail: true
retry:
automatic: false
artifact_paths:
- "target/kibana-osquery/**/*"

- command: .buildkite/scripts/steps/functional/security_serverless_osquery.sh
label: 'Serverless Osquery Cypress Tests'
agents:
queue: n2-4-spot
depends_on: build
timeout_in_minutes: 50
parallelism: 6
retry:
automatic:
- exit_status: '*'
limit: 1
artifact_paths:
- "target/kibana-osquery/**/*"
23 changes: 16 additions & 7 deletions .buildkite/pipelines/pull_request/security_solution.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,41 +5,41 @@ steps:
queue: n2-4-spot
depends_on: build
timeout_in_minutes: 60
parallelism: 10
parallelism: 16
retry:
automatic:
- exit_status: '*'
limit: 1
artifact_paths:
- "target/kibana-security-solution/**/*"
- 'target/kibana-security-solution/**/*'

- command: .buildkite/scripts/steps/functional/security_solution_explore.sh
label: 'Explore - Security Solution Cypress Tests'
agents:
queue: n2-4-spot
depends_on: build
timeout_in_minutes: 60
parallelism: 2
parallelism: 4
retry:
automatic:
- exit_status: '*'
limit: 1
artifact_paths:
- "target/kibana-security-solution/**/*"
- 'target/kibana-security-solution/**/*'

- command: .buildkite/scripts/steps/functional/security_solution_investigations.sh
label: 'Investigations - Security Solution Cypress Tests'
agents:
queue: n2-4-spot
depends_on: build
timeout_in_minutes: 120
parallelism: 4
parallelism: 6
retry:
automatic:
- exit_status: '*'
limit: 1
artifact_paths:
- "target/kibana-security-solution/**/*"
- 'target/kibana-security-solution/**/*'

- command: .buildkite/scripts/steps/functional/security_solution_burn.sh
label: 'Security Solution Cypress tests, burning changed specs'
Expand All @@ -48,6 +48,15 @@ steps:
depends_on: build
timeout_in_minutes: 120
parallelism: 1
retry:
automatic: false
soft_fail: true
artifact_paths:
- "target/kibana-security-solution/**/*"
- 'target/kibana-security-solution/**/*'

- command: .buildkite/scripts/steps/code_generation/security_solution_codegen.sh
label: 'Security Solution OpenAPI codegen'
agents:
queue: n2-2-spot
timeout_in_minutes: 60
parallelism: 1
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
steps:
- label: ":pipeline::kibana::seedling: Trigger Kibana Tests for ${ENVIRONMENT}"
command: echo "replace me with Kibana specific tests"
agent:
image: "docker.elastic.co/ci-agent-images/basic-buildkite-agent:1688566364"

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

Expand Down
5 changes: 5 additions & 0 deletions .buildkite/pipelines/quality-gates/pipeline.tests-qa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,8 @@ steps:
command: echo "replace me with Security specific Kibana tests"
agent:
image: "docker.elastic.co/ci-agent-images/basic-buildkite-agent:1688566364"

- label: ":pipeline::lock::seedling: Trigger Control Plane Kibana Tests for ${ENVIRONMENT}"
command: echo "replace me with Control Plane specific Kibana tests"
agent:
image: "docker.elastic.co/ci-agent-images/basic-buildkite-agent:1688566364"
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
steps:
- label: ":pipeline::kibana::seedling: Trigger Kibana Tests for ${ENVIRONMENT}"
command: echo "replace me with Kibana specific tests"
agent:
image: "docker.elastic.co/ci-agent-images/basic-buildkite-agent:1688566364"

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

Expand Down
34 changes: 3 additions & 31 deletions .buildkite/pipelines/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,35 +66,7 @@ steps:
queue: n2-4-spot
depends_on: build
timeout_in_minutes: 40
parallelism: 12
retry:
automatic:
- exit_status: '*'
limit: 1
artifact_paths:
- "target/kibana-security-serverless/**/*"

- command: .buildkite/scripts/steps/functional/security_serverless.sh
label: 'Explore - Security Solution Cypress Tests'
agents:
queue: n2-4-spot
depends_on: build
timeout_in_minutes: 40
parallelism: 12
retry:
automatic:
- exit_status: '*'
limit: 1
artifact_paths:
- "target/kibana-security-serverless/**/*"

- command: .buildkite/scripts/steps/functional/security_serverless.sh
label: 'Serverless Security Cypress Tests'
agents:
queue: n2-4-spot
depends_on: build
timeout_in_minutes: 40
parallelism: 12
parallelism: 16
retry:
automatic:
- exit_status: '*'
Expand All @@ -103,7 +75,7 @@ steps:
- "target/kibana-security-serverless/**/*"

- command: .buildkite/scripts/steps/functional/security_serverless_explore.sh
label: 'Explore - Security Solution Cypress Tests'
label: 'Serverless Explore - Security Solution Cypress Tests'
agents:
queue: n2-4-spot
depends_on: build
Expand All @@ -117,7 +89,7 @@ steps:
- "target/kibana-security-serverless/**/*"

- command: .buildkite/scripts/steps/functional/security_serverless_investigations.sh
label: 'Investigations - Security Solution Cypress Tests'
label: 'Serverless Investigations - Security Solution Cypress Tests'
agents:
queue: n2-4-spot
depends_on: build
Expand Down
4 changes: 2 additions & 2 deletions .buildkite/scripts/common/util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ check_for_changed_files() {

SHOULD_AUTO_COMMIT_CHANGES="${2:-}"
CUSTOM_FIX_MESSAGE="${3:-}"
GIT_CHANGES="$(git ls-files --modified -- . ':!:.bazelrc')"
GIT_CHANGES="$(git status --porcelain -- . ':!:.bazelrc')"

if [ "$GIT_CHANGES" ]; then
if ! is_auto_commit_disabled && [[ "$SHOULD_AUTO_COMMIT_CHANGES" == "true" && "${BUILDKITE_PULL_REQUEST:-}" ]]; then
Expand All @@ -54,7 +54,7 @@ check_for_changed_files() {
git config --global user.name kibanamachine
git config --global user.email '[email protected]'
gh pr checkout "${BUILDKITE_PULL_REQUEST}"
git add -u -- . ':!.bazelrc'
git add -A -- . ':!.bazelrc'

git commit -m "$NEW_COMMIT_MESSAGE"
git push
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 @@ -10,6 +10,7 @@ import { execSync } from 'child_process';
import fs from 'fs';
import prConfigs from '../../../pull_requests.json';
import { areChangesSkippable, doAnyChangesMatch } from '#pipeline-utils';

const prConfig = prConfigs.jobs.find((job) => job.pipelineSlug === 'kibana-pull-request');

if (!prConfig) {
Expand Down
16 changes: 8 additions & 8 deletions .buildkite/scripts/steps/add_gh_labels_to_bk_metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ const fetchLabels = (prNumber: PrNumber) =>

try {
const labels = pipe(head, firstMatch, parseInt10, fetchLabels)(`${process.env[parseTarget]}`);
execSync(`buildkite-agent meta-data set gh_labels ${labels}`);
if (alsoAnnotate)
execSync(
`buildkite-agent annotate --context 'default' --style 'info' "Github Labels: ${labels}"`
);
if (labels) {
execSync(`buildkite-agent meta-data set gh_labels ${labels}`);
if (alsoAnnotate)
execSync(
`buildkite-agent annotate --context 'default' --style 'info' "Github Labels: ${labels}"`
);
}
} catch (e) {
console.error(
`\n!!! Error fetching Github Labels (stringified): \n${JSON.stringify(e, null, 2)}`
);
console.error(`Error fetching Github Labels for issue ${firstMatch}`);
}

export {};
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash

set -euo pipefail

source .buildkite/scripts/common/util.sh

.buildkite/scripts/bootstrap.sh

echo --- Security Solution OpenAPI Code Generation

(cd x-pack/plugins/security_solution && yarn openapi:generate)
check_for_changed_files "yarn openapi:generate" true
2 changes: 1 addition & 1 deletion .buildkite/scripts/steps/functional/apm_cypress.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ GH_APM_TEAM_LABEL="Team:APM"
if (! is_pr); then
echo "--- Add GH labels to buildkite metadata"
ts-node .buildkite/scripts/steps/add_gh_labels_to_bk_metadata.ts BUILDKITE_MESSAGE true
GH_ON_MERGE_LABELS="$(buildkite-agent meta-data get gh_labels)"
GH_ON_MERGE_LABELS="$(buildkite-agent meta-data get gh_labels --default '')"
fi

# Enabling cypress dashboard recording when PR is labeled with `apm:cypress-record` and we are not using the flaky test runner OR on merge with Team:APM label applied
Expand Down
4 changes: 3 additions & 1 deletion .buildkite/scripts/steps/functional/defend_workflows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ export KIBANA_INSTALL_DIR=${KIBANA_BUILD_LOCATION}

echo "--- Defend Workflows Cypress tests"

yarn --cwd x-pack/plugins/security_solution cypress:dw:run
cd x-pack/plugins/security_solution

yarn cypress:dw:run; status=$?; yarn junit:merge && exit $status
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ source .buildkite/scripts/steps/functional/common_cypress.sh
export JOB=kibana-defend-workflows-endpoint-cypress
export KIBANA_INSTALL_DIR=${KIBANA_BUILD_LOCATION}


echo "--- Defend Workflows Endpoint Cypress tests"

yarn --cwd x-pack/plugins/security_solution cypress:dw:endpoint:run
cd x-pack/plugins/security_solution

yarn cypress:dw:endpoint:run; status=$?; yarn junit:merge && exit $status
Loading

0 comments on commit c1a153c

Please sign in to comment.