[codex] Use async Artifact Registry image cleanup - #120
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a37bbd8db8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| gcloud artifacts docker images delete "${image_repo}@${digest}" \ | ||
| --project="${GCP_PROJECT_ID}" \ | ||
| --delete-tags \ | ||
| --async \ |
There was a problem hiding this comment.
Wait for asynchronous image deletes to finish
In this cleanup loop, adding --async means the workflow exits after each delete operation is submitted rather than after Artifact Registry reports that it completed; the gcloud reference for this flag says it returns immediately without waiting for the operation. When Artifact Registry later rejects a delete (for example a digest that fails a precondition or another backend-side delete error), this step still finishes green, so old Cloud Run images remain in the repository and cleanup regressions are hidden from CI. Please either wait on the returned operations or keep the synchronous delete so failures still fail the workflow.
Useful? React with 👍 / 👎.
Summary
Validation