Fall back to named scheduler lookup#147
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2c0fb816b8
ℹ️ 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".
| f"Unable to list Cloud Scheduler jobs: {exc}; trying named scheduler job lookup.", | ||
| file=sys.stderr, | ||
| ) | ||
| jobs = _describe_scheduler_jobs_for_services(services, project=project) |
There was a problem hiding this comment.
Preserve window fallback when named lookup finds nothing
When jobs.list is denied and none of the ${service}-scheduler describes return a matching job (for example, a service with a differently named scheduler or before the scheduler job exists), this leaves jobs empty and the existing not service_jobs branch marks every service as due. _resolve_required_services then reports scheduler_checked=True, so main() skips the existing day-of-month fallback and monthly heartbeats can query/fail outside their expected window instead of skipping as they did when the list error was treated as unresolved. Consider treating an empty named-lookup result as unresolved so the previous fallback logic still applies.
Useful? React with 👍 / 👎.
Summary
gcloud scheduler jobs listto${service}-schedulerdescribe lookups when list is deniedTests
PYTHONPATH=. python -m pytest -q tests/test_execution_report_heartbeat.pypython -m ruff check scripts/execution_report_heartbeat.py tests/test_execution_report_heartbeat.pypython -m py_compile scripts/execution_report_heartbeat.py tests/test_execution_report_heartbeat.py