Skip to content

Let open pull requests follow their fork head and let remixes sync with the original - #86

Merged
Mistium merged 17 commits into
mainfrom
pulls-follow-fork
Nov 26, 2026
Merged

Mistium merged 17 commits into
mainfrom
pulls-follow-fork

Conversation

@Mistium

@Mistium Mistium commented Nov 24, 2026

Copy link
Copy Markdown
Member

Summary

  • Open pull requests follow their remix's live head: GET /v1/projects/:id/pulls/:index, /diff, /merge, and pull-merge uploads resolve the live head of the remix's headBranch (falling back to the single branch for pre-branch pulls or the recorded headCommit when ambiguous/deleted) instead of freezing on the opening commit. Merging records the head actually merged.
  • Live cross-archive merge base and scoped pull reads: Diffs and merges compute the closest shared commit between the target's baseBranch head and the remix's live head (with a validated OID-keyed merge-base cache for diffs, skipping truncated walks) so upstream changes synced into the remix no longer pollute the PR diff. ?pull=<index>&pullTarget=<id> reads are restricted to commits belonging to the pull, and workspace.mwp?pull=<index> requires a signed-in target editor or remix owner.
  • Hardened pull merge guards: GET /pulls/:index reports baseBranchMissing; /merge and pull-merge uploads enforce source visibility, target_branch_changed / target_branch_missing, uncommitted_changes (while still allowing already-merged pulls to close), head_changed, pull_head_changed (checking mergeSourceHead or preparedSourceHead), pull_not_open, and pull_not_closed, closing pulls under the save + pull locks.
  • Remix sync (POST /v1/projects/:id/remix/sync and upload syncHead): Prepares a three-way merge from the original project's live head into a remix (this remix / original conflict labels, single-file project.sb3 conflict fallback, alreadyMerged / fastForward flags) and commits a two-parent merge commit (Merge changes from <original title>) on upload with syncHead, expectedHead, and mergeTree. Re-checks original visibility and head after the upload body arrives and refuses dirty remixes (uncommitted_changes), moved heads (head_changed / original_changed), missing history (sync_history_unavailable), and unrelated histories (sync_unavailable).

Verification

  • go test ./... in native/gitinspection
  • osl test across the full suite (66/66 passing, including new pull-metadata, pulls, remix-sync, and project-upload-policy tests)
  • python3 scripts/check_conventions.py and osl lsp check main.osl
  • scripts/e2e_smoke.py against a compiled HEAD binary (400 steps, 0 server errors, 0 failed checks)
  • End-to-end Chromium and Firefox verification paired with the scratch-gui remix-sync branch

…deleted target branch, and let older clients merge the prepared head
…ock, let editors complete merges, and show the live base on GET
… free of history work, and report pull write failures
@Mistium
Mistium merged commit 5b0b8b1 into main Nov 26, 2026
1 check 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.

1 participant