Skip to content

fix(client): align push/pull with the v12 API contract + v12 verification tests - #11

Open
gustavorps wants to merge 3 commits into
ParapluOU:mainfrom
gustavorps:pr/collab-v12
Open

fix(client): align push/pull with the v12 API contract + v12 verification tests#11
gustavorps wants to merge 3 commits into
ParapluOU:mainfrom
gustavorps:pr/collab-v12

Conversation

@gustavorps

Copy link
Copy Markdown

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/pull send {"remote": <registered remote name>, "remote_branch": <branch>} to /api/push|pull/{org}/{db} (one of the two URL forms documented in the v12 docs — see docs/terminusdb/git-for-data-reference.md)
  • push signature mirrors pull (remote name, optional branch, auth, timeout)
  • The registered-remote flow is required: add_remote + fetch before push (the remote must have a head)

The Authorization-Remote header 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 credentials
  • merge_strategies.rs — Rebase/Apply merge correctness
  • schema_migration.rs — v12 schema migration (CreateClassProperty on existing data)

Merge-order note: collaboration_roundtrip.rs passes remote credentials via Authorization-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 --tests compiles; the roundtrip was verified against a real v12.1 server (clone → push → pull convergence)
  • Logic reviewed against terminusdb-client-js (lib/woqlClient.js, lib/connectionConfig.js): body shape and remote-name semantics match

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.
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