Skip to content

Filter runtime guard logs by ready revision#180

Merged
Pigbibi merged 1 commit into
mainfrom
codex/filter-runtime-guard-stale-logs-20260701
Jul 1, 2026
Merged

Filter runtime guard logs by ready revision#180
Pigbibi merged 1 commit into
mainfrom
codex/filter-runtime-guard-stale-logs-20260701

Conversation

@Pigbibi

@Pigbibi Pigbibi commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • pass CLOUD_RUN_REGION into the runtime guard workflow
  • resolve the latest ready Cloud Run revision for each service
  • use the latest ready revision creation time as the lower bound for Cloud Run log queries, falling back to the original lookback window when metadata is unavailable
  • add focused tests for revision cutoff and target-specific region resolution

Validation

  • python -m py_compile scripts/cloud_run_runtime_guard.py tests/test_cloud_run_runtime_guard.py
  • uvx ruff check scripts/cloud_run_runtime_guard.py tests/test_cloud_run_runtime_guard.py
  • stdlib inline simulation of _cloud_run_log_since

@Pigbibi Pigbibi merged commit a6647da into main Jul 1, 2026
2 checks passed
@Pigbibi Pigbibi deleted the codex/filter-runtime-guard-stale-logs-20260701 branch July 1, 2026 06:56

@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: 7440e23196

ℹ️ 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 447 to +448
f'AND resource.labels.service_name="{service}" '
f'AND timestamp >= "{since_text}"'
f'AND timestamp >= "{service_since_text}"'

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Add the ready revision to the log filter

When a Cloud Run service has split traffic or an older revision finishes requests after a new revision becomes ready, this query still reads every revision because it only filters by service_name and timestamp. The repo already treats non-latest traffic revisions as a supported state in .github/workflows/sync-cloud-run-env.yml:809-816, so old-revision failures after latestReadyRevisionName was created can still page the runtime guard; include resource.labels.revision_name for the resolved ready revision if the guard is meant to isolate the ready revision's logs.

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