@@ -40,6 +40,7 @@ private void AssignOutputLogger()
40
40
/// <param name="out"> The file to write the plan to</param>
41
41
/// <param name="deleteThreshold"> The percentage of deletions allowed in the plan as percentage of total files to sync</param>
42
42
/// <param name="ctx"></param>
43
+ [ Command ( "plan" ) ]
43
44
public async Task < int > Plan (
44
45
string environment ,
45
46
string s3BucketName ,
@@ -58,7 +59,7 @@ public async Task<int> Plan(
58
59
var s3Client = new AmazonS3Client ( ) ;
59
60
var planner = new AwsS3SyncPlanStrategy ( logFactory , s3Client , s3BucketName , assembleContext ) ;
60
61
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 ) ;
62
63
_logger . LogInformation ( "Total files to delete: {DeleteCount}" , plan . DeleteRequests . Count ) ;
63
64
_logger . LogInformation ( "Total files to add: {AddCount}" , plan . AddRequests . Count ) ;
64
65
_logger . LogInformation ( "Total files to update: {UpdateCount}" , plan . UpdateRequests . Count ) ;
@@ -70,7 +71,7 @@ public async Task<int> Plan(
70
71
if ( ! validationResult . Valid )
71
72
{
72
73
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 } ") ;
74
75
await collector . StopAsync ( ctx ) ;
75
76
return collector . Errors ;
76
77
}
@@ -93,6 +94,7 @@ public async Task<int> Plan(
93
94
/// <param name="s3BucketName">The S3 bucket name to deploy to</param>
94
95
/// <param name="planFile">The path to the plan file to apply</param>
95
96
/// <param name="ctx"></param>
97
+ [ Command ( "apply" ) ]
96
98
public async Task < int > Apply ( string environment , string s3BucketName , string planFile , Cancel ctx = default )
97
99
{
98
100
AssignOutputLogger ( ) ;
@@ -116,6 +118,7 @@ public async Task<int> Apply(string environment, string s3BucketName, string pla
116
118
}
117
119
var planJson = await File . ReadAllTextAsync ( planFile , ctx ) ;
118
120
var plan = SyncPlan . Deserialize ( planJson ) ;
121
+ _logger . LogInformation ( "Remote listing completed: {RemoteListingCompleted}" , plan . RemoteListingCompleted ) ;
119
122
_logger . LogInformation ( "Total files to sync: {TotalFiles}" , plan . TotalSyncRequests ) ;
120
123
_logger . LogInformation ( "Total files to delete: {DeleteCount}" , plan . DeleteRequests . Count ) ;
121
124
_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
133
136
var validationResult = validator . Validate ( plan ) ;
134
137
if ( ! validationResult . Valid )
135
138
{
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 } ") ;
137
140
await collector . StopAsync ( ctx ) ;
138
141
return collector . Errors ;
139
142
}
0 commit comments