Fix remote build context identity and preserve hard-linked files - #129
Merged
Merged
Conversation
NikhilShahi
approved these changes
Sep 26, 2026
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
Changes
Validation
ruff checkpytestNote
Medium Risk
Changes remote build context packaging and identity semantics (hard links, hashing); incorrect fingerprint behavior could cause false cache hits or unnecessary build failures, though extensive tests cover the contract.
Overview
Adds cacheable remote Dockerfile builds via a stable context fingerprint and a pre-upload consistency check.
Callers can compute
docker_build_context_fingerprintfromhyperbrowser.build_context(same Dockerfile/ignore/sparse-vs-full rules as packaging, without staging or compressing the tree) and pass it asexpected_context_fingerprinton remotebuild_image_from_dockerfile. Packaging recomputes the fingerprint from the bytes actually archived; a mismatch raisesDockerBuildContextChangedErrorbefore any build API call. Local builds reject the parameter withremote=Truerequired.Context archiving now builds normalized tar metadata with
lstat-based entries and hashes file contents as they are written, so hard-linked paths stay distinct and identity ignores mtime/compression.SandboxImageSummarygains optionalready(separate fromuploaded) for backward-compatible image listing.Reviewed by Cursor Bugbot for commit 7e02540. Bugbot is set up for automated code reviews on this repo. Configure here.