Guard local checks against low disk space - #4531
Draft
MajorTal wants to merge 1 commit into
Draft
Conversation
Signed-off-by: Tal Weiss <major.tal@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
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.