Clean up manifests in batches - #2195
Open
lbussell wants to merge 18 commits into
Open
Conversation
Cleanup previously kicked off every matching repo in parallel via Task.WhenAll, so a run was all-or-nothing: interrupting it left an unpredictable slice of each repo half-processed. Enumerate and process repos one at a time instead, which makes progress deterministic and is a prerequisite for time-bounding a run. Also drop the ExecuteWithCredentialsAsync wrapper and the associated RegistryCredentialsOptions CLI arguments. It only performed a docker login, which this command has no use for: IAcrClient and IAcrContentClient authenticate through Azure credentials, and the pipeline templates never passed credential args. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: eb10f0ed-33c3-4c35-9d73-88b928bd8e16
A pruneEol pass over public/dotnet/* enumerates every manifest in every repo before deleting anything, so a run that exceeded the job timeout was killed having deleted nothing. Stream manifests in batches of 250 and delete each batch before fetching the next page, so an interrupted run still leaves completed work behind. Add --time-limit-minutes to stop cleanly at the next batch boundary and wire it up for the public/dotnet/* pruneEol step, which is the step that runs long. It is rejected for the delete action, which operates on whole repositories rather than batches. Batching also removes the "delete the whole repo when every manifest is expired" shortcut, since completeness is no longer known up front. Emptied repos are now reclaimed by the manifestCount == 0 path on the next run. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: eb10f0ed-33c3-4c35-9d73-88b928bd8e16
Wrap long signatures and expressions, add blank lines between switch cases, and rename the annotation digest constant in DeleteEolImages to annotationDigest with a realistic sha256 value. No behavior change. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: eb10f0ed-33c3-4c35-9d73-88b928bd8e16
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 66005c54-8aa6-432f-ae90-68ae43764f73
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 66005c54-8aa6-432f-ae90-68ae43764f73
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 66005c54-8aa6-432f-ae90-68ae43764f73
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 66005c54-8aa6-432f-ae90-68ae43764f73
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 66005c54-8aa6-432f-ae90-68ae43764f73
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 66005c54-8aa6-432f-ae90-68ae43764f73
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 66005c54-8aa6-432f-ae90-68ae43764f73
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 66005c54-8aa6-432f-ae90-68ae43764f73
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 66005c54-8aa6-432f-ae90-68ae43764f73
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 66005c54-8aa6-432f-ae90-68ae43764f73
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 66005c54-8aa6-432f-ae90-68ae43764f73
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: e877a04f-8ec4-4024-8596-899e979b9064
mthalman
reviewed
Jul 30, 2026
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 0e945098-1404-43ed-9c36-1cbee1ba37eb
lbussell
enabled auto-merge (squash)
July 31, 2026 00:09
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem: ACR cleanup currently happens in one shot. All manifests are queried from each repo all at once, and then they are deleted all at once. If there are too many manifests in a repo, then the cleanup pipeline can time out while listing the manifests before even deleting anything. As a result, manifests keep piling up and nothing gets deleted. This problem is exacerbated by recent ACR rate limiting changes.
This PR makes the following changes:
One could imagine running cleanup with less intensity and more frequency after these changes (perhaps running it for 30 minutes every hour?). We'll see after these changes.
This PR is part of #2056