Extract Autoloop scheduler from inline heredoc into a committed Python script#40
Merged
Extract Autoloop scheduler from inline heredoc into a committed Python script#40
Conversation
…/autoloop_scheduler.py Agent-Logs-Url: https://github.com/githubnext/autoloop/sessions/c6a28e1a-8d38-4b61-8f7e-ea0c55200db1 Co-authored-by: mrjf <180956+mrjf@users.noreply.github.com>
…se branch Agent-Logs-Url: https://github.com/githubnext/autoloop/sessions/c6a28e1a-8d38-4b61-8f7e-ea0c55200db1 Co-authored-by: mrjf <180956+mrjf@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Extract the scheduler into a committed script
Extract Autoloop scheduler from inline heredoc into a committed Python script
Apr 22, 2026
Contributor
|
@copilot fix failing tests |
Agent-Logs-Url: https://github.com/githubnext/autoloop/sessions/db0c7c36-cb2d-484b-997e-b523c356f1de Co-authored-by: mrjf <180956+mrjf@users.noreply.github.com>
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The ~470-line inline
node - << 'JSEOF'scheduler inworkflows/autoloop.mdis approaching GitHub Actions' compiledrun:expression size limit, and is unreachable to linters, type-checkers, and unit tests. Sibling proposals add ~30–60 LOC each to the scheduler — extraction is a prerequisite.Changes
workflows/scripts/autoloop_scheduler.py— stdlib-only Python (os,re,json,glob,urllib,datetime) with named, importable helpers:parse_machine_state,parse_schedule,parse_program_frontmatter,is_unconfigured,check_skip_conditions,select_program,slugify_issue_title,parse_link_header, plus amain()entry point.workflows/autoloop.md"Check which programs are due" step is now a one-liner; lock file and dogfooded.github/workflows/autoloop.mdupdated in lockstep, and a byte-identical copy of the script lives at.github/workflows/scripts/so the install copy step (cp -r workflows/ .github/workflows/) needs no change.tests/conftest.pyimports the script directly viaimportlib(replacing JS-extraction-via-Node.js subprocess). Existing 100 tests intest_scheduling.pypreserved via thin shims for shape differences.tests/test_scheduler_e2e.py— 9 fixture-based subprocess tests exercisingmain(): more-overdue selection, never-run priority, missing state file → first run,paused/completed→ skipped,AUTOLOOP_PROGRAM=<name>forced bypass (incl. forcing a paused program), unknown forced name → error, no programs found.AGENTS.mddocuments the newworkflows/scripts/directory in the repo layout and deployment steps.Net diff:
workflows/autoloop.md1179 → 717 lines;.github/workflows/autoloop.md837 → 694 lines; lock file's inline scheduler collapses to one shell line. 109/109 tests pass; CodeQL clean.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com/repos/bogus.invalid/bogus/issues/usr/bin/python /usr/bin/python /home/REDACTED/work/autoloop/autoloop/workflows/scripts/autoloop_scheduler.py(http block)/usr/bin/python /usr/bin/python /home/REDACTED/work/autoloop/autoloop/workflows/scripts/autoloop_scheduler.py _ _ _ _ -- /tmp/codeql-scratch-dfc165ae3c2123cd/dbs/actions/db-actions /tmp/codeql-scratch-dfc165ae3c2123cd/dbs/actions/trap/actions(http block)/usr/bin/python /usr/bin/python /home/REDACTED/work/autoloop/autoloop/workflows/scripts/autoloop_scheduler.py /tmp/codeql-tNmmIe/pr-diff-range --extension-packs codeql-action/pr-diff-range /tmp/codeql-scratch-dfc165ae3c2123cd/dbs/actions codeql/actions-queries(http block)https://api.github.com/repos/test/test/issues/usr/bin/python3 python3 /home/REDACTED/work/autoloop/autoloop/workflows/scripts/autoloop_scheduler.py(http block)If you need me to access, download, or install something from one of these locations, you can either: