Azure / Azure/acr-cli

Optimize Cross Repo-Concurrency in Purge Logic

Open
#467 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Go
Stars
70
Forks
52
Avg merge
3d 2h
Merged PRs (30d)
12

Description

### Optimize Cross Repo-Concurrency in Purge Logic
Currently, when performing a purge across multiple repositories, each repository is processed sequentially:

```go
for repoName, tagRegex := range tagFilters {
```

While there is parallelism within each repo (controlled by the --concurrency flag), there is no concurrency across repositories. This limits the overall efficiency of the purge.

### Why This Matters:

Read and delete operations have different costs: Read operations (e.g. fetching tags or manifests) are generally faster and less throttled than delete operations. By processing multiple repositories in parallel, we can overlap read operations in one repo with delete operations in another, significantly reducing total execution time.

This change will substantially alter the output behavior, especially in terms of timing and interleaving of logs.
It may require more granular concurrency flags to separately control intra-repo and inter-repo concurrency and maybe even read vs delete concurrency. Backward compatibility and user expectations around output format and ordering should be carefully evaluated.

### Next Steps:

This issue is being filed as a follow-up to #462, which intentionally avoids this change to maintain consistent output. Once that PR is merged, we can explore this optimization in a dedicated follow-up.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.