Skip to content

chore(compass): remove grpc-gateway annotations#459

Merged
ravisuhag merged 1 commit intomainfrom
chore/remove-grpc-gateway-annotations
Mar 28, 2026
Merged

chore(compass): remove grpc-gateway annotations#459
ravisuhag merged 1 commit intomainfrom
chore/remove-grpc-gateway-annotations

Conversation

@ravisuhag
Copy link
Copy Markdown
Member

Summary

  • Remove all grpc-gateway and OpenAPI annotations from the Compass service proto file
  • Part of the migration to Connect RPC in raystack/compass

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.

Related

Test plan

  • Proto file compiles successfully with buf lint
  • Generated code works with Connect RPC in compass

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.
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 28, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 86ab143f-0ce1-49e2-8de2-fefff005a764

📥 Commits

Reviewing files that changed from the base of the PR and between 409f146 and 7121b18.

📒 Files selected for processing (1)
  • raystack/compass/v1beta1/service.proto

📝 Walkthrough

Walkthrough

This pull request removes all OpenAPI/Swagger generation annotations and HTTP routing metadata from the Compass gRPC service definition. Specifically, it deletes grpc.gateway.protoc_gen_openapiv2 options, google.api.http routing annotations, and related imports from raystack/compass/v1beta1/service.proto. Field-level and message-level gateway schema descriptions are also removed, while existing validation rules and core message structures remain unchanged. The net effect is a reduction of 665 lines with 45 additions.

Suggested reviewers

  • whoAbhishekSah
  • rohilsurana
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely summarizes the main change: removing grpc-gateway annotations from the Compass service proto file.
Description check ✅ Passed The description is clearly related to the changeset, providing a detailed summary of the removal of grpc-gateway and OpenAPI annotations, specific files affected, and the reasoning behind the change.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ 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.

❤️ Share

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

ravisuhag added a commit to raystack/compass that referenced this pull request Mar 28, 2026
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
@ravisuhag ravisuhag merged commit b9ed2ad into main Mar 28, 2026
3 checks passed
@ravisuhag ravisuhag deleted the chore/remove-grpc-gateway-annotations branch March 28, 2026 02:52
ravisuhag added a commit to raystack/compass that referenced this pull request Mar 28, 2026
* 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
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