feat(sdk): add merge source SHA guards - #60
Open
necolas wants to merge 1 commit into
Open
Conversation
Callers can preview one source commit, then merge a later source tip if the source ref advances before the merge request. Add optional source SHA guards to TypeScript, Python, and Go merge calls. Trim and send the guard as expected_source_sha, and omit it for existing calls.
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.
Why
A caller can preview source commit
A, then merge a newer source tip if thesource ref advances before the merge request. The SDKs do not expose the
server's
expected_source_shaguard.Scope
expectedSourceSha,expected_source_sha, andExpectedSourceSHAtoTypeScript, Python, and Go merge options.
expected_source_sha.Typed merge error mapping remains in SDK PR #59.
Blast Radius
This is an additive SDK change. Existing calls omit the new request field. The
server contract comes from monorepo PR #2395.
Verification
pnpm exec vitest --runpasses 271 tests.pnpm buildbuilds ESM, CommonJS, and declarations../venv/bin/pytest -qpasses 206 tests. It reports 66 existingdeprecation warnings.
./venv/bin/ruff check pierre_storage testspasses../venv/bin/mypy pierre_storagepasses with no issues.flags the unchanged
tests/test_route_contract.pyfile.go test ./...passes.go vet ./...passes.git diff --checkpasses.