Skip to content

Fall back to named scheduler lookup#147

Merged
Pigbibi merged 1 commit into
mainfrom
fix/scheduler-describe-fallback
Jun 10, 2026
Merged

Fall back to named scheduler lookup#147
Pigbibi merged 1 commit into
mainfrom
fix/scheduler-describe-fallback

Conversation

@Pigbibi

@Pigbibi Pigbibi commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • fall back from gcloud scheduler jobs list to ${service}-scheduler describe lookups when list is denied
  • keep scheduler-aware heartbeat usable with narrower Cloud Scheduler IAM permissions
  • add regression coverage for the named scheduler lookup path

Tests

  • PYTHONPATH=. python -m pytest -q tests/test_execution_report_heartbeat.py
  • python -m ruff check scripts/execution_report_heartbeat.py tests/test_execution_report_heartbeat.py
  • python -m py_compile scripts/execution_report_heartbeat.py tests/test_execution_report_heartbeat.py

@Pigbibi Pigbibi merged commit 303a72d into main Jun 10, 2026
1 check passed
@Pigbibi Pigbibi deleted the fix/scheduler-describe-fallback branch June 10, 2026 05:15

@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: 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)

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 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 👍 / 👎.

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