Skip to content

Harden build workflow against corrupted Lake cache restores#536

Merged
teorth merged 2 commits into
mainfrom
copilot/fix-failing-github-actions-job
Jun 20, 2026
Merged

Harden build workflow against corrupted Lake cache restores#536
teorth merged 2 commits into
mainfrom
copilot/fix-failing-github-actions-job

Conversation

Copilot AI commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

The build GitHub Actions job was failing during lake build when a restored .lake cache contained a package checkout with an unreadable git HEAD. This change makes the workflow recover from corrupted cached package repos instead of failing immediately, and avoids re-saving broken cache state.

  • Cache recovery

    • Add a cleanup step after restoring .lake to prune cached package directories whose git HEAD cannot be resolved.
    • This lets Lake refetch only the broken dependency checkout instead of treating the entire cache as usable.
  • Cache write safety

    • Save the Lake cache only on successful builds.
    • This prevents a failed run from persisting corrupted package state back into the shared cache.
  • Workflow behavior

    • The change is isolated to .github/workflows/build_book.yml; build inputs and build commands are unchanged.
- name: Remove corrupt cached packages
  run: |
    if [ -d .lake/packages ]; then
      find .lake/packages -mindepth 1 -maxdepth 1 -type d | while read -r package; do
        if ! git -C "$package" rev-parse HEAD >/dev/null 2>&1; then
          rm -rf "$package"
        fi
      done
    fi

- name: Save Lake cache
  if: success()

Copilot AI changed the title [WIP] Fix failing GitHub Actions job "build" Harden build workflow against corrupted Lake cache restores Jun 20, 2026
Copilot AI requested a review from teorth June 20, 2026 05:08
@teorth teorth marked this pull request as ready for review June 20, 2026 05:08
@teorth teorth merged commit 1860feb into main Jun 20, 2026
1 check failed
@teorth teorth deleted the copilot/fix-failing-github-actions-job branch June 20, 2026 05:09
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