@@ -64,7 +64,7 @@ async function run () {
6464 const isStale = lastRun . getTime ( ) + DAY < Date . now ( )
6565
6666 if ( typeof argv . api !== 'string' ) {
67- spinner . fail ( 'You must specify the api, for example: \'make validate api=index type=request stack-version=8.1.0-SNAPSHOT \'' )
67+ spinner . fail ( 'You must specify the api, for example: \'make validate api=index type=request branch=main \'' )
6868 process . exit ( 1 )
6969 }
7070
@@ -75,15 +75,16 @@ async function run () {
7575
7676 // if true it's because the make target wasn't configured with a type argument
7777 if ( argv . type !== true && argv . type !== 'request' && argv . type !== 'response' ) {
78- spinner . fail ( 'You must specify the type (request or response), for example: \'make validate api=index type=request stack-version=8.1.0-SNAPSHOT \'' )
78+ spinner . fail ( 'You must specify the type (request or response), for example: \'make validate api=index type=request branch=main \'' )
7979 process . exit ( 1 )
8080 }
8181
82- if ( typeof argv [ 'stack-version' ] !== 'string ' ) {
83- spinner . fail ( 'You must specify the stack version , for example: \'make validate api=index type=request stack-version=8.1.0-SNAPSHOT \'' )
82+ if ( typeof argv . branch !== 'string' && typeof argv . branch !== 'number ' ) {
83+ spinner . fail ( 'You must specify the branch , for example: \'make validate api=index type=request branch=main \'' )
8484 process . exit ( 1 )
8585 }
8686
87+
8788 const isFlightRecorderCloned = await $ `[[ -d ${ path . join ( __dirname , '..' , '..' , 'clients-flight-recorder' ) } ]]` . exitCode === 0
8889 if ( ! isFlightRecorderCloned ) {
8990 spinner . text = 'It looks like you didn\'t cloned the flight recorder, doing that for you'
@@ -165,7 +166,8 @@ async function run () {
165166
166167 spinner . text = 'Running validations'
167168
168- const branchName = argv [ 'stack-version' ] . startsWith ( '7.' ) ? '7.x' : argv [ 'stack-version' ] . slice ( 0 , 3 )
169+ const branchArg = argv . branch . toString ( )
170+ const branchName = branchArg . startsWith ( '7.' ) ? '7.x' : branchArg
169171
170172 if ( noCache || isStale || metadata . branchName !== branchName ) {
171173 metadata . lastRun = new Date ( )
@@ -175,7 +177,7 @@ async function run () {
175177 await $ `node ${ path . join ( uploadRecordingsPath , 'download.js' ) } --branch ${ branchName } `
176178
177179 spinner . text = 'Fetching artifacts'
178- await $ `node ${ path . join ( cloneEsPath , 'index.js' ) } --version ${ argv [ 'stack-version ' ] } `
180+ await $ `node ${ path . join ( cloneEsPath , 'index.js' ) } --branch ${ argv [ 'branch ' ] } `
179181 }
180182
181183 cd ( tsValidationPath )
@@ -188,7 +190,7 @@ async function run () {
188190 } else {
189191 flags . push ( `--${ argv . type } ` )
190192 }
191- const output = await $ `STACK_VERSION= ${ argv [ 'stack-version' ] } node ${ path . join ( tsValidationPath , 'index.js' ) } --api ${ argv . api } ${ flags } `
193+ const output = await $ `node ${ path . join ( tsValidationPath , 'index.js' ) } --api ${ argv . api } --branch ${ branchName } ${ flags } `
192194
193195 cd ( path . join ( compilerPath , '..' ) )
194196 if ( output . exitCode === 0 ) {
0 commit comments