Skip to content

fix(workspace): pin applied content to the URI head SHA - #265

Merged
xytan0056 merged 1 commit into
mainfrom
pin-head-sha
Jul 30, 2026
Merged

fix(workspace): pin applied content to the URI head SHA#265
xytan0056 merged 1 commit into
mainfrom
pin-head-sha

Conversation

@xytan0056

@xytan0056 xytan0056 commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Stacked on #264.

Summary

Apply diffed against the floating pull/{id}/head ref, 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

  • Mock test asserting the diff target is the pinned SHA, not the PR head
  • Real-git tests (local bare repo with 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 rejected

Test plan

CI
integration test

@xytan0056
xytan0056 requested review from a team as code owners July 30, 2026 19:19
@xytan0056
xytan0056 force-pushed the pin-head-sha branch 3 times, most recently from 993cc30 to cf5974e Compare July 30, 2026 23:24
@xytan0056
xytan0056 changed the base branch from change-uri-rfc to main July 30, 2026 23:34
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.
@xytan0056
xytan0056 merged commit 533f5f2 into main Jul 30, 2026
10 checks passed
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