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
Adjust delete threshold logic in AwsS3SyncPlanStrategy (#1811)
- Update delete ratio calculation to use `TotalRemoteFiles` instead of `TotalSyncRequests`.
- Add logging and reset delete threshold to `0.0` when no S3 remote files are discovered. Ensuring our plan only contains additions.
Emit `plan-valid` as github actions output.
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");
_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
181
187
// this allows newer assembled documentation to be in a higher state of flux
182
-
if(plan.TotalSyncRequests<=100)
188
+
if(plan.TotalRemoteFiles<=100)
183
189
deleteThreshold=Math.Max(deleteThreshold,0.8f);
184
190
185
-
// if the total sync requests are less than 1000, we enforce a higher ratio of 0.5
191
+
// if the total remote files are less than or equal to 1000, we enforce a higher ratio of 0.5
186
192
// this allows newer assembled documentation to be in a higher state of flux
Copy file name to clipboardExpand all lines: src/tooling/docs-assembler/Deploying/DocsSync.cs
+6Lines changed: 6 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -52,9 +52,15 @@ public record SkipRequest : SyncRequest
52
52
53
53
publicrecordSyncPlan
54
54
{
55
+
/// The total number of source files that were located in the build output
55
56
[JsonPropertyName("total_source_files")]
56
57
publicrequiredintTotalSourceFiles{get;init;}
57
58
59
+
/// The total number of remote files that were located in the remote location
60
+
[JsonPropertyName("total_remote_files")]
61
+
publicrequiredintTotalRemoteFiles{get;init;}
62
+
63
+
/// The total number of sync requests that were generated (sum of <see cref="AddRequests"/>, <see cref="UpdateRequests"/>, <see cref="DeleteRequests"/>)
0 commit comments