fix(workspace): pin applied content to the URI head SHA - #265
Merged
Conversation
yushan8
approved these changes
Jul 30, 2026
xytan0056
force-pushed
the
pin-head-sha
branch
3 times, most recently
from
July 30, 2026 23:24
993cc30 to
cf5974e
Compare
Apply diffed against the floating pull/{id}/head ref, so two requests
carrying the same change URI could materialize different trees under
the same cache key if the PR advanced between them. Diff against the
pinned head SHA from the URI instead; the ancestor check still guards
against stale or foreign SHAs.
Add real-git tests (local bare repo with refs/pull/1/head): pinned
content applies end-to-end, the tree is stable across PR advancement,
and a non-ancestor SHA is rejected.
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.
Stacked on #264.
Summary
Applydiffed against the floatingpull/{id}/headref, so two requests carrying the same change URI (pull/123) could materialize different trees under the same cache key if the PR has different HEADs. This diffs against the pinned head SHA from the URI instead, making the materialized tree deterministic for a given change URI. The ancestor check still rejects stale or foreign SHAs.** This is a breaking change
Tests
refs/pull/1/head, no env gating): pinned content applies end-to-end; the tree is byte-identical across PR advancement; a SHA that exists but is not an ancestor of the PR head is rejectedTest plan
CI
integration test