Skip to content

Commit d2d9990

Browse files
Merge branch 'main' into jdahlgren/get-snapshot-status-missing-stats-for-restarted-nodes
2 parents 2b0fdab + e4094f4 commit d2d9990

File tree

765 files changed

+31263
-13062
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

765 files changed

+31263
-13062
lines changed

.backportrc.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"repoOwner": "elastic",
3+
"repoName": "elasticsearch-specification",
4+
"targetBranchChoices": ["9.0", "8.19", "8.18", "8.17"],
5+
"fork": false
6+
}

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,5 +234,6 @@ dist/* binary
234234

235235
output/** linguist-generated=true
236236
output/schema/validation-errors.json linguist-generated=false
237+
compiler-rs/compiler-wasm-lib/pkg/* linguist-generated=true
237238

238239
####################################################################################################

.github/download-artifacts/index.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,23 @@
1717
* under the License.
1818
*/
1919

20-
'use strict'
21-
22-
const core = require('@actions/core')
23-
const { join } = require('path')
24-
const minimist = require('minimist')
25-
const stream = require('stream')
26-
const { promisify } = require('util')
27-
const { createWriteStream, promises } = require('fs')
28-
const rimraf = require('rimraf')
29-
const fetch = require('node-fetch')
30-
const crossZip = require('cross-zip')
20+
import core from '@actions/core'
21+
import { join, dirname } from 'path'
22+
import { fileURLToPath } from 'url'
23+
import minimist from 'minimist'
24+
import stream from 'stream'
25+
import { promisify } from 'util'
26+
import { createWriteStream, promises } from 'fs'
27+
import { rimraf } from 'rimraf'
28+
import fetch from 'node-fetch'
29+
import crossZip from 'cross-zip'
3130

3231
const { mkdir, rename, readdir, unlink } = promises
3332
const pipeline = promisify(stream.pipeline)
3433
const unzip = promisify(crossZip.unzip)
35-
const rm = promisify(rimraf)
3634

