Skip to content

Prune old Cloud Run revisions after env sync - #102

Merged
Pigbibi merged 1 commit into
mainfrom
codex/prune-cloud-run-revisions
May 26, 2026
Merged

Prune old Cloud Run revisions after env sync#102
Pigbibi merged 1 commit into
mainfrom
codex/prune-cloud-run-revisions

Conversation

@Pigbibi

@Pigbibi Pigbibi commented May 26, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • delete stale Cloud Run revisions after the env sync workflow updates each target service
  • keep any revision currently serving traffic plus the latest ready revision
  • leave Artifact Registry cleanup policy as the image-retention layer

Verification

  • git diff --check
  • simulated revision keep/delete logic against interactive-brokers-live-slot-b-service

@Pigbibi
Pigbibi merged commit 71ec1ad into main May 26, 2026
1 check passed
@Pigbibi
Pigbibi deleted the codex/prune-cloud-run-revisions branch May 26, 2026 12:50

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fb2c769513

ℹ️ 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".

Comment on lines +594 to +595
if item.get("revisionName") and int(item.get("percent") or 0) > 0
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Keep tagged revisions during prune

The keep-set only includes traffic targets with percent > 0, so revisions that are reachable only via a traffic tag (0% rollout) are treated as deletable. Cloud Run documentation states tagged revisions can be tested while serving 0% traffic and also that revisions that are able to receive traffic cannot be deleted; in that case gcloud run revisions delete will fail and this workflow step will start failing for services that keep tagged canary/test revisions. Include tagged revisions (or otherwise detect tag entries) in keep_revisions before deletion.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant