Skip to content

refactor(frontier): remove grpc-gateway and openapiv2 annotations#444

Open
whoAbhishekSah wants to merge 2 commits intomainfrom
refactor/remove-frontier-gateway-annotations
Open

refactor(frontier): remove grpc-gateway and openapiv2 annotations#444
whoAbhishekSah wants to merge 2 commits intomainfrom
refactor/remove-frontier-gateway-annotations

Conversation

@whoAbhishekSah
Copy link
Member

@whoAbhishekSah whoAbhishekSah commented Feb 24, 2026

Summary

  • Frontier no longer uses grpc-gateway (removed in refactor(server): remove gRPC and gRPC-gateway server implementation frontier#1404)
  • Remove all gateway-related annotations from frontier proto files (-2,469 lines):
    • protoc-gen-openapiv2 import, openapiv2_swagger, openapiv2_operation, openapiv2_field annotations
    • google.api.http annotations and google/api/annotations.proto / google/api/httpbody.proto imports
  • Keep google.api.field_behavior and validate annotations (still used)

Test plan

  • buf build succeeds
  • Frontier buf generate produces valid ConnectRPC stubs

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Refactoring
    • Removed OpenAPI/REST metadata and HTTP binding annotations from the API surface, simplifying generated API documentation.
    • Stripped descriptive field documentation and examples across many message types, resulting in leaner public API descriptors while keeping message and RPC signatures unchanged.

Frontier no longer uses grpc-gateway. Remove all gateway-related
annotations from proto files:

- Remove `protoc-gen-openapiv2` import, swagger, operation, and field annotations
- Remove `google.api.http` annotations and imports
- Keep `google.api.field_behavior` and `validate` annotations

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link

coderabbitai bot commented Feb 24, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 83275e9 and d93715a.

📒 Files selected for processing (2)
  • raystack/frontier/v1beta1/admin.proto
  • raystack/frontier/v1beta1/frontier.proto

📝 Walkthrough

Walkthrough

This PR removes OpenAPI/Swagger annotations and gRPC gateway HTTP bindings from protobufs, stripping field-level openapiv2 and grpc-gateway metadata while preserving all message types and RPC signatures.

Changes

Cohort / File(s) Summary
OpenAPI/HTTP Metadata Removal
raystack/frontier/v1beta1/admin.proto
Removed global openapiv2_swagger block, openapiv2_operation annotations, google.api.http bindings, and per-RPC field descriptions—RPC signatures and message references unchanged.
Field Annotation Cleanup
raystack/frontier/v1beta1/models.proto
Stripped openapiv2_field and many field_behavior annotations from numerous messages (Invitation, MetaSchema, AuditLog, WebhookEvent, Resource, Domain, Policy, Relation, Permission, Namespace, etc.), and removed openapi-specific timestamp annotations while keeping types, tags, and names.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 I nibbled at annotations, tidy and quick,
Stripped the fluff so the messages stick.
No REST crumbs left, just proto and thread,
Clean fields hop forward, lightly I tread.
A rabbit's small cheer for a leaner spread.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the primary objective of the changeset: removing grpc-gateway and openapiv2 annotations from Frontier proto files. It is concise, specific, and directly summarizes the main 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.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch refactor/remove-frontier-gateway-annotations

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


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.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 5

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@raystack/frontier/v1beta1/admin.proto`:
- Around line 243-246: The proto contains invalid empty field option brackets
"[]" on multiple field declarations (e.g., fields named keyword, org_id,
group_id, state and many others) which causes a syntax error; remove the empty
brackets entirely from each affected field declaration (search for occurrences
of " = <number> [];" and change them to " = <number> ;") across the file so
declarations like string keyword = 3 []; string org_id = 4 []; etc. become valid
protobuf fields, and repeat this fix for all listed occurrences (including the
other affected fields referenced in the review).
- Around line 557-560: Each of the proto field option lists is missing the comma
separator between multiple options; for each affected field (e.g.,
UpdateWebhookRequest.id, DeleteWebhookRequest.id,
SearchUserOrganizationsRequest.id, SearchUserProjectsRequest.user_id,
SearchUserProjectsRequest.org_id) update the field option bracket to include a
comma between options (for example: (google.api.field_behavior) = REQUIRED,
(validate.rules).string.uuid = true) so the options are valid protobuf syntax;
apply this same fix to all listed fields.
- Line 1024: The field declaration for metadata in admin.proto is corrupted by
leftover openapiv2 annotation remnants; update the declaration for the field
named "metadata" (google.protobuf.Struct metadata) to valid protobuf syntax by
removing the entire malformed annotation suffix and terminating the field
properly (e.g., "google.protobuf.Struct metadata = 3;"), ensuring no stray
characters or annotation fragments remain.
- Around line 693-698: The field definition for id contains an accidental double
semicolon and split validate rules; remove the extra semicolon after the options
and consolidate the two validate.rules entries into a single
(validate.rules).string block that includes both min_len and uuid to avoid
conflicting/duplicated options (target the field named "id" and its
(google.api.field_behavior) / (validate.rules).string annotations).
- Around line 5-9: admin.proto still references google.api.HttpBody for six RPCs
(the methods around lines 60, 65, 70, 75, 80 and 226) but the httpbody import
was removed, so protobuf compilation fails; instead of re-adding
google/api/httpbody.proto, define explicit response message types in
raystack/frontier/v1beta1/models.proto (e.g., StreamingResponse, ExportResponse,
etc.) that capture the streamed payload or metadata you need, update each RPC in
admin.proto to return those specific messages (or a google.protobuf.Any/bytes
field inside those messages if the payload is opaque), and then remove the
now-unused google.api.httpbody import from admin.proto; target the RPC
signatures around the noted lines and corresponding response message definitions
in models.proto when making the change.

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 330c755 and 83275e9.

📒 Files selected for processing (3)
  • raystack/frontier/v1beta1/admin.proto
  • raystack/frontier/v1beta1/frontier.proto
  • raystack/frontier/v1beta1/models.proto

Comment on lines 5 to 9
import "google/api/field_behavior.proto";
import "google/protobuf/struct.proto";
import "google/protobuf/timestamp.proto";
import "google/api/httpbody.proto";
import "protoc-gen-openapiv2/options/annotations.proto";
import "raystack/frontier/v1beta1/models.proto";
import "validate/validate.proto";
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify import status and HttpBody usages in admin.proto

echo "=== Checking for httpbody imports ==="
rg -n 'import.*httpbody' raystack/frontier/v1beta1/admin.proto || echo "(no httpbody imports found)"

echo ""
echo "=== Checking for HttpBody type usages ==="
rg -n 'HttpBody' raystack/frontier/v1beta1/admin.proto || echo "(no HttpBody usages found)"

echo ""
echo "=== Showing all imports in the file ==="
head -20 raystack/frontier/v1beta1/admin.proto

Repository: raystack/proton

Length of output: 1456


Missing import for google.api.HttpBody — protobuf compilation will fail.

The import for google/api/httpbody.proto has been removed, but six RPCs still reference google.api.HttpBody as their return type (lines 60, 65, 70, 75, 80, 226). This causes an undefined type error during compilation.

Since the raystack/proton project no longer uses gRPC-Gateway, these streaming RPCs should be refactored to use a different return type instead of restoring the import.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@raystack/frontier/v1beta1/admin.proto` around lines 5 - 9, admin.proto still
references google.api.HttpBody for six RPCs (the methods around lines 60, 65,
70, 75, 80 and 226) but the httpbody import was removed, so protobuf compilation
fails; instead of re-adding google/api/httpbody.proto, define explicit response
message types in raystack/frontier/v1beta1/models.proto (e.g.,
StreamingResponse, ExportResponse, etc.) that capture the streamed payload or
metadata you need, update each RPC in admin.proto to return those specific
messages (or a google.protobuf.Any/bytes field inside those messages if the
payload is opaque), and then remove the now-unused google.api.httpbody import
from admin.proto; target the RPC signatures around the noted lines and
corresponding response message definitions in models.proto when making the
change.

Comment on lines 693 to 698
string id = 1 [
(google.api.field_behavior) = REQUIRED,
(validate.rules).string = {min_len: 1},
(validate.rules).string.uuid = true,
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {description: "id of the prospect"}
(validate.rules).string.uuid = true
];;
}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Double semicolon and potentially conflicting validate rules.

