Skip to content

Commit a1d1fb5

Browse files
committed
make validate: Download recordings using branch, not version
1 parent 95e7482 commit a1d1fb5

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
SHELL := /bin/bash
22

33
validate: ## Validate a given endpoint request or response
4-
@node compiler/run-validations.js --api $(api) --type $(type) --stack-version $(stack-version)
4+
@node compiler/run-validations.js --api $(api) --type $(type) --branch $(branch)
55

66
validate-no-cache: ## Validate a given endpoint request or response without local cache
7-
@node compiler/run-validations.js --api $(api) --type $(type) --stack-version $(stack-version) --no-cache
7+
@node compiler/run-validations.js --api $(api) --type $(type) --branch $(branch) --no-cache
88

99
generate: ## Generate the output spec
1010
@echo ">> generating the spec .."

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -204,16 +204,16 @@ git clone https://github.com/elastic/elasticsearch-specification.git
204204
git clone https://github.com/elastic/clients-flight-recorder.git
205205

206206
cd elasticsearch-specification
207-
# this will validate the xpack.info request type against the 8.1.0 stack version
208-
make validate api=xpack.info type=request stack-version=8.1.0-SNAPSHOT
207+
# this will validate the xpack.info request type against the main branch of Elasticsearch
208+
make validate api=xpack.info type=request branch=main
209209

210-
# this will validate the xpack.info request and response types against the 8.1.0 stack version
211-
make validate api=xpack.info stack-version=8.1.0-SNAPSHOT
210+
# this will validate the xpack.info request and response types against the 8.15 branch
211+
make validate api=xpack.info branch=8.15
212212
```
213213

214214
The last command above will install all the dependencies and run, download
215215
the test recordings and finally validate the specification.
216-
If you need to download the recordings again, run `make validate-no-cache api=xpack.info type=request stack-version=8.1.0-SNAPSHOT`.
216+
If you need to download the recordings again, run `make validate-no-cache api=xpack.info type=request branch=main`.
217217

218218
Once you see the errors, you can fix the original definition in `/specification`
219219
and then run the command again until the types validator does not trigger any new error.

compiler/run-validations.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ async function run () {
165165

166166
spinner.text = 'Running validations'
167167

168-
const branchName = argv['stack-version'].startsWith('7.') ? '7.x' : argv['stack-version'].slice(0, 3)
168+
const branchName = argv['branch'].startsWith('7.') ? '7.x' : argv['branch']
169169

170170
if (noCache || isStale || metadata.branchName !== branchName) {
171171
metadata.lastRun = new Date()
@@ -175,7 +175,7 @@ async function run () {
175175
await $`node ${path.join(uploadRecordingsPath, 'download.js')} --branch ${branchName}`
176176

177177
spinner.text = 'Fetching artifacts'
178-
await $`node ${path.join(cloneEsPath, 'index.js')} --version ${argv['stack-version']}`
178+
await $`node ${path.join(cloneEsPath, 'index.js')} --branch ${argv['branch']}`
179179
}
180180

181181
cd(tsValidationPath)

docs/validation-example.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ The example assumes that you have already performed the necessary steps to run a
1616
if not, take a look at the [README](./README.md).
1717

1818
```sh
19-
make validate api=index type=request stack-version=8.1.0-SNAPSHOT
19+
make validate api=index type=request branch=main
2020
```
2121

2222
You will see an output like the following:
@@ -82,7 +82,7 @@ open it with your favourite editor and perform the fix
8282
Finally run the validation again:
8383

8484
```sh
85-
make validate api=index type=request stack-version=8.1.0-SNAPSHOT
85+
make validate api=index type=request branch=main
8686
```
8787

88-
If there are no more errors, open a pr with the fix.
88+
If there are no more errors, open a pull request with the fix.

0 commit comments

Comments
 (0)