You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
collector.EmitError(@out,$"Plan is invalid, delete ratio: {validationResult.DeleteRatio}, threshold: {validationResult.DeleteThreshold} over {plan.TotalSyncRequests:N0} files while plan has {plan.DeleteRequests:N0} deletions");
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");
73
74
awaitcollector.StopAsync(ctx);
74
75
returncollector.Errors;
75
76
}
@@ -92,11 +93,7 @@ public async Task<int> Plan(
92
93
/// <param name="s3BucketName">The S3 bucket name to deploy to</param>
93
94
/// <param name="planFile">The path to the plan file to apply</param>
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");
_logger.LogInformation("No files discovered in S3, assuming a clean bucket resetting delete threshold to `0.0' as our plan should not have ANY deletions");
184
-
deleteThreshold=0.0f;
185
-
}
186
-
// if the total remote files are less than or equal to 100, we enforce a higher ratio of 0.8
187
-
// this allows newer assembled documentation to be in a higher state of flux
188
-
if(plan.TotalRemoteFiles<=100)
189
-
deleteThreshold=Math.Max(deleteThreshold,0.8f);
190
-
191
-
// if the total remote files are less than or equal to 1000, we enforce a higher ratio of 0.5
192
-
// this allows newer assembled documentation to be in a higher state of flux
193
-
elseif(plan.TotalRemoteFiles<=1000)
194
-
deleteThreshold=Math.Max(deleteThreshold,0.5f);
195
-
196
-
if(deleteRatio>deleteThreshold)
197
-
{
198
-
_logger.LogError("Delete ratio is {Ratio} which is greater than the threshold of {Threshold}",deleteRatio,deleteThreshold);
_logger.LogInformation("No files discovered in S3, assuming a clean bucket resetting delete threshold to `0.0' as our plan should not have ANY deletions");
29
+
deleteThreshold=0.0f;
30
+
}
31
+
// if the total remote files are less than or equal to 100, we enforce a higher ratio of 0.8
32
+
// this allows newer assembled documentation to be in a higher state of flux
33
+
if(plan.TotalRemoteFiles<=100)
34
+
{
35
+
_logger.LogInformation("Plan has less than 100 total remote files ensuring delete threshold is at minimum 0.8");
36
+
deleteThreshold=Math.Max(deleteThreshold,0.8f);
37
+
}
38
+
39
+
// if the total remote files are less than or equal to 1000, we enforce a higher ratio of 0.5
40
+
// this allows newer assembled documentation to be in a higher state of flux
41
+
elseif(plan.TotalRemoteFiles<=1000)
42
+
{
43
+
_logger.LogInformation("Plan has less than 1000 but more than a 100 total remote files ensuring delete threshold is at minimum 0.5");
44
+
deleteThreshold=Math.Max(deleteThreshold,0.5f);
45
+
}
46
+
47
+
if(deleteRatio>deleteThreshold)
48
+
{
49
+
_logger.LogError("Delete ratio is {Ratio} which is greater than the threshold of {Threshold}",deleteRatio,deleteThreshold);
0 commit comments