Line 697 has a double semicolon (];;). While proto3 may tolerate an extra empty statement, this is likely unintentional from the annotation removal and should be cleaned up.

Additionally, Lines 694–696 define two separate (validate.rules).string entries — one as a message literal {min_len: 1} and one as a scalar uuid = true. Depending on how protoc-gen-validate merges these, they could conflict. Consider consolidating:

🧹 Proposed fix
   string id = 1 [
     (google.api.field_behavior) = REQUIRED,
-    (validate.rules).string = {min_len: 1},
-    (validate.rules).string.uuid = true
-  ];;
+    (validate.rules).string = {min_len: 1, uuid: true}
+  ];
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
string id = 1 [
(google.api.field_behavior) = REQUIRED,
(validate.rules).string = {min_len: 1},
(validate.rules).string.uuid = true,
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {description: "id of the prospect"}
(validate.rules).string.uuid = true
];;
}
string id = 1 [
(google.api.field_behavior) = REQUIRED,
(validate.rules).string = {min_len: 1, uuid: true}
];
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@raystack/frontier/v1beta1/admin.proto` around lines 693 - 698, The field
definition for id contains an accidental double semicolon and split validate
rules; remove the extra semicolon after the options and consolidate the two
validate.rules entries into a single (validate.rules).string block that includes
both min_len and uuid to avoid conflicting/duplicated options (target the field
named "id" and its (google.api.field_behavior) / (validate.rules).string
annotations).

The annotation removal script left behind:
- Empty field option brackets `[]` on fields
- Missing commas between remaining field options
- Partial annotation remnants on metadata fields
- Incorrectly removed google/api/httpbody.proto import (still needed for HttpBody return types)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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