feat(connectrpc): integrate connect-go HealthService as PoC#110
Open
feat(connectrpc): integrate connect-go HealthService as PoC#110
Conversation
- Add protobuf definition for HealthService with Check RPC - Add buf v2 configuration for codegen with connect-go and protobuf plugins - Implement connect-go HealthServer that delegates to store.Health() - Create composite HTTP handler using http.ServeMux for path-prefix routing - Wire composite handler into bootstrap so connect-go and Gin share the same port - Add proto and proto-lint Makefile targets and include proto in generate chain - Add connectrpc.com/connect dependency - Add test for HealthServer Check endpoint Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Introduces a proof-of-concept ConnectRPC (connect-go) unary HealthService alongside the existing Gin HTTP server by composing handlers under a single port, and adds Buf v2 configuration/targets for protobuf code generation.
Changes:
- Add
health.v1.HealthServiceprotobuf definition and generated Go/connect stubs. - Add
internal/connectrpcHealthServer implementation + unit test. - Route ConnectRPC services via an
http.ServeMuxcomposite handler while keeping Gin as the fallback, and add Buf v2 + Makefile targets for proto generation/linting.
Reviewed changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| proto/health/v1/health.proto | Defines the new health.v1 service/messages used for ConnectRPC PoC. |
| internal/gen/health/v1/health.pb.go | Generated protobuf Go types for the health API. |
| internal/gen/health/v1/healthv1connect/health.connect.go | Generated connect-go client/handler scaffolding. |
| internal/connectrpc/health.go | Implements the ConnectRPC HealthService backed by store.Store. |
| internal/connectrpc/health_test.go | Adds a unit test for the ConnectRPC Check RPC. |
| internal/bootstrap/server.go | Adds a composite handler that routes ConnectRPC paths and falls back to Gin. |
| internal/bootstrap/bootstrap.go | Switches server wiring to use the composite handler. |
| buf.yaml | Adds Buf v2 module/lint/breaking configuration. |
| buf.gen.yaml | Configures Buf remote plugins for Go + connect-go generation into internal/gen. |
| Makefile | Adds proto/proto-lint targets and runs proto generation as part of make generate. |
| go.mod | Adds connectrpc.com/connect and promotes protobuf to a direct dependency. |
| go.sum | Adds module sums for connectrpc.com/connect. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+110
to
120
| ## proto: generate protobuf and connect-go code | ||
| proto: | ||
| buf generate | ||
|
|
||
| ## proto-lint: lint protobuf definitions | ||
| proto-lint: | ||
| buf lint | ||
|
|
||
| ## generate: run go generate (templ compilation + mocks via go:generate directives) | ||
| generate: install-tools assets swagger | ||
| generate: install-tools assets swagger proto | ||
| $(GO) generate ./... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
HealthServicewith aCheckRPC as a proof-of-concept for integrating connect-go alongside Ginhttp.ServeMuxfor path-prefix routing so both connect-go and Gin share the same portbuf.yaml,buf.gen.yaml) and Makefile targets (proto,proto-lint) for protobuf codegenTest plan
HealthServer.Checkpassesgo test ./...)make lint)curl -X POST http://localhost:8080/health.v1.HealthService/Check -H "Content-Type: application/json" -d '{}'returnsSERVING_STATUS_SERVINGcurl http://localhost:8080/healthstill returns{"status":"healthy","database":"connected"}🤖 Generated with Claude Code