fix(client): align push/pull with the v12 API contract + v12 verification tests - #11
Open
gustavorps wants to merge 3 commits into
Open
fix(client): align push/pull with the v12 API contract + v12 verification tests#11gustavorps wants to merge 3 commits into
gustavorps wants to merge 3 commits into
Conversation
Verified against a real v12.1 server (clone -> push -> pull roundtrip):
- push/pull now target /api/push|pull/{org}/{db} with
{'remote': <registered remote name>, 'remote_branch': <branch>}
(previously used branch-scoped paths and raw URLs, both rejected)
- push signature mirrors pull (remote name, optional branch, auth, timeout)
- the add_remote/register + fetch-before-push flow is required: the pusher
must know the target as a named remote and the remote must have a head
The Authorization-Remote header casing fix is intentionally NOT included
(separate PR).
… servers Adapted from the fork's dev verification suite (11d525b). Each test spawns real per-process TerminusDB servers (embedded build) and drives the documented v12 contract: clone/push/pull convergence with registered remotes, Rebase/Apply merge strategies, and schema migration. Merge-order note: collaboration_roundtrip passes remote credentials via Authorization-Remote — the server looks that header up case-sensitively, so these tests require the header-casing fix (separate PR) to be merged first.
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.
Problem
The client's push/pull send the v12-rejected contract: raw remote URLs in the body and branch-scoped paths. Against TerminusDB v12 the server responds with 500 (
Arguments are not sufficiently instantiated) — clone → push → pull between servers is broken.Fix
Align with the documented v12 contract (matching the JS client):
push/pullsend{"remote": <registered remote name>, "remote_branch": <branch>}to/api/push|pull/{org}/{db}(one of the two URL forms documented in the v12 docs — seedocs/terminusdb/git-for-data-reference.md)pushsignature mirrorspull(remote name, optional branch, auth, timeout)add_remote+fetchbefore push (the remote must have a head)The
Authorization-Remoteheader casing fix is intentionally not included (separate PR).Tests
Three integration tests from the fork's verification suite (each spawns real per-process embedded TerminusDB servers — the same pattern upstream CI already uses in
tests.yml):collaboration_roundtrip.rs— clone → push → pull convergence with registered remotes and remote credentialsmerge_strategies.rs— Rebase/Apply merge correctnessschema_migration.rs— v12 schema migration (CreateClassProperty on existing data)Merge-order note:
collaboration_roundtrip.rspasses remote credentials viaAuthorization-Remote; the v12 server looks that header up case-sensitively, so these tests require the header-casing fix (separate PR) to be merged first.Verification
cargo test -p terminusdb-client --testscompiles; the roundtrip was verified against a real v12.1 server (clone → push → pull convergence)terminusdb-client-js(lib/woqlClient.js,lib/connectionConfig.js): body shape and remote-name semantics match