Skip to content

Add prune fallback for GitHub Git Data API 404s#39

Merged
rramboer merged 2 commits into
mainfrom
copilot/fix-prune-github-actions-failure
Jun 15, 2026
Merged

Add prune fallback for GitHub Git Data API 404s#39
rramboer merged 2 commits into
mainfrom
copilot/fix-prune-github-actions-failure

Conversation

Copilot AI commented Jun 15, 2026

Copy link
Copy Markdown

The prune Actions job was correctly identifying stale renders, but failed when deleting them via the Git Data API: POST /git/trees returned 404 in GitHub Actions. This change keeps the current batched delete path and adds a targeted fallback for that failure mode.

  • Root cause

    • prune_renders.py selected the correct issue-* paths to remove.
    • The failure occurred during the destructive commit step, specifically on Git Data API tree creation.
  • Behavior change

    • Preserve the existing fast path:
      • build a tree with sha: null entries
      • create a commit
      • advance renders
    • If a Git Data mutation call fails with the observed 404, fall back to deleting each file through the Contents API instead of failing the workflow.
  • Scope

    • Only the prune deletion path changed.
    • The fallback is limited to Git Data 404 mutation errors; other API failures still raise.
  • Regression coverage

    • Added a focused test that simulates POST /git/trees -> 404 and verifies the script switches to per-file DELETE /contents/... requests.
try:
    new_tree = request_api("POST", repo_path("/git/trees"), {...})
    ...
except RuntimeError as exc:
    if not _is_git_data_404(exc):
        raise
    delete_via_contents_api(paths_to_delete)

Copilot AI changed the title [WIP] Fix failing GitHub Actions job prune Add prune fallback for GitHub Git Data API 404s Jun 15, 2026
Copilot AI requested a review from rramboer June 15, 2026 04:00
@rramboer
rramboer marked this pull request as ready for review June 15, 2026 04:13
Copilot AI requested a review from rramboer June 15, 2026 04:14
@rramboer
rramboer merged commit 5a924e1 into main Jun 15, 2026
3 checks passed
@rramboer
rramboer deleted the copilot/fix-prune-github-actions-failure branch June 15, 2026 04:15
Sign up for free to 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.

2 participants