Skip to content

Guard local checks against low disk space - #4531

Draft
MajorTal wants to merge 1 commit into
block:mainfrom
MajorTal:codex/pre-push-disk-preflight
Draft

Guard local checks against low disk space#4531
MajorTal wants to merge 1 commit into
block:mainfrom
MajorTal:codex/pre-push-disk-preflight

Conversation

@MajorTal

@MajorTal MajorTal commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Tal here. I hit this while working on Buzz: a cold pre-push run can consume enough build output to take a machine from healthy to nearly full without warning.

This adds a small local disk preflight before the five build-heavy Lefthook jobs. The default policy is deliberately absolute: reserve 15 GiB for the checks and require 10 GiB to remain afterward, blocking below 25 GiB free. Documentation-only pushes remain unaffected, unsupported df output fails open, and developers with an already-warm target can tune or bypass only the disk guard without skipping the other hooks.

The focused test exercises both the boundary behavior and real Git pre-push behavior in a temporary repository. It is also wired into the existing CI changes job.

Related issue

N/A. I searched the open issues and PRs for disk-space and pre-push-hook reports and found no duplicate.

Testing

  • bash -n scripts/check-disk-space.sh scripts/test-check-disk-space.sh
  • scripts/test-check-disk-space.sh
  • lefthook dump
  • git diff --check
  • Real temporary Git pushes proving documentation changes skip the guard and Rust changes block before build commands when space is insufficient

Full just ci was not run locally because it is itself the build-heavy path this change is intended to guard; the PR is draft while GitHub CI runs.

Signed-off-by: Tal Weiss <major.tal@gmail.com>
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.

1 participant