From 8a29a5e2ca4ffabce7760e311e41ba2166e0f49e Mon Sep 17 00:00:00 2001 From: Alex Szabo Date: Fri, 29 Sep 2023 01:55:17 +0200 Subject: [PATCH] [Ops] Fix outstanding typescript issues / re-enable typecheck (#167392) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary This is hopefully the last batch of typescript issues to be fixed, related to https://github.com/elastic/kibana/pull/166813. It's also re-enabling full typecheck, with this, we should be back in a clean, typechecked main branch. Blocked by #167428 --------- Co-authored-by: Brad White Co-authored-by: Brad White Co-authored-by: Thomas Watson Co-authored-by: Patryk KopyciƄski Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- .buildkite/pipelines/on_merge.yml | 19 +++++++++---------- .buildkite/pipelines/pull_request/base.yml | 19 +++++++++---------- .../pull_request/type_check_selective.yml | 10 ---------- .../pipelines/pull_request/pipeline.ts | 6 ------ .../scripts/steps/check_types_commits.sh | 4 ++++ 5 files changed, 22 insertions(+), 36 deletions(-) delete mode 100644 .buildkite/pipelines/pull_request/type_check_selective.yml diff --git a/.buildkite/pipelines/on_merge.yml b/.buildkite/pipelines/on_merge.yml index 086098cee6790..133004f468948 100644 --- a/.buildkite/pipelines/on_merge.yml +++ b/.buildkite/pipelines/on_merge.yml @@ -154,16 +154,15 @@ steps: - exit_status: '-1' limit: 3 -# TODO: Enable in #166813 after fixing types -# - command: .buildkite/scripts/steps/check_types.sh -# label: 'Check Types' -# agents: -# queue: n2-16-spot -# timeout_in_minutes: 60 -# retry: -# automatic: -# - exit_status: '-1' -# limit: 3 + - command: .buildkite/scripts/steps/check_types.sh + label: 'Check Types' + agents: + queue: n2-16-spot + timeout_in_minutes: 60 + retry: + automatic: + - exit_status: '-1' + limit: 3 - command: .buildkite/scripts/steps/storybooks/build_and_upload.sh label: 'Build Storybooks' diff --git a/.buildkite/pipelines/pull_request/base.yml b/.buildkite/pipelines/pull_request/base.yml index 9c2527fcdd413..158c22c0bb0c5 100644 --- a/.buildkite/pipelines/pull_request/base.yml +++ b/.buildkite/pipelines/pull_request/base.yml @@ -136,13 +136,12 @@ steps: - exit_status: '-1' limit: 3 -# TODO: Enable in #166813 after fixing types -# - command: .buildkite/scripts/steps/check_types.sh -# label: 'Check Types' -# agents: -# queue: n2-16-spot -# timeout_in_minutes: 60 -# retry: -# automatic: -# - exit_status: '-1' -# limit: 3 + - command: .buildkite/scripts/steps/check_types.sh + label: 'Check Types' + agents: + queue: n2-16-spot + timeout_in_minutes: 60 + retry: + automatic: + - exit_status: '-1' + limit: 3 diff --git a/.buildkite/pipelines/pull_request/type_check_selective.yml b/.buildkite/pipelines/pull_request/type_check_selective.yml deleted file mode 100644 index 7d01f128aac3c..0000000000000 --- a/.buildkite/pipelines/pull_request/type_check_selective.yml +++ /dev/null @@ -1,10 +0,0 @@ -steps: - - command: .buildkite/scripts/steps/check_types_commits.sh - label: 'Check Types Commit Diff' - agents: - queue: n2-16-spot - timeout_in_minutes: 60 - retry: - automatic: - - exit_status: '-1' - limit: 3 diff --git a/.buildkite/scripts/pipelines/pull_request/pipeline.ts b/.buildkite/scripts/pipelines/pull_request/pipeline.ts index 37bd89f2a75a7..80d1312af6e64 100644 --- a/.buildkite/scripts/pipelines/pull_request/pipeline.ts +++ b/.buildkite/scripts/pipelines/pull_request/pipeline.ts @@ -59,12 +59,6 @@ const uploadPipeline = (pipelineContent: string | object) => { pipeline.push(getPipeline('.buildkite/pipelines/pull_request/kbn_handlebars.yml')); } - if (GITHUB_PR_LABELS.includes('ci:hard-typecheck')) { - pipeline.push(getPipeline('.buildkite/pipelines/pull_request/type_check.yml')); - } else { - pipeline.push(getPipeline('.buildkite/pipelines/pull_request/type_check_selective.yml')); - } - if ( (await doAnyChangesMatch([ /^src\/plugins\/controls/, diff --git a/.buildkite/scripts/steps/check_types_commits.sh b/.buildkite/scripts/steps/check_types_commits.sh index 2fe1af46825fb..d34c4dae5ffa9 100755 --- a/.buildkite/scripts/steps/check_types_commits.sh +++ b/.buildkite/scripts/steps/check_types_commits.sh @@ -2,6 +2,10 @@ set -euo pipefail +# This script will collect typescript projects and run typecheck on projects between the given 2 parameters +# Could be used for selective typechecking on projects that might be affected for a given PR. +# (The accuracy for finding related projects is not a 100%) + if [[ "${CI-}" == "true" ]]; then .buildkite/scripts/bootstrap.sh