omnigraph/crates
Ragnor Comerford 7963499995
fix(cli): unify remote URL builder, fix branch delete //branches 404 (#230)
* test(cli): reproduce branch-delete //branches 404 (failing)

Regression test for the `branch delete` 404 over a multi-graph
`--server`/`--graph` target: the composed URL must be `<base>/branches/<name>`
with no empty `//` segment. Fails against the current `remote_branch_url`,
which appends a trailing slash before extending path segments and so emits
`…/graphs/p9-os//branches/tmpbranch`. The next commit fixes it.

  left:  "http://host/graphs/p9-os//branches/tmpbranch"
  right: "http://host/graphs/p9-os/branches/tmpbranch"

* fix(cli): unify remote URL builder, close the //branches 404 class

Correct-by-design fix for the failing test in the previous commit. The bug was
not specific to `branch delete`: URL assembly was scattered across a
string-concat `remote_url`, a url-crate `remote_branch_url`, and several
`format!` interpolations that left dynamic path/query components un-encoded
(commit id in the path, branch in the query string). `branch delete` was the
instance that surfaced because it is the only verb that puts a dynamic value in
the path.

Replace both helpers with one `remote_url(base, segments, query)` that every
remote call routes through. Callers pass structured segments and query pairs,
so trailing-slash normalization (pop_if_empty) and per-segment / per-value
percent-encoding live in one place. A stray `//` or an un-encoded dynamic
component is no longer representable, closing the whole class rather than the
reported instance.

Migrates the previous commit's failing test to the new builder and adds the
single-graph, trailing-slash, slash-in-name, commit-id-path, and query-value
cases (the last two cover the previously latent siblings). All 16 callsites
migrated; `remote_branch_url` removed.
2026-06-14 20:37:12 +02:00
..
omnigraph fix(engine): scalar index coverage + filter literal coercion (query latency) (#216) 2026-06-14 16:31:19 +02:00
omnigraph-api-types refactor(api): extract omnigraph-api-types crate (RFC-009 Phase 2) 2026-06-13 17:03:20 +03:00
omnigraph-cli fix(cli): unify remote URL builder, fix branch delete //branches 404 (#230) 2026-06-14 20:37:12 +02:00
omnigraph-cluster feat(cli): cluster-managed maintenance addressing + init signpost (RFC-010 Slice 3) (#221) 2026-06-14 02:52:21 +03:00
omnigraph-compiler release: bump workspace to 0.7.0 2026-06-12 14:12:33 +03:00
omnigraph-policy release: bump workspace to 0.7.0 2026-06-12 14:12:33 +03:00
omnigraph-server docs(user): restructure user docs into topic sections (Phase 1) (#223) 2026-06-14 13:52:14 +03:00