Skip to content

proto: add ResolveTXT RPC#2100

Merged
lionello merged 1 commit intomainfrom
edw/proto-resolve-txt
May 7, 2026
Merged

proto: add ResolveTXT RPC#2100
lionello merged 1 commit intomainfrom
edw/proto-resolve-txt

Conversation

@edwardrf
Copy link
Copy Markdown
Contributor

@edwardrf edwardrf commented May 7, 2026

Description

Adds the ResolveTXT RPC to FabricController, mirroring the existing
ResolveIPAddr / ResolveCNAME / ResolveNS shape:

  • request: domain (required) + ns_server (optional; empty = recursive from root)
  • response: repeated string txts
  • idempotency_level = NO_SIDE_EFFECTS

This unblocks two follow-ups:

  1. Server-side handler in defang-mvp — same place that handles the existing three Resolve* RPCs (added in defang-mvp#2914). Will land separately once defang-mvp picks up the regenerated bindings via its dependency on this repo.
  2. CLI client wiring in Use fabric dns client for dns resolves #2069 — that PR introduces FabricResolverClient and FabricResolver; once this proto change is merged, Use fabric dns client for dns resolves #2069 picks up ResolveTXT and adds:
    • FabricClient.ResolveTXT (interface)
    • GrpcClient.ResolveTXT (impl)
    • MockFabricClient.ResolveTXT (test stub)
    • FabricResolverClient.ResolveTXT (subset interface)
    • FabricResolver.LookupTXT (impl)

The pkg/dns.Resolver interface already gained LookupTXT (used by Azure cert validation in pkg/cli/client/byoc/azure/cert.go); the fabric resolver impl is the only Resolver still missing it once #2069 lands.

Linked issues

Prereq for #2069 and the eventual server-side change in defang-mvp.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added DNS TXT record resolution capability to the Fabric Controller service, enabling queries for domain TXT records with optional nameserver specification.

Mirrors the existing ResolveIPAddr / ResolveCNAME / ResolveNS shape:
domain + optional ns_server in the request, repeated strings in the
response. NO_SIDE_EFFECTS idempotency.

Server-side handler will land in defang-mvp on top of this. CLI client
wiring (FabricClient / GrpcClient / MockFabricClient / FabricResolver)
will follow in the in-flight #2069 branch once it picks up these
regenerated bindings.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 7, 2026

Review Change Stack
No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 864478f3-90cc-4e6a-958a-a97478cb2cc2

📥 Commits

Reviewing files that changed from the base of the PR and between 7902437 and e27db08.

⛔ Files ignored due to path filters (1)
  • src/protos/io/defang/v1/fabric.pb.go is excluded by !**/*.pb.go
📒 Files selected for processing (2)
  • src/protos/io/defang/v1/defangv1connect/fabric.connect.go
  • src/protos/io/defang/v1/fabric.proto

📝 Walkthrough

Walkthrough

A new DNS TXT record resolution RPC is added to the FabricController service. The protobuf definition introduces ResolveTXT, ResolveTXTRequest, and ResolveTXTResponse messages. The Connect-Go generated code adds corresponding client and handler interfaces, procedure constants, and complete server/client wiring for the new RPC.

Changes

ResolveTXT RPC Addition

Layer / File(s) Summary
Protocol Contract
src/protos/io/defang/v1/fabric.proto
FabricController service gains ResolveTXT RPC returning ResolveTXTResponse from ResolveTXTRequest with NO_SIDE_EFFECTS idempotency. ResolveTXTRequest carries domain and optional ns_server. ResolveTXTResponse carries repeated txts.
Client Interface & Constants
src/protos/io/defang/v1/defangv1connect/fabric.connect.go
FabricControllerResolveTXTProcedure constant and ResolveTXT method signature added to FabricControllerClient interface.
Client Implementation
src/protos/io/defang/v1/defangv1connect/fabric.connect.go
fabricControllerClient struct wires a new resolveTXT Connect unary client instance with schema and idempotency binding, and implements the ResolveTXT method delegating to CallUnary.
Handler Interface & Server Wiring
src/protos/io/defang/v1/defangv1connect/fabric.connect.go
FabricControllerHandler interface gains ResolveTXT method. NewFabricControllerHandler creates and registers fabricControllerResolveTXTHandler binding to svc.ResolveTXT. HTTP route dispatch switch handles FabricControllerResolveTXTProcedure case.
Unimplemented Scaffold
src/protos/io/defang/v1/defangv1connect/fabric.connect.go
UnimplementedFabricControllerHandler.ResolveTXT returns connect.CodeUnimplemented.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • DefangLabs/defang#2057: Adds ResolveIPAddr, ResolveCNAME, and ResolveNS RPCs to FabricController with analogous Connect-Go wiring patterns.

Suggested reviewers

  • lionello
  • jordanstephens

Poem

🐰 A TXT record now resolved with DNS delight,
Connect wires gleam, both client and tight,
Handler and scaffold, all perfectly placed,
The FabricController knows its new space!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'proto: add ResolveTXT RPC' directly and clearly summarizes the main change: adding a new ResolveTXT RPC endpoint to the proto definition, which is confirmed by both file summaries.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch edw/proto-resolve-txt

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 golangci-lint (2.12.1)

level=warning msg="The linter 'gomodguard' is deprecated (since v2.12.0) due to: new major version. Replaced by gomodguard_v2."
level=warning msg="Suggested new configuration:\nlinters:\n enable:\n - gomodguard_v2\n"
level=warning msg="[linters_context] running gomodguard failed: unable to read module file go.mod: current working directory must have a go.mod file: if you are not using go modules it is suggested to disable this linter"
level=error msg="[linters_context] typechecking error: pattern ./...: directory prefix . does not contain main module or its selected dependencies"


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

@lionello lionello merged commit 861b50c into main May 7, 2026
14 checks passed
@lionello lionello deleted the edw/proto-resolve-txt branch May 7, 2026 21:27
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.

3 participants