fix(auto-pilot): use WORKFLOWS_SCRIPTS_PATH for all script calls - #939
Conversation
The agents-auto-pilot workflow was failing because: 1. Sparse checkout only included .github/scripts, but Python metrics scripts are in the root scripts/ folder 2. Script calls used relative paths (scripts/...) which looked in the consumer repo instead of the workflows-lib checkout Fixes: - Add 'scripts' to sparse-checkout alongside .github/scripts - Update all script invocations to use $WORKFLOWS_SCRIPTS_PATH/scripts/... Tested against: stranske/Portable-Alpha-Extension-Model#1159
Automated Status SummaryHead SHA: f1b31fb
Coverage Overview
Coverage Trend
Top Coverage Hotspots (lowest coverage)
Updated automatically; will refresh on subsequent CI/Docker completions. Keepalive checklistScopeNo scope information available Tasks
Acceptance criteria
|
🤖 Keepalive Loop StatusPR #939 | Agent: Codex | Iteration 0/5 Current State
🔍 Failure Classification| Error type | infrastructure | |
There was a problem hiding this comment.
Pull request overview
This PR fixes a critical bug in the agents:auto-pilot workflow where Python scripts from the workflows-lib repository were not accessible in consumer repos. The root cause was incomplete sparse checkout configuration and incorrect script path references.
Changes:
- Added
scriptsdirectory to sparse-checkout configuration alongside existing.github/scripts - Updated all 26 Python script invocations to use
$WORKFLOWS_SCRIPTS_PATHenvironment variable instead of relative paths
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The linked PR detection was matching cross-references from any repository, including references from other repos' PRs. This caused issues when a PR in repo A mentioned an issue in repo B - the auto-pilot would incorrectly think repo B's issue already had a linked PR. Added check: event.source?.issue?.repository?.full_name must match the current repo before considering it a linked PR. Fixes: stranske/Portable-Alpha-Extension-Model#1159 was incorrectly linked to #939 due to a mention in the PR body.
The linked PR detection was matching cross-references from any repository, including references from other repos' PRs. This caused issues when a PR in repo A mentioned an issue in repo B - the auto-pilot would incorrectly think repo B's issue already had a linked PR. Added check: event.source?.issue?.repository?.full_name must match the current repo before considering it a linked PR. Fixes: stranske/Portable-Alpha-Extension-Model#1159 was incorrectly linked to #939 due to a mention in the PR body.
Problem
The
agents:auto-pilotworkflow was failing in consumer repos (e.g., Portable-Alpha-Extension-Model#1159) with:Root Cause
Two configuration issues in the template:
Incomplete sparse checkout: Only
.github/scriptswas checked out, but the Python metrics scripts (autopilot_step_timer.py,autopilot_metrics_collector.py) are in the rootscripts/folderIncorrect script paths: Script calls used relative paths (
python scripts/...) which looked in the consumer repo instead of theworkflows-libcheckoutFix
scriptsto sparse-checkout alongside.github/scripts$WORKFLOWS_SCRIPTS_PATH/scripts/...Testing
After merging, re-sync to consumer repos and re-trigger the auto-pilot workflow on the test issue.