chore(compass): remove grpc-gateway annotations#459
Conversation
Remove all grpc-gateway and OpenAPI annotations from the Compass service proto file as part of the migration to Connect RPC. Changes: - Remove google/api/annotations.proto import - Remove protoc-gen-openapiv2/options/annotations.proto import - Remove openapiv2_swagger file-level option - Remove google.api.http options from all RPC methods - Remove openapiv2_operation options from all RPC methods - Remove openapiv2_schema options from all messages - Remove openapiv2_field annotations from all fields The validation rules (validate.proto) are preserved as they are still used for request validation. This change supports the Connect RPC migration in raystack/compass.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis pull request removes all OpenAPI/Swagger generation annotations and HTTP routing metadata from the Compass gRPC service definition. Specifically, it deletes Suggested reviewers
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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. Comment |
Update PROTON_COMMIT to 7121b18 which removes grpc-gateway annotations from the compass proto definitions. This results in cleaner generated code with 1770 fewer lines as the OpenAPI and HTTP annotations are no longer included. Related: raystack/proton#459
* feat: migrate from gRPC + grpc-gateway to Connect RPC
This migration replaces the gRPC + grpc-gateway setup with Connect RPC,
following the patterns established by raystack/frontier.
Key changes:
- Single port (8080) instead of dual ports (HTTP + gRPC)
- Native HTTP support via Connect instead of grpc-gateway reverse proxy
- New interceptors in pkg/server/interceptor/ replacing pkg/grpc_interceptor/
- Buf v2 proto generation with connectrpc/go plugin
Server changes:
- Use h2c.NewHandler for HTTP/2 cleartext support
- Single http.ServeMux with Connect service handlers
- gRPC reflection support via connectrpc/grpcreflect
Handler changes:
- Signatures use connect.Request[T] and connect.Response[T] wrappers
- Access request fields via req.Msg.GetXxx()
- Return responses via connect.NewResponse(&pb.Response{})
- Errors via connect.NewError(connect.CodeXxx, err)
Client changes:
- Connect client with HTTP transport
- Requests wrapped with connect.NewRequest()
- Responses accessed via resp.Msg
Test changes:
- Updated to use connect.NewRequest() for handler calls
- Fixed error checking: err == nil for success (not connect.CodeOf)
- connect.CodeOf(nil) returns CodeUnknown, not 0
* chore: regenerate protos from updated proton
Update PROTON_COMMIT to 7121b18 which removes grpc-gateway
annotations from the compass proto definitions.
This results in cleaner generated code with 1770 fewer lines
as the OpenAPI and HTTP annotations are no longer included.
Related: raystack/proton#459
* chore: clean up proto gen and simplify import paths
Remove stale generated dependency stubs (google/api, validate,
openapiv2, swagger) that are no longer needed. Flatten proto output
from proto/raystack/compass/v1beta1/ to proto/compassv1beta1/ by
switching buf.gen.yaml from paths=source_relative to module mode
with an explicit go_package override.
* chore: remove remaining gRPC artifacts after Connect RPC migration
- Remove unused gRPC health check (internal/server/health/)
- Replace gRPC status error handling with Connect errors in main.go
- Simplify error_response interceptor to remove gRPC dependency
- Switch client from gRPC wire format to Connect ProtoJSON
- Remove stale gRPC config from config.yaml and docs
- Remove gRPC ClientConn reference from golangci config
- Update README and docs to reflect Connect RPC
* fix: resolve lint errors and address code review findings
Fix golangci-lint errors (errcheck, ineffassign, staticcheck) and
address CodeRabbit review findings: correct error codes, prevent
internal error leakage, add input validation, and sanitize panic
recovery output.
* fix: address remaining code review findings
- Update protocolbuffers/go buf plugin to v1.36.11 to match go.mod
- Sanitize ErrorResponse interceptor to prevent leaking internal errors
by accepting a logger and returning generic error with ref ID
- Add namespace.ErrNotFound sentinel to core/namespace and use it in
the namespace interceptor to distinguish not-found from other errors
- Update postgres namespace repo and cli/server.go to use the new
domain-level sentinel
* fix: address additional code review findings
- Remove duplicate ValidateAll() call in UpdateComment handler
- Differentiate not-found from other errors in GetNamespace handler
using namespace.ErrNotFound sentinel
- Use len() check instead of nil for tag_values validation to catch
explicit empty slices
Summary
Changes
google/api/annotations.protoimportprotoc-gen-openapiv2/options/annotations.protoimportopenapiv2_swaggerfile-level optiongoogle.api.httpoptions from all RPC methodsopenapiv2_operationoptions from all RPC methodsopenapiv2_schemaoptions from all messagesopenapiv2_fieldannotations from all fieldsThe validation rules (
validate.proto) are preserved as they are still used for request validation.Related
Test plan
buf lint