Skip to content

Commit b46d5a2

Browse files
authored
Merge branch '8.16' into automated/rest-api-spec-update-8.16
2 parents 5a068d7 + baa10b2 commit b46d5a2

File tree

5 files changed

+145
-16
lines changed

5 files changed

+145
-16
lines changed

.buildkite/kibana.sh

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
5+
# Since we're into the current repo, move to the top-level
6+
cd ..
7+
8+
echo "--- Clone elasticsearch-js"
9+
git clone -v -- [email protected]:elastic/elasticsearch-js.git
10+
pushd elasticsearch-js
11+
git checkout $BUILDKITE_BRANCH
12+
popd
13+
14+
echo "--- Clone Kibana"
15+
git clone -v --reference /usr/local/git-references/git-github-com-elastic-kibana-git -- [email protected]:elastic/kibana.git
16+
cd kibana
17+
18+
echo "--- Install Node.js and Yarn"
19+
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
20+
set +e # https://github.com/nvm-sh/nvm/issues/3117
21+
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
22+
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
23+
set -e
24+
25+
nvm install
26+
nvm use
27+
npm install --global yarn
28+
29+
echo "--- Install elasticsearch-js"
30+
pushd ../elasticsearch-js
31+
npm install
32+
npm run build
33+
npm pack
34+
popd
35+
yarn add ../elasticsearch-js/elastic-elasticsearch-*.tgz
36+
37+
echo "--- Bootstrap Kibana"
38+
git --no-pager diff
39+
yarn kbn bootstrap --allow-root
40+
41+
echo "--- Check types"
42+
node scripts/type_check.js

.buildkite/kibana.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
agents:
2+
memory: "24G"
3+
cpu: "4"
4+
ephemeralStorage: 15Gi
5+
6+
7+
steps:
8+
- label: "Run Kibana type checks"
9+
command: .buildkite/kibana.sh

.github/validate-pr/index.js

Lines changed: 35 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,37 @@
1919

2020
/* global argv, path, cd */
2121

22-
'use strict'
22+
import { dirname } from 'path'
23+
import { fileURLToPath } from 'url'
24+
import 'zx/globals'
25+
import assert from 'assert'
26+
import * as core from '@actions/core'
27+
import { copyFile } from 'fs/promises'
28+
import * as github from '@actions/github'
29+
import specification from '../../output/schema/schema.json' assert { type: 'json' }
30+
import { run as getReport } from '../../../clients-flight-recorder/scripts/types-validator/index.js'
31+
import {
32+
getNamespace,
33+
getName
34+
} from '../../../clients-flight-recorder/scripts/types-validator/utils.js'
35+
36+
const __dirname = dirname(fileURLToPath(import.meta.url))
2337

24-
require('zx/globals')
25-
const assert = require('assert')
26-
const core = require('@actions/core')
27-
const { copyFile } = require('fs/promises')
28-
const github = require('@actions/github')
2938
const octokit = github.getOctokit(argv.token)
30-
const specification = require('../../output/schema/schema.json')
31-
const getReport = require('../../../clients-flight-recorder/scripts/types-validator')
32-
const { getNamespace, getName } = require('../../../clients-flight-recorder/scripts/types-validator/utils')
3339

3440
const privateNames = ['_global']
3541
const tick = '`'
36-
const tsValidationPath = path.join(__dirname, '..', '..', '..', 'clients-flight-recorder', 'scripts', 'types-validator')
37-
38-
async function run () {
42+
const tsValidationPath = path.join(
43+
__dirname,
44+
'..',
45+
'..',
46+
'..',
47+
'clients-flight-recorder',
48+
'scripts',
49+
'types-validator'
50+
)
51+
52+
async function run() {
3953
await copyFile(
4054
path.join(__dirname, '..', '..', 'output', 'typescript', 'types.ts'),
4155
path.join(tsValidationPath, 'types.ts')
@@ -53,14 +67,20 @@ async function run () {
5367
per_page: 100
5468
})
5569
if (data.length > 0) {
56-
files.push(...data.map(entry => entry.filename))
70+
files.push(
71+
...data
72+
.filter((entry) => entry.status !== 'deleted')
73+
.map((entry) => entry.filename)
74+
)
5775
page += 1
5876
} else {
5977
break
6078
}
6179
}
6280

63-
const specFiles = files.filter(file => file.includes('specification') && !file.includes('compiler/test'))
81+
const specFiles = files.filter(
82+
(file) => file.includes('specification') && !file.includes('compiler/test')
83+
)
6484
const table = []
6585

6686
cd(tsValidationPath)
@@ -163,7 +183,7 @@ function generateResponse (r) {
163183
return `${r.passingResponse}/${r.totalResponse}`
164184
}
165185

166-
run().catch(err => {
186+
run().catch((err) => {
167187
core.error(err)
168188
process.exit(1)
169189
})

.github/validate-pr/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
"name": "validate-pr",
33
"version": "1.0.0",
44
"description": "",
5-
"main": "index.js",
5+
"type": "module",
6+
"exports": "./index.js",
67
"scripts": {
78
"test": "echo \"Error: no test specified\" && exit 1"
89
},

catalog-info.yaml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
# yaml-language-server: $schema=https://json.schemastore.org/catalog-info.json
3+
apiVersion: backstage.io/v1alpha1
4+
kind: Component
5+
metadata:
6+
name: elasticsearch-specification
7+
8+
spec:
9+
type: library
10+
owner: group:devtools-team
11+
lifecycle: beta
12+
13+
---
14+
# yaml-language-server: $schema=https://gist.githubusercontent.com/elasticmachine/988b80dae436cafea07d9a4a460a011d/raw/rre.schema.json
15+
apiVersion: backstage.io/v1alpha1
16+
kind: Resource
17+
metadata:
18+
name: kibana-type-checks-pipeline
19+
description: Run Kibana type checks against the specification
20+
21+
spec:
22+
type: buildkite-pipeline
23+
owner: group:devtools-team
24+
system: buildkite
25+
26+
implementation:
27+
apiVersion: buildkite.elastic.dev/v1
28+
kind: Pipeline
29+
metadata:
30+
name: Kibana type checks
31+
spec:
32+
repository: elastic/elasticsearch-specification
33+
pipeline_file: .buildkite/kibana.yml
34+
provider_settings:
35+
trigger_mode: none
36+
teams:
37+
devtools-team:
38+
access_level: MANAGE_BUILD_AND_READ
39+
everyone:
40+
access_level: READ_ONLY
41+
schedules:
42+
Daily main:
43+
branch: 'main'
44+
cronline: '0 4 * * *'
45+
message: 'Daily run for main branch'
46+
Daily 8.x:
47+
branch: '8.x'
48+
cronline: '0 4 * * *'
49+
message: 'Daily run for 8.x branch'
50+
Daily 8.17:
51+
branch: '8.17'
52+
cronline: '0 4 * * *'
53+
message: 'Daily run for 8.17 branch'
54+
Daily 8.18:
55+
branch: '8.18'
56+
cronline: '0 4 * * *'
57+
message: 'Daily run for 8.18 branch'

0 commit comments

Comments
 (0)