Conversation
…LETE bugs Co-authored-by: einari <134365+einari@users.noreply.github.com>
|
@copilot double check the Git history to make sure the fix you now have actually is something we haven’t tried before |
Checked the full git history across all 12 merged PRs. All three fixes in Bootstrap — remove pre-flight probe (new approach): Cleanup — all three fixes are new:
|
|
@copilot can you some how verify that your fixes will work, so I don’t have to create a new mess in all the repositories |
Verified all four fixes with local shell tests that reproduce each exact failure scenario (18/18 pass): Fix 1 — Fix 2 — 403 JSON leaked into Fix 3 — 422/409 DELETE: Confirmed the status-field extraction correctly flags 422 and 409 as success, while 500/401 remain real failures. Fix 4 — Bootstrap pre-flight removed: Grep confirms the |
|
‘ |
The bootstrap workflow was aborting before doing any work due to a flawed PAT permission probe, and the cleanup workflow was failing on expected conditions due to shell scripting bugs with
gh apioutput handling.Bootstrap — remove broken pre-flight PR-permission check
The pre-flight step probed PR-creation permission against
Cratis/Workflows— the one repo explicitly skipped during bootstrapping. A correctly scoped fine-grained PAT (no access toWorkflows, full access everywhere else) always returns 403 here, killing the job before touching a single target repo.Removed the
curlprobe entirely. PR-creation failures are already caught and reported per-repo in the main loop.Cleanup — three
gh apioutput-handling bugs"null"branch SHA treated as presentgh api ... --jq '.object.sha' 2>/dev/null || truesetsbranch_shato the literal string"null"when a branch doesn't exist (jq output for a missing field on an error body).[ -z "$branch_sha" ]is false for"null", so cleanup attempted — and failed — to delete branches that never existed.403 error JSON leaked into
$open_prWhen the PR-list endpoint returned 403,
gh apiwrote the raw error JSON to stdout before jq ran, making$open_pra non-empty string. Repos were wrongly skipped as if they had an open PR. Fixed by capturing the raw response first, then piping through a standalonejqcall so error objects always produce empty output.422 / 409 DELETE errors treated as failures
422("Reference does not exist") and409("Git Repository is empty") on DELETE are expected harmless conditions (branch already gone, empty repo). These now count as successful cleanup rather than job-failing errors.🔒 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.