Skip to content

feat(connectrpc): integrate connect-go HealthService as PoC#110

Open
appleboy wants to merge 1 commit intomainfrom
feat/connectrpc-health
Open

feat(connectrpc): integrate connect-go HealthService as PoC#110
appleboy wants to merge 1 commit intomainfrom
feat/connectrpc-health

Conversation

@appleboy
Copy link
Member

Summary

  • Add connect-go HealthService with a Check RPC as a proof-of-concept for integrating connect-go alongside Gin
  • Create composite HTTP handler using http.ServeMux for path-prefix routing so both connect-go and Gin share the same port
  • Add buf v2 configuration (buf.yaml, buf.gen.yaml) and Makefile targets (proto, proto-lint) for protobuf codegen

Test plan

  • New unit test for HealthServer.Check passes
  • Full test suite passes (go test ./...)
  • Lint passes (make lint)
  • Manual: curl -X POST http://localhost:8080/health.v1.HealthService/Check -H "Content-Type: application/json" -d '{}' returns SERVING_STATUS_SERVING
  • Manual: curl http://localhost:8080/health still returns {"status":"healthy","database":"connected"}

🤖 Generated with Claude Code

- 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>
Copilot AI review requested due to automatic review settings March 16, 2026 15:28
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.HealthService protobuf definition and generated Go/connect stubs.
  • Add internal/connectrpc HealthServer implementation + unit test.
  • Route ConnectRPC services via an http.ServeMux composite 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 ./...
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.

2 participants