Skip to content

feat: migrate from gRPC to connectRPC#182

Merged
ravisuhag merged 6 commits intomainfrom
feat/connectrpc-migration
Apr 21, 2026
Merged

feat: migrate from gRPC to connectRPC#182
ravisuhag merged 6 commits intomainfrom
feat/connectrpc-migration

Conversation

@ravisuhag
Copy link
Copy Markdown
Member

Summary

Changes

Code generation

  • buf.gen.yaml upgraded to v2 with protocolbuffers/go + connectrpc/go plugins
  • Generated code moves from proto/ to gen/

Server (internal/server/)

  • Rewritten using http.ServeMux + connectRPC handler + h2c + CORS
  • Removed graceful.go, newrelic.go (inlined shutdown, dropped NewRelic)

API handlers (internal/api/)

  • All handlers adopt connect.Request[T] / connect.Response[T] generics
  • Custom HTTP handlers for schema binary endpoints use Go 1.22 http.ServeMux patterns
  • Removed gRPC health check (ping.go), replaced with plain HTTP /ping

CLI client (cmd/)

  • All 13 cmd files use connectRPC client over plain HTTP instead of grpc.Dial
  • Error handling uses connect.Error codes instead of grpc/status

Middleware (internal/middleware/)

  • New recovery.go, logger.go, error_response.go interceptors
  • Error response middleware maps StorageErr to proper connect error codes

Errors & formats

  • StorageErr.GRPCStatus()StorageErr.ConnectError()
  • runtime.HTTPStatusErrorconnect.NewError in avro/json/protobuf format packages

Config

  • Removed GRPCConfig, NewRelicConfig
  • Added CORSConfig, flat MaxRecvMsgSize/MaxSendMsgSize

Removed

  • proto/ directory (old generated code, swagger docs)
  • pkg/validator/ (replaced by connectrpc.com/validate)
  • grpc-gateway, go-grpc-middleware, nrgrpc dependencies

Test plan

  • go build ./... passes
  • go test ./... passes (except pre-existing formats/protobuf failure due to missing protoc)
  • Server starts and serves on configured port
  • gRPC clients work via grpcurl
  • Custom schema HTTP endpoints work via curl
  • /ping returns pong

Replace gRPC server, gRPC-gateway, and associated middleware with
connectRPC following the pattern established by Compass. This gives
us native support for Connect, gRPC, and gRPC-Web protocols on a
single HTTP port with standard net/http routing.

Key changes:
- buf.gen.yaml: switch to v2 with connectrpc/go plugin
- Server: use http.ServeMux + connectRPC handler + h2c + CORS
- API handlers: adopt connect.Request/Response generics
- CLI client: use connectRPC client over plain HTTP
- Middleware: add recovery, logger, error_response interceptors
- Errors: replace GRPCStatus() with connect error codes
- Config: remove GRPCConfig/NewRelic, add CORS config
- Delete grpc-gateway, openapiv2, and custom validator packages
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 21, 2026

Warning

Rate limit exceeded

@ravisuhag has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 22 minutes and 11 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 22 minutes and 11 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c9b57d03-c023-4398-9db1-36b0b6208ede

📥 Commits

Reviewing files that changed from the base of the PR and between d8b65a7 and a18ea5b.

⛔ Files ignored due to path filters (6)
  • gen/raystack/stencil/v1beta1/stencil.pb.go is excluded by !**/*.pb.go, !**/gen/**
  • gen/raystack/stencil/v1beta1/stencilv1beta1connect/stencil.connect.go is excluded by !**/gen/**
  • go.sum is excluded by !**/*.sum
  • proto/raystack/stencil/v1beta1/stencil.pb.go is excluded by !**/*.pb.go
  • proto/raystack/stencil/v1beta1/stencil.pb.gw.go is excluded by !**/*.pb.gw.go
  • proto/raystack/stencil/v1beta1/stencil_grpc.pb.go is excluded by !**/*.pb.go
📒 Files selected for processing (41)
  • Makefile
  • buf.gen.yaml
  • cmd/check.go
  • cmd/client.go
  • cmd/create.go
  • cmd/delete.go
  • cmd/diff.go
  • cmd/download.go
  • cmd/edit.go
  • cmd/graph.go
  • cmd/info.go
  • cmd/list.go
  • cmd/namespace.go
  • cmd/print.go
  • cmd/schema.go
  • cmd/search.go
  • config/config.go
  • formats/avro/provider.go
  • formats/avro/schema.go
  • formats/json/provider.go
  • formats/protobuf/error.go
  • go.mod
  • internal/api/api.go
  • internal/api/api_test.go
  • internal/api/namespace.go
  • internal/api/ping.go
  • internal/api/schema.go
  • internal/api/schema_test.go
  • internal/api/search.go
  • internal/middleware/error_response.go
  • internal/middleware/logger.go
  • internal/middleware/recovery.go
  • internal/server/graceful.go
  • internal/server/newrelic.go
  • internal/server/server.go
  • internal/store/errors.go
  • pkg/validator/validator.go
  • proto/apidocs.swagger.json
  • proto/raystack/stencil/v1beta1/stencil.pb.validate.go
  • proto/raystack/stencil/v1beta1/stencil.swagger.json
  • proto/raystack/stencil/v1beta1/stencil.swagger.md

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 and usage tips.

@ravisuhag ravisuhag merged commit fc6be21 into main Apr 21, 2026
7 checks passed
@ravisuhag ravisuhag deleted the feat/connectrpc-migration branch April 21, 2026 03:01
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