Skip to content

Accept top-level YAML lists in the cron job loader - #231

Open
fallintoplace wants to merge 1 commit into
ClickHouse:mainfrom
fallintoplace:fix/cron-top-level-list
Open

Accept top-level YAML lists in the cron job loader#231
fallintoplace wants to merge 1 commit into
ClickHouse:mainfrom
fallintoplace:fix/cron-top-level-list

Conversation

@fallintoplace

@fallintoplace fallintoplace commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Problem

load_jobs() contains a branch for top-level YAML lists, but calls data.get("jobs", []) before reaching it. A file like this therefore raises AttributeError instead of loading the job:

- id: hourly-review
  schedule: 1h
  prompt: Review pending tasks

The loader also assumes every other root and every jobs value has the expected collection type, allowing malformed YAML structures to fail during loading.

Changes

  • inspect the YAML root before accessing mapping keys
  • accept both a top-level list and the existing jobs: mapping
  • reject invalid root and job-collection types with a warning
  • add focused regression coverage for accepted and rejected structures

Testing

  • exercised load_jobs() with list, invalid-root, and invalid-collection inputs
  • compiled the changed Python files
  • ran git diff --check

@fallintoplace
fallintoplace force-pushed the fix/cron-top-level-list branch from 894f01d to 4c8df46 Compare July 30, 2026 17:44
@fallintoplace fallintoplace changed the title Fix cron loading from top-level YAML lists Load cron jobs from top-level YAML lists Jul 30, 2026
@fallintoplace
fallintoplace force-pushed the fix/cron-top-level-list branch from 4c8df46 to cd593fe Compare July 30, 2026 17:59
@fallintoplace
fallintoplace force-pushed the fix/cron-top-level-list branch from cd593fe to ece0d73 Compare July 30, 2026 17:59
@fallintoplace fallintoplace changed the title Load cron jobs from top-level YAML lists Accept top-level YAML lists in the cron job loader Jul 30, 2026
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