Skip to content

Switch autoloop workflow pre-steps from Python to JavaScript (Node.js) - #12

Merged
mrjf merged 5 commits into
mainfrom
copilot/switch-to-actions-github-script
Apr 4, 2026
Merged

Switch autoloop workflow pre-steps from Python to JavaScript (Node.js)#12
mrjf merged 5 commits into
mainfrom
copilot/switch-to-actions-github-script

Conversation

CopilotAI commented Apr 3, 2026

Copy link
Copy Markdown
Contributor

Replace python3 heredocs with node heredocs in both workflow files, aligning the pre-step runtime with actions/github-script.

Workflow changes

  • workflows/autoloop.md: Scheduling pre-step rewritten in JS — parseMachineState, parseSchedule, getProgramName, readProgramState, program scanning, issue fetching via fetch(), selection logic
  • workflows/sync-branches.md: Branch sync rewritten in JS using child_process.spawnSync for git operations

Before:

python3 - << 'PYEOF'import os, json, re, glob, sysimport urllib.request, urllib.errorfrom datetime import datetime, timezone, timedelta# ...PYEOF

After:

node - << 'JSEOF'const fs = require('fs');const path = require('path');// ...async function main() { /* ... */ }main().catch(err => { console.error(err.message || err); process.exit(1); });JSEOF

Test infrastructure

  • tests/conftest.py: Extracts JS functions from the JSEOF heredoc, writes to a temp .cjs module, calls via node subprocess. Python wrappers handle type conversion (e.g., parseSchedule returns ms → wrapped to timedelta).
  • tests/test_scheduling.py: Updated docstrings only; all 88 tests pass unchanged against the JS implementation.

CopilotAIand others added 3 commits April 3, 2026 19:16
…t (actions/github-script)
Replace python3 heredocs with node heredocs in:
- workflows/autoloop.md: pre-step scheduling logic
- workflows/sync-branches.md: branch sync logic
Update test infrastructure:
- tests/conftest.py: extract JS functions and call via Node.js subprocess
- tests/test_scheduling.py: update docstrings and line references
All 88 existing tests pass.
Agent-Logs-Url: https://github.com/githubnext/autoloop/sessions/639174de-6b45-471f-878b-05ffaca3cdfa
Co-authored-by: mrjf <180956+mrjf@users.noreply.github.com>
…d add inline comments for unicode escapes
Agent-Logs-Url: https://github.com/githubnext/autoloop/sessions/639174de-6b45-471f-878b-05ffaca3cdfa
Co-authored-by: mrjf <180956+mrjf@users.noreply.github.com>
CopilotAI changed the title [WIP] Update autoloop workflow to use actions/github-scriptSwitch autoloop workflow pre-steps from Python to JavaScript (Node.js)Apr 3, 2026
CopilotAI requested a review from mrjfApril 3, 2026 19:20
@mrjf

mrjf commented Apr 3, 2026

Copy link
Copy Markdown
Contributor

@copilot resolve the merge conflicts in this pull request

@mrjf
mrjf marked this pull request as ready for review April 3, 2026 20:15
Resolve merge conflict in .gitignore (keep both entries).
Auto-merge for workflows/autoloop.md incorporated upstream changes
(experiment log removal from PR #8).
Co-authored-by: mrjf <180956+mrjf@users.noreply.github.com>

CopilotAI commented Apr 3, 2026

Copy link
Copy Markdown
ContributorAuthor

@copilot resolve the merge conflicts in this pull request

Merge conflicts resolved in d8dda09. The only real conflict was in .gitignore (add/add — kept both entries). workflows/autoloop.md auto-merged cleanly with the upstream experiment log removal from PR #8. All 88 tests pass after the merge.

@mrjf
mrjf merged commit 4ea70b1 into mainApr 4, 2026
1 check passed
CopilotAI added a commit that referenced this pull request Apr 4, 2026
- Make `gh extension install github/gh-aw` the primary install method
- Move curl-based install to collapsible fallback with download-then-execute
- Use `-f` flag (fail on HTTP errors), remove `-s` (silent) flag
- Update troubleshooting section reference
Fixes#12
Agent-Logs-Url: https://github.com/githubnext/autoloop/sessions/a6c8d12b-6d27-417a-951f-582d4adcfce3
Co-authored-by: mrjf <180956+mrjf@users.noreply.github.com>
Sign up for freeto 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.

Usie actions/github-script rather than python to implement the loop

2 participants

@mrjf