Skip to content

chore(adr): record protobuf rpc over nats micro binding decision#471

Merged
yordis merged 4 commits into
mainfrom
yordis/copy-adr-0016-nats-rpc
Jul 6, 2026
Merged

chore(adr): record protobuf rpc over nats micro binding decision#471
yordis merged 4 commits into
mainfrom
yordis/copy-adr-0016-nats-rpc

Conversation

@yordis

@yordis yordis commented Jul 4, 2026

Copy link
Copy Markdown
Member
  • First-party protobuf services on NATS had no governing rule for subjects, error signaling, or discovery, exposing them to the same mapping drift that motivated ADR 0011 for the JSON-RPC family.
  • The trogon.nats.micro.v1alpha1 annotations already ship in trogon-proto without an ADR defining what they mean on the wire.
  • Two flat headers cannot carry machine-readable reasons, field violations, or retry hints, so error replies adopt google.rpc.Status and the canonical code space rather than a per-service invention or a second HTTP vocabulary.

Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
@cursor

cursor Bot commented Jul 4, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Documentation-only ADR and index update; no runtime or implementation changes in this PR.

Overview
Adds ADR 0016, which defines how first-party protobuf service contracts ride on NATS micro—the protobuf counterpart to ADR 0011’s JSON-RPC binding—and links it from docs/adr/index.md.

The decision maps trogon.nats.micro.v1alpha1-annotated services to one NATS micro service per proto service, with subjects <prefix>.<service>.<Method>, request/reply bodies as protobuf messages, and success vs failure determined solely by Nats-Service-Error-Code (not by guessing from the body). Error replies carry a full google.rpc.Status in the payload with mirrored headers, canonical google.rpc.Code, and a shared binding layer instead of per-service NATS mappings. ServiceOptions.content_type governs protobuf vs canonical JSON at the edge; discovery, versioning, and queue-group scaling defer to NATS micro. Real gRPC over HTTP/2 is explicitly out of scope.

Reviewed by Cursor Bugbot for commit 5c71257. Bugbot is set up for automated code reviews on this repo. Configure here.

@coderabbitai

coderabbitai Bot commented Jul 4, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@yordis, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 40 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c7b1d4d8-db21-49a2-a70e-b1bcc744fe15

📥 Commits

Reviewing files that changed from the base of the PR and between 2194dde and 5c71257.

📒 Files selected for processing (1)
  • docs/adr/0016-protobuf-rpc-over-nats-micro-binding.md

Walkthrough

This PR adds ADR 0016 documenting how annotated Protocol Buffers services bind to NATS micro, including service and RPC mapping, reply/error rules, content-type handling, invariants, alternatives, consequences, and an index entry.

Changes

ADR Documentation

Layer / File(s) Summary
ADR front matter and context
docs/adr/0016-protobuf-rpc-over-nats-micro-binding.md
Adds ADR metadata and the opening context for protobuf wire contracts, prior JSON-RPC binding scope, and the need for a protobuf-specific NATS rule.
Protobuf to micro mapping
docs/adr/0016-protobuf-rpc-over-nats-micro-binding.md
Defines how annotated protobuf services and RPCs map to NATS micro services and endpoints, including subject derivation and structural routing.
Reply and payload rules
docs/adr/0016-protobuf-rpc-over-nats-micro-binding.md
Specifies the success and error reply contract, header and body projection for google.rpc.Status, content-type negotiation, and NATS micro discovery and scaling behavior.
Invariants and scope
docs/adr/0016-protobuf-rpc-over-nats-micro-binding.md
States the shared binding layer scope, the explicit invariants, rejected alternatives, and the consequences and references for the ADR.
ADR index registration
docs/adr/index.md
Adds a link to ADR 0016 in the ADR index Records list.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Poem

A rabbit hops through docs so neat,
ADR sixteen, quite a feat! 🐇
Protobuf and NATS now bind as one,
Subjects derived, the mapping’s done,
Headers whisper success or strife,
Index updated, docs come to life. 📜✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly summarizes the ADR about protobuf RPC over NATS micro binding.
Description check ✅ Passed The description matches the ADR change and explains the binding and error-signaling rationale.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch yordis/copy-adr-0016-nats-rpc

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

yordis added 3 commits July 6, 2026 14:33
Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
@yordis yordis merged commit 7fb9298 into main Jul 6, 2026
4 checks passed
@yordis yordis deleted the yordis/copy-adr-0016-nats-rpc branch July 6, 2026 19:20
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