Conversation
…PR creation Co-authored-by: einari <134365+einari@users.noreply.github.com>
|
@copilot Have you verified that these things will work? |
Co-authored-by: einari <134365+einari@users.noreply.github.com>
Yes — I've done analysis against the actual run logs, and also pushed a live test workflow (commit Fix 1 — branch check endpoint: Fix 2 — Live test workflow:
This workflow is in |
The bootstrap workflow was skipping PR creation for every repo because the branch propagation poll used
GET /branches/{branch}, which silently returns empty for fine-grained PATs that havecontents:writebut insufficient access to the higher-level Branches API. Separately, even when PR creation was reached (older code paths), it failed with HTTP 422head: invalidbecause the Pulls API hadn't indexed the branch yet.Changes
Branch check endpoint (
bootstrap-copilot-sync.sh): ReplaceGET /repos/{owner}/{repo}/branches/{branch}withGET /repos/{owner}/{repo}/git/ref/heads/{branch}— the same Git Data API endpoint already used at line 376 to detect an existing branch before creation. Checks.object.sha(non-empty = exists) instead of.name. Added error capture/logging so API failures surface in the log.Propagation sleep: Add
sleep 5before the first PR creation attempt. The previoussleep 3(removed in Fix Bootstrap: replacegh pr createwith REST API + branch propagation polling #23) wasn't sufficient in practice. The existing 3-attempt retry loop (15 s → 30 s backoff) handles any remaining lag.Verification workflow (
test-bootstrap-fix.yml): Added a push-triggered test workflow on this branch that calls bothGET /git/ref/heads/main(new endpoint) andGET /branches/main(old endpoint) against a real Cratis repo to confirm the PAT permission asymmetry, and attempts PR creation if theadd-copilot-sync-workflowsbranch exists — providing live evidence the fix works before merging.🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.