Skip to content

v0.71.0 — namespace hierarchy + client SDK feature wave

Choose a tag to compare

@trendvidia trendvidia released this 16 May 23:16
· 12 commits to main since this release
b923ec7

Feature release covering the v0.70.1 → v0.71.0 window. All changes are additive; no breaking changes.

Added — server

  • Namespace hierarchy (#8): namespaces can declare a parent via SetNamespaceParent, forming a chain that schema resolution walks at publish, compile, and read time. Includes new RPCs SetNamespaceParent / GetNamespaceChain, an internal/authz package for capability-based parent-chain access checks (WithAuthorizer injects production policy; the default authz.AllowAll is dev-only and logs a warning), rebase machinery (Rebase / GetRebaseStatus) for replaying descendants when an ancestor changes, and FQN-collision detection across the chain at publish time.

Added — client

  • client.WithServerChain() (#9): construct a Resolver that consults GetNamespaceChain and automatically wires ancestor Resolvers, so a single client.New(..., namespace) resolves types declared anywhere in the namespace's chain.
  • Resolver.RangeMessages(f) (#10): iterate every message type currently visible to the resolver — bound namespace plus chain ancestors. Used by editor tooling building completion lists for the @type directive.
  • Resolver.FindMessageByNameWithOrigin / Resolver.FindFileByPathWithOrigin (#11): like their non-Origin counterparts but also return the namespace ID that contributed the type / file — useful for editor integrations rendering provenance.
  • Resolver.GetSource(ctx, filePath) (#12): fetch the original .proto source bytes for a file the resolver knows. Locates the owning schema across the chain, calls the gRPC GetSource RPC, returns the requested file's bytes. Editor integrations render registry-only files as virtual documents in go-to-definition.
  • client.WithDiskCache(path) (#13): opt-in on-disk descriptor cache. Successful refreshes are persisted; when Dial cannot reach the server, the resolver falls back to the cached snapshot and reports IsStale() == true. Refresh() on a stale Resolver returns the new ErrStaleResolver. Atomic writes; ancestor namespaces persist into sibling subdirectories; top-level manifest records the chain so the offline loader can reconstruct it without server access.

Changed

  • client.Dial now follows a try-online-then-fallback flow when WithDiskCache is configured. Without that option, dial-failure behavior is unchanged.
  • client/snapshot.go: fetchSchema defers to a new compileSchema(schemaID, version, fdset, raw) helper so the offline cache loader compiles disk bytes through the same path; schemaSnapshot gains rawDescriptorSet []byte for the persister.

Dependencies

  • google.golang.org/grpc minor + patch bumps (#2, #6)
  • github.com/jackc/pgx/v5 5.9.1 → 5.9.2 (#5)
  • github.com/pressly/goose/v3 3.27.0 → 3.27.1 (#6)
  • testcontainers group bump (#3)
  • github.com/trendvidia/protowire-go → v1.0.0 (#7) — pxf v1 grammar

See CHANGELOG.md for the full entry.