35+
const __filename = fileURLToPath(import.meta.url)
36+
const __dirname = dirname(__filename)
3737
const esFolder = join(__dirname, '..', '..', 'artifacts')
3838
const zipFolder = join(esFolder, 'artifacts.zip')
3939
const downloadedSpec = join(esFolder, 'rest-api-spec', 'api')
@@ -57,8 +57,8 @@ async function downloadArtifacts (opts) {
5757
core.info(`Resolved artifact URL for ${resolved.commit_url}`)
5858

5959
core.info('Cleanup')
60-
await rm(esFolder)
61-
await rm(specFolder)
60+
await rimraf(esFolder)
61+
await rimraf(specFolder)
6262
await mkdir(esFolder, { recursive: true })
6363
await mkdir(specFolder, { recursive: true })
6464

@@ -74,7 +74,7 @@ async function downloadArtifacts (opts) {
7474
await unzip(zipFolder, esFolder)
7575

7676
core.info('Cleanup')
77-
await rm(zipFolder)
77+
await rimraf(zipFolder)
7878

7979
core.info('Moving files')
8080
const files = await readdir(downloadedSpec)

.github/download-artifacts/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"name": "download-artifacts",
33
"version": "1.0.0",
44
"description": "",
5+
"type": "module",
56
"main": "index.js",
67
"scripts": {
78
"test": "echo \"Error: no test specified\" && exit 1"
@@ -13,7 +14,7 @@
1314
"@actions/core": "^1.6.0",
1415
"cross-zip": "^4.0.0",
1516
"minimist": "^1.2.5",
16-
"node-fetch": "^2.6.7",
17-
"rimraf": "^3.0.2"
17+
"node-fetch": "^3",
18+
"rimraf": "^6"
1819
}
1920
}

.github/validate-pr/index.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import assert from 'assert'
2626
import * as core from '@actions/core'
2727
import { copyFile } from 'fs/promises'
2828
import * as github from '@actions/github'
29-
import specification from '../../output/schema/schema.json' assert { type: 'json' }
29+
import specification from '../../output/schema/schema.json' with { type: 'json' }
3030
import { run as getReport } from '../../../clients-flight-recorder/scripts/types-validator/index.js'
3131
import {
3232
getNamespace,
@@ -90,7 +90,12 @@ async function run() {
9090
if (file.startsWith('specification/_spec_utils')) continue
9191
if (file.startsWith('specification/_doc_ids')) continue
9292
if (file.startsWith('specification/_json_spec')) continue
93-
if (file === 'specification/tsconfig.json') continue
93+
if (file.startsWith('specification/node_modules')) continue
94+
if (file.endsWith('tsconfig.json')) continue
95+
if (file.endsWith('eslint.config.js')) continue
96+
if (file.endsWith('package.json')) continue
97+
if (file.endsWith('package-lock.json')) continue
98+
if (file.endsWith('.md')) continue
9499
if (getApi(file).endsWith('_types')) {
95100
const apis = specification.endpoints
96101
.filter(endpoint => endpoint.name.split('.').filter(s => !privateNames.includes(s))[0] === getApi(file).split('.')[0])

.github/validate-pr/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@
1313
"dependencies": {
1414
"@actions/core": "^1.6.0",
1515
"@actions/github": "^5.0.0",
16-
"zx": "^4.3.0"
16+
"zx": "^8"
1717
}
1818
}

.github/workflows/code-format.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ jobs:
1010
steps:
1111
- uses: actions/checkout@v4
1212

13-
- name: Use Node.js 20
13+
- name: Use Node.js 22
1414
uses: actions/setup-node@v4
1515
with:
16-
node-version: 20
16+
node-version: 22
1717

1818
- name: Install
1919
run: |

.github/workflows/compiler-rs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ jobs:
1414
steps:
1515
- uses: actions/checkout@v4
1616

17-
- name: Use Node.js 20
17+
- name: Use Node.js 22
1818
uses: actions/setup-node@v4
1919
with:
20-
node-version: 20
20+
node-version: 22
2121

2222
- name: Install deps
2323
run: |

.github/workflows/compiler.test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ jobs:
1313
steps:
1414
- uses: actions/checkout@v4
1515

16-
- name: Use Node.js 20
16+
- name: Use Node.js 22
1717
uses: actions/setup-node@v4
1818
with:
19-
node-version: 20
19+
node-version: 22
2020

2121
- name: Install deps
2222
run: |

.github/workflows/generate.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ jobs:
3434
token: ${{ secrets.PAT }}
3535
persist-credentials: true
3636

37-
- name: Setup Node 20
37+
- name: Setup Node 22
3838
uses: actions/setup-node@v4
3939
with:
40-
node-version: 20
40+
node-version: 22
4141
cache: npm
4242
cache-dependency-path: '**/package-lock.json'
4343

.github/workflows/linter.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ jobs:
1010
steps:
1111
- uses: actions/checkout@v4
1212

13-
- name: Use Node.js 20
13+
- name: Use Node.js 22
1414
uses: actions/setup-node@v4
1515
with:
16-
node-version: 20
16+
node-version: 22
1717

1818
- name: Install
1919
run: |

.github/workflows/update-rest-api-json.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ jobs:
2020
with:
2121
ref: ${{ matrix.branch }}
2222

23-
- name: Use Node.js 20
23+
- name: Use Node.js 22
2424
uses: actions/setup-node@v4
2525
with:
26-
node-version: 20
26+
node-version: 22
2727

2828
- name: Install deps
2929
run: |

.github/workflows/validate-pr.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ jobs:
2727
token: ${{ secrets.PAT }}
2828
ref: main
2929

30-
- name: Use Node.js 20
30+
- name: Use Node.js 22
3131
uses: actions/setup-node@v4
3232
with:
33-
node-version: 20
33+
node-version: 22
3434

3535
- name: Install deps 1/2
3636
working-directory: ./clients-flight-recorder

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20
1+
22

Makefile

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ SHELL := /bin/bash
22

33
validate: ## Validate a given endpoint request or response
44
@node compiler/run-validations.js --api $(api) --type $(type) --branch $(branch)
5+
@npm run lint --prefix specification
56

67
validate-no-cache: ## Validate a given endpoint request or response without local cache
78
@node compiler/run-validations.js --api $(api) --type $(type) --branch $(branch) --no-cache
@@ -39,6 +40,8 @@ setup: ## Install dependencies for contrib target
3940
@make clean-dep
4041
@npm install --prefix compiler
4142
@npm install --prefix typescript-generator
43+
@npm install --prefix validator
44+
@npm install --prefix specification
4245
@npm install @redocly/cli
4346

4447
clean-dep: ## Clean npm dependencies
@@ -49,10 +52,14 @@ transform-expand-generics: ## Create a new schema with all generics expanded
4952
@npm run transform-expand-generics --prefix compiler
5053

5154
transform-to-openapi: ## Generate the OpenAPI definition from the compiled schema
52-
@npm run transform-to-openapi --prefix compiler
55+
@npm run transform-to-openapi -- --schema output/schema/schema.json --flavor stack --output output/openapi/elasticsearch-openapi.json
56+
@npm run transform-to-openapi -- --schema output/schema/schema.json --flavor serverless --output output/openapi/elasticsearch-serverless-openapi.json
57+
58+
transform-to-openapi-for-docs: ## Generate the OpenAPI definition tailored for API docs generation
59+
@npm run transform-to-openapi -- --schema output/schema/schema.json --flavor stack --lift-enum-descriptions --merge-multipath-endpoints --output output/openapi/elasticsearch-openapi-docs.json
5360

5461
filter-for-serverless: ## Generate the serverless version from the compiled schema
55-
@npm run --prefix compiler filter-by-availability -- --serverless --visibility=public --input ../output/schema/schema.json --output ../output/schema/schema-serverless.json
62+
@npm run --prefix compiler filter-by-availability -- --serverless --visibility=public --input ../output/schema/schema.json --output ../output/output/openapi/elasticsearch-serverless-openapi.json
5663

5764
dump-routes: ## Create a new schema with all generics expanded
5865
@npm run dump-routes --prefix compiler

compiler-rs/Cargo.lock

Lines changed: 64 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

compiler-rs/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ members = [
1010
[workspace.dependencies]
1111
anyhow = "1"
1212
arcstr = "1"
13+
argh = "0.1"
1314
clap = "4"
1415
console_error_panic_hook = "0.1"
1516
convert_case = "0.6"

compiler-rs/clients_schema/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ pub struct Availability {
264264
pub visibility: Option<Visibility>,
265265
}
266266

267-
/// The availability of an
267+
/// The availability of an endpoint, field or parameter
268268
pub type Availabilities = IndexMap<Flavor, Availability>;
269269

270270
pub trait AvailabilityFilter: Fn(&Option<Availabilities>) -> bool {}
@@ -494,6 +494,7 @@ impl TypeDefinition {
494494
#[derive(Debug, Clone, Serialize, Deserialize)]
495495
pub struct SchemaExample {
496496
pub summary: Option<String>,
497+
pub method_request: Option<String>,
497498
pub description: Option<String>,
498499
pub value: Option<String>,
499500
pub external_value: Option<String>,

0 commit comments

Comments
 (0)