@@ -40,6 +40,7 @@ private void AssignOutputLogger()
4040 /// <param name="out"> The file to write the plan to</param>
4141 /// <param name="deleteThreshold"> The percentage of deletions allowed in the plan as percentage of total files to sync</param>
4242 /// <param name="ctx"></param>
43+ [ Command ( "plan" ) ]
4344 public async Task < int > Plan (
4445 string environment ,
4546 string s3BucketName ,
@@ -58,7 +59,7 @@ public async Task<int> Plan(
5859 var s3Client = new AmazonS3Client ( ) ;
5960 var planner = new AwsS3SyncPlanStrategy ( logFactory , s3Client , s3BucketName , assembleContext ) ;
6061 var plan = await planner . Plan ( deleteThreshold , ctx ) ;
61- _logger . LogInformation ( "Total files to sync : {TotalFiles }" , plan . TotalSyncRequests ) ;
62+ _logger . LogInformation ( "Remote listing completed : {RemoteListingCompleted }" , plan . RemoteListingCompleted ) ;
6263 _logger . LogInformation ( "Total files to delete: {DeleteCount}" , plan . DeleteRequests . Count ) ;
6364 _logger . LogInformation ( "Total files to add: {AddCount}" , plan . AddRequests . Count ) ;
6465 _logger . LogInformation ( "Total files to update: {UpdateCount}" , plan . UpdateRequests . Count ) ;
@@ -70,7 +71,7 @@ public async Task<int> Plan(
7071 if ( ! validationResult . Valid )
7172 {
7273 await githubActionsService . SetOutputAsync ( "plan-valid" , "false" ) ;
73- collector . EmitError ( @out , $ "Plan is invalid, delete ratio: { validationResult . DeleteRatio } , threshold: { validationResult . DeleteThreshold } over { plan . TotalRemoteFiles : N0 } remote files while plan has { plan . DeleteRequests : N0 } deletions ") ;
74+ collector . EmitError ( @out , $ "Plan is invalid, { validationResult } , delete ratio: { validationResult . DeleteRatio } , remote listing completed: { plan . RemoteListingCompleted } ") ;
7475 await collector . StopAsync ( ctx ) ;
7576 return collector . Errors ;
7677 }
@@ -93,6 +94,7 @@ public async Task<int> Plan(
9394 /// <param name="s3BucketName">The S3 bucket name to deploy to</param>
9495 /// <param name="planFile">The path to the plan file to apply</param>
9596 /// <param name="ctx"></param>
97+ [ Command ( "apply" ) ]
9698 public async Task < int > Apply ( string environment , string s3BucketName , string planFile , Cancel ctx = default )
9799 {
98100 AssignOutputLogger ( ) ;
@@ -116,6 +118,7 @@ public async Task<int> Apply(string environment, string s3BucketName, string pla
116118 }
117119 var planJson = await File . ReadAllTextAsync ( planFile , ctx ) ;
118120 var plan = SyncPlan . Deserialize ( planJson ) ;
121+ _logger . LogInformation ( "Remote listing completed: {RemoteListingCompleted}" , plan . RemoteListingCompleted ) ;
119122 _logger . LogInformation ( "Total files to sync: {TotalFiles}" , plan . TotalSyncRequests ) ;
120123 _logger . LogInformation ( "Total files to delete: {DeleteCount}" , plan . DeleteRequests . Count ) ;
121124 _logger . LogInformation ( "Total files to add: {AddCount}" , plan . AddRequests . Count ) ;
@@ -133,7 +136,7 @@ public async Task<int> Apply(string environment, string s3BucketName, string pla
133136 var validationResult = validator . Validate ( plan ) ;
134137 if ( ! validationResult . Valid )
135138 {
136- collector . EmitError ( planFile , $ "Plan is invalid, delete ratio: { validationResult . DeleteRatio } , threshold: { validationResult . DeleteThreshold } over { plan . TotalRemoteFiles : N0 } remote files while plan has { plan . DeleteRequests : N0 } deletions ") ;
139+ collector . EmitError ( planFile , $ "Plan is invalid, { validationResult } , delete ratio: { validationResult . DeleteRatio } , remote listing completed: { plan . RemoteListingCompleted } ") ;
137140 await collector . StopAsync ( ctx ) ;
138141 return collector . Errors ;
139142 }
0 commit comments