From 79170ffff42d6d1666dd98bcba511fb2a49553e7 Mon Sep 17 00:00:00 2001 From: Quentin Pradet Date: Wed, 19 Feb 2025 07:31:02 +0400 Subject: [PATCH 1/2] Run Kibana type checks against active branches (#3791) (cherry picked from commit 188f20a64bffc4ee151c3fb3ee39882be8ff33c2) --- .buildkite/kibana.sh | 42 +++++++++++++++++++++++++++++++ .buildkite/kibana.yml | 9 +++++++ catalog-info.yaml | 57 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 108 insertions(+) create mode 100644 .buildkite/kibana.sh create mode 100644 .buildkite/kibana.yml create mode 100644 catalog-info.yaml diff --git a/.buildkite/kibana.sh b/.buildkite/kibana.sh new file mode 100644 index 0000000000..857d15a814 --- /dev/null +++ b/.buildkite/kibana.sh @@ -0,0 +1,42 @@ +#!/usr/bin/env bash + +set -euo pipefail + +# Since we're into the current repo, move to the top-level +cd .. + +echo "--- Clone elasticsearch-js" +git clone -v -- git@github.com:elastic/elasticsearch-js.git +pushd elasticsearch-js +git checkout $BUILDKITE_BRANCH +popd + +echo "--- Clone Kibana" +git clone -v --reference /usr/local/git-references/git-github-com-elastic-kibana-git -- git@github.com:elastic/kibana.git +cd kibana + +echo "--- Install Node.js and Yarn" +curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash +set +e # https://github.com/nvm-sh/nvm/issues/3117 +export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")" +[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm +set -e + +nvm install +nvm use +npm install --global yarn + +echo "--- Install elasticsearch-js" +pushd ../elasticsearch-js +npm install +npm run build +npm pack +popd +yarn add ../elasticsearch-js/elastic-elasticsearch-*.tgz + +echo "--- Bootstrap Kibana" +git --no-pager diff +yarn kbn bootstrap --allow-root + +echo "--- Check types" +node scripts/type_check.js diff --git a/.buildkite/kibana.yml b/.buildkite/kibana.yml new file mode 100644 index 0000000000..d67ab615fd --- /dev/null +++ b/.buildkite/kibana.yml @@ -0,0 +1,9 @@ +agents: + memory: "24G" + cpu: "4" + ephemeralStorage: 15Gi + + +steps: + - label: "Run Kibana type checks" + command: .buildkite/kibana.sh diff --git a/catalog-info.yaml b/catalog-info.yaml new file mode 100644 index 0000000000..0481c6b37a --- /dev/null +++ b/catalog-info.yaml @@ -0,0 +1,57 @@ +--- +# yaml-language-server: $schema=https://json.schemastore.org/catalog-info.json +apiVersion: backstage.io/v1alpha1 +kind: Component +metadata: + name: elasticsearch-specification + +spec: + type: library + owner: group:devtools-team + lifecycle: beta + +--- +# yaml-language-server: $schema=https://gist.githubusercontent.com/elasticmachine/988b80dae436cafea07d9a4a460a011d/raw/rre.schema.json +apiVersion: backstage.io/v1alpha1 +kind: Resource +metadata: + name: kibana-type-checks-pipeline + description: Run Kibana type checks against the specification + +spec: + type: buildkite-pipeline + owner: group:devtools-team + system: buildkite + + implementation: + apiVersion: buildkite.elastic.dev/v1 + kind: Pipeline + metadata: + name: Kibana type checks + spec: + repository: elasticsearch-specification + pipeline_file: .buildkite/kibana.yml + provider_settings: + trigger_mode: none + teams: + devtools-team: + access_level: MANAGE_BUILD_AND_READ + everyone: + access_level: READ_ONLY + schedules: + Daily main: + branch: 'main' + cronline: '0 4 * * *' + message: 'Daily run for main branch' + Daily 8.x: + branch: '8.x' + cronline: '0 4 * * *' + message: 'Daily run for 8.x branch' + Daily 8.17: + branch: '8.17' + cronline: '0 4 * * *' + message: 'Daily run for 8.17 branch' + Daily 8.18: + branch: '8.18' + cronline: '0 4 * * *' + message: 'Daily run for 8.18 branch' From 83343ee6c718644cf0c7d4ad69e067218340d40c Mon Sep 17 00:00:00 2001 From: Quentin Pradet Date: Wed, 19 Feb 2025 11:12:48 +0400 Subject: [PATCH 2/2] Fix repository name --- catalog-info.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/catalog-info.yaml b/catalog-info.yaml index 0481c6b37a..d13ccec7f3 100644 --- a/catalog-info.yaml +++ b/catalog-info.yaml @@ -29,7 +29,7 @@ spec: metadata: name: Kibana type checks spec: - repository: elasticsearch-specification + repository: elastic/elasticsearch-specification pipeline_file: .buildkite/kibana.yml provider_settings: trigger_mode: none