Skip to content

Sync Cloud Scheduler from runtime target#104

Merged
Pigbibi merged 1 commit into
mainfrom
codex/runtime-scheduler-plan-20260619
Jun 18, 2026
Merged

Sync Cloud Scheduler from runtime target#104
Pigbibi merged 1 commit into
mainfrom
codex/runtime-scheduler-plan-20260619

Conversation

@Pigbibi

@Pigbibi Pigbibi commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add Cloud Scheduler sync to env sync workflow
  • read scheduler plans from RUNTIME_TARGET_JSON
  • skip missing scheduler jobs while updating existing run/probe/precheck jobs

Tests

  • /tmp/qsl-scheduler-test-venv/bin/python -m pytest tests/test_sync_cloud_run_env_workflow.py -q

@Pigbibi Pigbibi merged commit d729cc0 into main Jun 18, 2026
1 check passed
@Pigbibi Pigbibi deleted the codex/runtime-scheduler-plan-20260619 branch June 18, 2026 17:34

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

ℹ️ 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 +682 to +685
current_schedule="$(gcloud scheduler jobs describe "${candidate_job}" \
--project="${GCP_PROJECT_ID}" \
--location="${scheduler_location}" \
--format='value(schedule)' 2>/dev/null || true)"

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 Don't hide scheduler describe failures

In contexts where gcloud scheduler jobs describe fails for something other than an absent candidate job, such as missing cloudscheduler.jobs.get permission or a disabled Scheduler API, the 2>/dev/null || true here turns that failure into an empty current_schedule; the workflow then logs that the job was not found and succeeds without syncing any schedules. Since the gcloud docs define this command as showing job details, preserve the status/stderr and only continue on a confirmed NOT_FOUND.

Useful? React with 👍 / 👎.


current_fields = os.environ["CURRENT_SCHEDULE"].split()
time_fields = os.environ["SCHEDULE_TIME"].split()
if len(current_fields) != 5:

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 Allow full cron overrides without parsing current schedule

When an existing job uses Cloud Scheduler's supported human-readable groc schedule format, current_fields is not five tokens; this check runs before the code handles a full five-field SCHEDULE_TIME, so a runtime target that supplies a complete cron expression still fails instead of replacing the old schedule. Only validate current_fields in the two-field merge branch.

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