From 644e1bfca5a8ccf6f830e1ffd5af2a7486ba641b Mon Sep 17 00:00:00 2001 From: Jon Date: Wed, 30 Oct 2024 13:10:10 -0500 Subject: [PATCH] [ci] Run type checking before tests (#197539) --- .buildkite/pipelines/on_merge.yml | 95 ++++--------------- .../pipelines/pull_request/apm_cypress.yml | 1 + .buildkite/pipelines/pull_request/base.yml | 28 +++--- .../pipelines/pull_request/deploy_cloud.yml | 1 + .../pull_request/exploratory_view_plugin.yml | 1 + .buildkite/pipelines/pull_request/fips.yml | 1 + .../pipelines/pull_request/fleet_cypress.yml | 1 + .../pull_request/inventory_cypress.yml | 1 + .../pipelines/pull_request/kbn_handlebars.yml | 1 + .../observability_onboarding_cypress.yml | 1 + .../pull_request/profiling_cypress.yml | 1 + .../pipelines/pull_request/response_ops.yml | 1 + .../pull_request/response_ops_cases.yml | 1 + .../security_solution/ai_assistant.yml | 1 + .../cloud_security_posture.yml | 2 + .../security_solution/cypress_burn.yml | 3 + .../security_solution/defend_workflows.yml | 1 + .../security_solution/detection_engine.yml | 2 + .../security_solution/entity_analytics.yml | 1 + .../security_solution/explore.yml | 1 + .../security_solution/investigations.yml | 1 + .../security_solution/osquery_cypress.yml | 1 + .../security_solution/playwright.yml | 1 + .../security_solution/rule_management.yml | 2 + .../pipelines/pull_request/slo_plugin_e2e.yml | 1 + .../pull_request/synthetics_plugin.yml | 1 + .../pipelines/pull_request/uptime_plugin.yml | 1 + .../pipelines/pull_request/ux_plugin_e2e.yml | 1 + 28 files changed, 63 insertions(+), 91 deletions(-) diff --git a/.buildkite/pipelines/on_merge.yml b/.buildkite/pipelines/on_merge.yml index 3705a2c90264..df3a74270677 100644 --- a/.buildkite/pipelines/on_merge.yml +++ b/.buildkite/pipelines/on_merge.yml @@ -39,7 +39,6 @@ steps: provider: gcp machineType: n2-highcpu-8 preemptible: true - key: quick_checks timeout_in_minutes: 60 retry: automatic: @@ -54,7 +53,6 @@ steps: provider: gcp machineType: n2-standard-16 preemptible: true - key: linting timeout_in_minutes: 60 retry: automatic: @@ -69,8 +67,23 @@ steps: provider: gcp machineType: n2-standard-32 preemptible: true - key: linting_with_types - timeout_in_minutes: 90 + timeout_in_minutes: 60 + retry: + automatic: + - exit_status: '-1' + limit: 3 + + - command: .buildkite/scripts/steps/check_types.sh + label: 'Check Types' + agents: + image: family/kibana-ubuntu-2004 + imageProject: elastic-images-prod + provider: gcp + machineType: c4-standard-4 + diskType: 'hyperdisk-balanced' + preemptible: true + spotZones: us-central1-a,us-central1-b,us-central1-c + timeout_in_minutes: 60 retry: automatic: - exit_status: '-1' @@ -136,11 +149,6 @@ steps: provider: gcp machineType: n2-standard-4 preemptible: true - depends_on: - - build - - quick_checks - - linting - - linting_with_types timeout_in_minutes: 60 parallelism: 2 retry: @@ -156,11 +164,6 @@ steps: provider: gcp machineType: n2-standard-4 preemptible: true - depends_on: - - build - - quick_checks - - linting - - linting_with_types timeout_in_minutes: 60 parallelism: 4 retry: @@ -176,11 +179,6 @@ steps: provider: gcp machineType: n2-standard-4 preemptible: true - depends_on: - - build - - quick_checks - - linting - - linting_with_types timeout_in_minutes: 60 parallelism: 6 retry: @@ -196,11 +194,6 @@ steps: provider: gcp machineType: n2-standard-4 preemptible: true - depends_on: - - build - - quick_checks - - linting - - linting_with_types timeout_in_minutes: 60 parallelism: 5 retry: @@ -216,11 +209,6 @@ steps: provider: gcp machineType: n2-standard-4 preemptible: true - depends_on: - - build - - quick_checks - - linting - - linting_with_types timeout_in_minutes: 60 parallelism: 6 retry: @@ -236,11 +224,6 @@ steps: provider: gcp machineType: n2-standard-4 preemptible: true - depends_on: - - build - - quick_checks - - linting - - linting_with_types timeout_in_minutes: 60 parallelism: 1 retry: @@ -256,11 +239,6 @@ steps: provider: gcp machineType: n2-standard-4 preemptible: true - depends_on: - - build - - quick_checks - - linting - - linting_with_types timeout_in_minutes: 60 parallelism: 2 retry: @@ -276,11 +254,6 @@ steps: provider: gcp machineType: n2-standard-4 preemptible: true - depends_on: - - build - - quick_checks - - linting - - linting_with_types timeout_in_minutes: 60 parallelism: 2 retry: @@ -296,11 +269,6 @@ steps: provider: gcp machineType: n2-standard-4 preemptible: true - depends_on: - - build - - quick_checks - - linting - - linting_with_types timeout_in_minutes: 60 parallelism: 6 retry: @@ -316,11 +284,6 @@ steps: provider: gcp machineType: n2-standard-4 preemptible: true - depends_on: - - build - - quick_checks - - linting - - linting_with_types timeout_in_minutes: 60 parallelism: 8 retry: @@ -338,11 +301,6 @@ steps: localSsds: 1 localSsdInterface: nvme machineType: n2-standard-4 - depends_on: - - build - - quick_checks - - linting - - linting_with_types timeout_in_minutes: 60 parallelism: 20 retry: @@ -353,11 +311,6 @@ steps: - command: '.buildkite/scripts/steps/functional/on_merge_unsupported_ftrs.sh' label: Trigger unsupported ftr tests timeout_in_minutes: 10 - depends_on: - - build - - quick_checks - - linting - - linting_with_types agents: image: family/kibana-ubuntu-2004 imageProject: elastic-images-prod @@ -378,20 +331,6 @@ steps: - exit_status: '-1' limit: 3 - - command: .buildkite/scripts/steps/check_types.sh - label: 'Check Types' - agents: - image: family/kibana-ubuntu-2004 - imageProject: elastic-images-prod - provider: gcp - machineType: n2-standard-4 - preemptible: true - timeout_in_minutes: 70 - retry: - automatic: - - exit_status: '-1' - limit: 3 - - command: .buildkite/scripts/steps/checks/capture_oas_snapshot.sh label: 'Check OAS Snapshot' agents: diff --git a/.buildkite/pipelines/pull_request/apm_cypress.yml b/.buildkite/pipelines/pull_request/apm_cypress.yml index 9d2cca6d9d45..c0cb60dbc986 100644 --- a/.buildkite/pipelines/pull_request/apm_cypress.yml +++ b/.buildkite/pipelines/pull_request/apm_cypress.yml @@ -9,6 +9,7 @@ steps: - quick_checks - linting - linting_with_types + - check_types timeout_in_minutes: 120 parallelism: 1 # TODO: Set parallelism when apm_cypress handles it retry: diff --git a/.buildkite/pipelines/pull_request/base.yml b/.buildkite/pipelines/pull_request/base.yml index fdc80e6cb859..54840cb43c65 100644 --- a/.buildkite/pipelines/pull_request/base.yml +++ b/.buildkite/pipelines/pull_request/base.yml @@ -50,7 +50,21 @@ steps: machineType: n2-standard-32 preemptible: true key: linting_with_types - timeout_in_minutes: 90 + timeout_in_minutes: 60 + retry: + automatic: + - exit_status: '-1' + limit: 3 + + - command: .buildkite/scripts/steps/check_types.sh + label: 'Check Types' + agents: + machineType: c4-standard-4 + diskType: 'hyperdisk-balanced' + preemptible: true + spotZones: us-central1-a,us-central1-b,us-central1-c + key: check_types + timeout_in_minutes: 60 retry: automatic: - exit_status: '-1' @@ -85,18 +99,6 @@ steps: - exit_status: '*' limit: 1 - - command: .buildkite/scripts/steps/check_types.sh - label: 'Check Types' - agents: - machineType: n2-standard-4 - preemptible: true - key: check_types - timeout_in_minutes: 70 - retry: - automatic: - - exit_status: '-1' - limit: 3 - - command: .buildkite/scripts/steps/checks.sh label: 'Checks' key: checks diff --git a/.buildkite/pipelines/pull_request/deploy_cloud.yml b/.buildkite/pipelines/pull_request/deploy_cloud.yml index e82d1ef2e494..6b42037b9595 100644 --- a/.buildkite/pipelines/pull_request/deploy_cloud.yml +++ b/.buildkite/pipelines/pull_request/deploy_cloud.yml @@ -9,6 +9,7 @@ steps: - quick_checks - linting - linting_with_types + - check_types timeout_in_minutes: 30 soft_fail: true retry: diff --git a/.buildkite/pipelines/pull_request/exploratory_view_plugin.yml b/.buildkite/pipelines/pull_request/exploratory_view_plugin.yml index 42aaf59b1c1f..c46edb528987 100644 --- a/.buildkite/pipelines/pull_request/exploratory_view_plugin.yml +++ b/.buildkite/pipelines/pull_request/exploratory_view_plugin.yml @@ -9,6 +9,7 @@ steps: - quick_checks - linting - linting_with_types + - check_types timeout_in_minutes: 60 artifact_paths: - 'x-pack/plugins/observability_solution/exploratory_view/e2e/.journeys/**/*' diff --git a/.buildkite/pipelines/pull_request/fips.yml b/.buildkite/pipelines/pull_request/fips.yml index 3fa0ed9bd206..1a759e128832 100644 --- a/.buildkite/pipelines/pull_request/fips.yml +++ b/.buildkite/pipelines/pull_request/fips.yml @@ -9,6 +9,7 @@ steps: - quick_checks - linting - linting_with_types + - check_types timeout_in_minutes: 60 soft_fail: true retry: diff --git a/.buildkite/pipelines/pull_request/fleet_cypress.yml b/.buildkite/pipelines/pull_request/fleet_cypress.yml index 071106209caa..d20591728b78 100644 --- a/.buildkite/pipelines/pull_request/fleet_cypress.yml +++ b/.buildkite/pipelines/pull_request/fleet_cypress.yml @@ -9,6 +9,7 @@ steps: - quick_checks - linting - linting_with_types + - check_types timeout_in_minutes: 50 parallelism: 6 retry: diff --git a/.buildkite/pipelines/pull_request/inventory_cypress.yml b/.buildkite/pipelines/pull_request/inventory_cypress.yml index b1a8b999f09f..7028b55808ca 100644 --- a/.buildkite/pipelines/pull_request/inventory_cypress.yml +++ b/.buildkite/pipelines/pull_request/inventory_cypress.yml @@ -9,6 +9,7 @@ steps: - quick_checks - linting - linting_with_types + - check_types timeout_in_minutes: 120 parallelism: 1 retry: diff --git a/.buildkite/pipelines/pull_request/kbn_handlebars.yml b/.buildkite/pipelines/pull_request/kbn_handlebars.yml index ad338ec425a0..36901a5d5c55 100644 --- a/.buildkite/pipelines/pull_request/kbn_handlebars.yml +++ b/.buildkite/pipelines/pull_request/kbn_handlebars.yml @@ -9,6 +9,7 @@ steps: - quick_checks - linting - linting_with_types + - check_types timeout_in_minutes: 5 retry: automatic: diff --git a/.buildkite/pipelines/pull_request/observability_onboarding_cypress.yml b/.buildkite/pipelines/pull_request/observability_onboarding_cypress.yml index d0afe1cd138d..8906cc72fa81 100644 --- a/.buildkite/pipelines/pull_request/observability_onboarding_cypress.yml +++ b/.buildkite/pipelines/pull_request/observability_onboarding_cypress.yml @@ -9,6 +9,7 @@ steps: - quick_checks - linting - linting_with_types + - check_types timeout_in_minutes: 120 retry: automatic: diff --git a/.buildkite/pipelines/pull_request/profiling_cypress.yml b/.buildkite/pipelines/pull_request/profiling_cypress.yml index 2b86cffe75fa..100e42206b3a 100644 --- a/.buildkite/pipelines/pull_request/profiling_cypress.yml +++ b/.buildkite/pipelines/pull_request/profiling_cypress.yml @@ -9,6 +9,7 @@ steps: - quick_checks - linting - linting_with_types + - check_types timeout_in_minutes: 120 parallelism: 2 retry: diff --git a/.buildkite/pipelines/pull_request/response_ops.yml b/.buildkite/pipelines/pull_request/response_ops.yml index a5c9b27ee7ec..f09beb168259 100644 --- a/.buildkite/pipelines/pull_request/response_ops.yml +++ b/.buildkite/pipelines/pull_request/response_ops.yml @@ -9,6 +9,7 @@ steps: - quick_checks - linting - linting_with_types + - check_types timeout_in_minutes: 120 parallelism: 9 retry: diff --git a/.buildkite/pipelines/pull_request/response_ops_cases.yml b/.buildkite/pipelines/pull_request/response_ops_cases.yml index 994fbb6c4963..5382ab6017fa 100644 --- a/.buildkite/pipelines/pull_request/response_ops_cases.yml +++ b/.buildkite/pipelines/pull_request/response_ops_cases.yml @@ -9,6 +9,7 @@ steps: - quick_checks - linting - linting_with_types + - check_types timeout_in_minutes: 120 retry: automatic: diff --git a/.buildkite/pipelines/pull_request/security_solution/ai_assistant.yml b/.buildkite/pipelines/pull_request/security_solution/ai_assistant.yml index 6b87f41d585f..de0cf4daefe7 100644 --- a/.buildkite/pipelines/pull_request/security_solution/ai_assistant.yml +++ b/.buildkite/pipelines/pull_request/security_solution/ai_assistant.yml @@ -9,6 +9,7 @@ steps: - quick_checks - linting - linting_with_types + - check_types timeout_in_minutes: 60 parallelism: 1 retry: diff --git a/.buildkite/pipelines/pull_request/security_solution/cloud_security_posture.yml b/.buildkite/pipelines/pull_request/security_solution/cloud_security_posture.yml index 93fad6eecf16..d2f1571f9d93 100644 --- a/.buildkite/pipelines/pull_request/security_solution/cloud_security_posture.yml +++ b/.buildkite/pipelines/pull_request/security_solution/cloud_security_posture.yml @@ -9,6 +9,7 @@ steps: - quick_checks - linting - linting_with_types + - check_types timeout_in_minutes: 60 parallelism: 1 retry: @@ -26,6 +27,7 @@ steps: - quick_checks - linting - linting_with_types + - check_types timeout_in_minutes: 60 parallelism: 1 retry: diff --git a/.buildkite/pipelines/pull_request/security_solution/cypress_burn.yml b/.buildkite/pipelines/pull_request/security_solution/cypress_burn.yml index 1ba22d058e6c..fc9fab0dec2a 100644 --- a/.buildkite/pipelines/pull_request/security_solution/cypress_burn.yml +++ b/.buildkite/pipelines/pull_request/security_solution/cypress_burn.yml @@ -11,6 +11,7 @@ steps: - quick_checks - linting - linting_with_types + - check_types timeout_in_minutes: 60 soft_fail: true parallelism: 1 @@ -27,6 +28,7 @@ steps: - quick_checks - linting - linting_with_types + - check_types timeout_in_minutes: 60 parallelism: 1 retry: @@ -43,6 +45,7 @@ steps: - quick_checks - linting - linting_with_types + - check_types timeout_in_minutes: 50 soft_fail: true retry: diff --git a/.buildkite/pipelines/pull_request/security_solution/defend_workflows.yml b/.buildkite/pipelines/pull_request/security_solution/defend_workflows.yml index ea7613fd81cb..e8b399ed3ef6 100644 --- a/.buildkite/pipelines/pull_request/security_solution/defend_workflows.yml +++ b/.buildkite/pipelines/pull_request/security_solution/defend_workflows.yml @@ -11,6 +11,7 @@ steps: - quick_checks - linting - linting_with_types + - check_types timeout_in_minutes: 60 parallelism: 20 retry: diff --git a/.buildkite/pipelines/pull_request/security_solution/detection_engine.yml b/.buildkite/pipelines/pull_request/security_solution/detection_engine.yml index f18d187aab9e..e879d2ad267f 100644 --- a/.buildkite/pipelines/pull_request/security_solution/detection_engine.yml +++ b/.buildkite/pipelines/pull_request/security_solution/detection_engine.yml @@ -9,6 +9,7 @@ steps: - quick_checks - linting - linting_with_types + - check_types timeout_in_minutes: 60 parallelism: 5 retry: @@ -26,6 +27,7 @@ steps: - quick_checks - linting - linting_with_types + - check_types timeout_in_minutes: 60 parallelism: 2 retry: diff --git a/.buildkite/pipelines/pull_request/security_solution/entity_analytics.yml b/.buildkite/pipelines/pull_request/security_solution/entity_analytics.yml index 16e1860a1453..4e74af8f8074 100644 --- a/.buildkite/pipelines/pull_request/security_solution/entity_analytics.yml +++ b/.buildkite/pipelines/pull_request/security_solution/entity_analytics.yml @@ -9,6 +9,7 @@ steps: - quick_checks - linting - linting_with_types + - check_types timeout_in_minutes: 60 parallelism: 2 retry: diff --git a/.buildkite/pipelines/pull_request/security_solution/explore.yml b/.buildkite/pipelines/pull_request/security_solution/explore.yml index 5fa4229e7dbd..5121899c17a5 100644 --- a/.buildkite/pipelines/pull_request/security_solution/explore.yml +++ b/.buildkite/pipelines/pull_request/security_solution/explore.yml @@ -9,6 +9,7 @@ steps: - quick_checks - linting - linting_with_types + - check_types timeout_in_minutes: 60 parallelism: 2 retry: diff --git a/.buildkite/pipelines/pull_request/security_solution/investigations.yml b/.buildkite/pipelines/pull_request/security_solution/investigations.yml index 469f6d7a2c15..f33634118fad 100644 --- a/.buildkite/pipelines/pull_request/security_solution/investigations.yml +++ b/.buildkite/pipelines/pull_request/security_solution/investigations.yml @@ -9,6 +9,7 @@ steps: - quick_checks - linting - linting_with_types + - check_types timeout_in_minutes: 60 parallelism: 7 retry: diff --git a/.buildkite/pipelines/pull_request/security_solution/osquery_cypress.yml b/.buildkite/pipelines/pull_request/security_solution/osquery_cypress.yml index cb04f1559f3b..8d7650e93647 100644 --- a/.buildkite/pipelines/pull_request/security_solution/osquery_cypress.yml +++ b/.buildkite/pipelines/pull_request/security_solution/osquery_cypress.yml @@ -9,6 +9,7 @@ steps: - quick_checks - linting - linting_with_types + - check_types timeout_in_minutes: 60 parallelism: 8 retry: diff --git a/.buildkite/pipelines/pull_request/security_solution/playwright.yml b/.buildkite/pipelines/pull_request/security_solution/playwright.yml index 98a939570b1b..3255d3b3203c 100644 --- a/.buildkite/pipelines/pull_request/security_solution/playwright.yml +++ b/.buildkite/pipelines/pull_request/security_solution/playwright.yml @@ -9,6 +9,7 @@ steps: - quick_checks - linting - linting_with_types + - check_types timeout_in_minutes: 60 parallelism: 1 retry: diff --git a/.buildkite/pipelines/pull_request/security_solution/rule_management.yml b/.buildkite/pipelines/pull_request/security_solution/rule_management.yml index 887e1c8597af..f49a96da39a8 100644 --- a/.buildkite/pipelines/pull_request/security_solution/rule_management.yml +++ b/.buildkite/pipelines/pull_request/security_solution/rule_management.yml @@ -9,6 +9,7 @@ steps: - quick_checks - linting - linting_with_types + - check_types timeout_in_minutes: 60 parallelism: 4 retry: @@ -26,6 +27,7 @@ steps: - quick_checks - linting - linting_with_types + - check_types timeout_in_minutes: 60 parallelism: 2 retry: diff --git a/.buildkite/pipelines/pull_request/slo_plugin_e2e.yml b/.buildkite/pipelines/pull_request/slo_plugin_e2e.yml index 025c80809ab3..3d1a4f9b46f4 100644 --- a/.buildkite/pipelines/pull_request/slo_plugin_e2e.yml +++ b/.buildkite/pipelines/pull_request/slo_plugin_e2e.yml @@ -9,6 +9,7 @@ steps: - quick_checks - linting - linting_with_types + - check_types timeout_in_minutes: 30 artifact_paths: - 'x-pack/plugins/observability_solution/slo/e2e/.journeys/**/*' diff --git a/.buildkite/pipelines/pull_request/synthetics_plugin.yml b/.buildkite/pipelines/pull_request/synthetics_plugin.yml index 0707650aa7c0..f5d6b841a953 100644 --- a/.buildkite/pipelines/pull_request/synthetics_plugin.yml +++ b/.buildkite/pipelines/pull_request/synthetics_plugin.yml @@ -9,6 +9,7 @@ steps: - quick_checks - linting - linting_with_types + - check_types timeout_in_minutes: 60 artifact_paths: - 'x-pack/plugins/observability_solution/synthetics/e2e/.journeys/**/*' diff --git a/.buildkite/pipelines/pull_request/uptime_plugin.yml b/.buildkite/pipelines/pull_request/uptime_plugin.yml index 33a529739ae6..a03915ef7709 100644 --- a/.buildkite/pipelines/pull_request/uptime_plugin.yml +++ b/.buildkite/pipelines/pull_request/uptime_plugin.yml @@ -9,6 +9,7 @@ steps: - quick_checks - linting - linting_with_types + - check_types timeout_in_minutes: 60 artifact_paths: - 'x-pack/plugins/observability_solution/synthetics/e2e/.journeys/**/*' diff --git a/.buildkite/pipelines/pull_request/ux_plugin_e2e.yml b/.buildkite/pipelines/pull_request/ux_plugin_e2e.yml index 977701cc9948..cd95f44fa2e8 100644 --- a/.buildkite/pipelines/pull_request/ux_plugin_e2e.yml +++ b/.buildkite/pipelines/pull_request/ux_plugin_e2e.yml @@ -9,6 +9,7 @@ steps: - quick_checks - linting - linting_with_types + - check_types timeout_in_minutes: 60 artifact_paths: - 'x-pack/plugins/observability_solution/ux/e2e/.journeys/**/*'