@@ -83,34 +83,38 @@ export default class DeployMetadataQuick extends SfCommand<DeployResultJson> {
8383 public async run ( ) : Promise < DeployResultJson > {
8484 const [ { flags } , cache ] = await Promise . all ( [ this . parse ( DeployMetadataQuick ) , DeployCache . create ( ) ] ) ;
8585
86+ // This is the ID of the validation request
8687 const jobId = cache . resolveLatest ( flags [ 'use-most-recent' ] , flags [ 'job-id' ] , false ) ;
8788
8889 const deployOpts = cache . get ( jobId ) ?? ( { } as DeployOptions ) ;
8990 const org = flags [ 'target-org' ] ?? ( await Org . create ( { aliasOrUsername : deployOpts [ 'target-org' ] } ) ) ;
9091 const api = await resolveApi ( this . configAggregator ) ;
9192
92- await org . getConnection ( flags [ 'api-version' ] ) . metadata . deployRecentValidation ( { id : jobId , rest : api === 'REST' } ) ;
93- this . log ( `Deploy ID: ${ bold ( jobId ) } ` ) ;
93+ // This is the ID of the deploy (of the validated metadata)
94+ const deployId = await org
95+ . getConnection ( flags [ 'api-version' ] )
96+ . metadata . deployRecentValidation ( { id : jobId , rest : api === 'REST' } ) ;
97+ this . log ( `Deploy ID: ${ bold ( deployId ) } ` ) ;
9498
9599 if ( flags . async ) {
96- const asyncFormatter = new AsyncDeployResultFormatter ( jobId , this . config . bin ) ;
100+ const asyncFormatter = new AsyncDeployResultFormatter ( deployId , this . config . bin ) ;
97101 if ( ! this . jsonEnabled ( ) ) asyncFormatter . display ( ) ;
98102 return asyncFormatter . getJson ( ) ;
99103 }
100104
101- const result = await poll ( org , jobId , flags . wait ) ;
105+ const result = await poll ( org , deployId , flags . wait ) ;
102106 const formatter = new DeployResultFormatter ( result , flags ) ;
103107
104108 if ( ! this . jsonEnabled ( ) ) formatter . display ( ) ;
105109
106- await DeployCache . update ( jobId , { status : result . response . status } ) ;
110+ await DeployCache . update ( deployId , { status : result . response . status } ) ;
107111
108112 process . exitCode = determineExitCode ( result ) ;
109113 if ( result . response . status === RequestStatus . Succeeded ) {
110114 this . log ( ) ;
111- this . logSuccess ( messages . getMessage ( 'info.QuickDeploySuccess' , [ jobId ] ) ) ;
115+ this . logSuccess ( messages . getMessage ( 'info.QuickDeploySuccess' , [ deployId ] ) ) ;
112116 } else {
113- this . log ( messages . getMessage ( 'error.QuickDeployFailure' , [ jobId , result . response . status ] ) ) ;
117+ this . log ( messages . getMessage ( 'error.QuickDeployFailure' , [ deployId , result . response . status ] ) ) ;
114118 }
115119
116120 return formatter . getJson ( ) ;
0 commit comments