Skip to content

feat: migrate OrgExport RPC to ConnectRPC server #1080

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Jul 30, 2025

Conversation

whoAbhishekSah
Copy link
Member

@whoAbhishekSah whoAbhishekSah commented Jul 24, 2025

Description

Migrate ExportOrganizations RPC to ConnectRPC.

Changes

  • Refactor Session, Authentication and Authorization Interceptor to implement connect.Interceptor interface.

Testing

The endpoint has been tested to return CSV data in each stream response.

Screenshot 2025-07-28 at 2 02 43 PM

Additionally, this has been tested with grpcurl.

➜  frontier-test git:(main) ✗ grpcurl -v \
  -plaintext \
  -H "Cookie: sid=${COOKIE}" \
  -import-path ./googleapis \
  -import-path ./grpc-gateway \
  -import-path ./protoc-gen-validate \
  -import-path ../raystack/proton \
  -proto ../raystack/proton/raystack/frontier/v1beta1/Admin.proto \
  -d '{}' \
  localhost:8002 \
  raystack.frontier.v1beta1.AdminService/ExportOrganizations

Response

Resolved method descriptor:
// buf:lint:ignore RPC_RESPONSE_STANDARD_NAME
// buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE
rpc ExportOrganizations ( .raystack.frontier.v1beta1.ExportOrganizationsRequest ) returns ( stream .google.api.HttpBody ) {
  option (.google.api.http) = { get: "/v1beta1/admin/organizations/export" };
  option (.grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
    tags: [ "Organization" ],
    summary: "Export organizations",
    description: "Export organization with demographic properties and billing plan details",
    produces: [ "text/csv" ]
  };
}

Request metadata to send:
cookie: sid=asdasdfsa

Response headers received:
content-type: application/grpc
date: Mon, 28 Jul 2025 08:28:17 GMT
grpc-accept-encoding: gzip

Response contents:
{
  "contentType": "text/csv",
  "data": "dsafas="
}

Response contents:
{
  "contentType": "text/csv",
  "data": "dsafas="
}

Response contents:
{
  "contentType": "text/csv",
  "data": "dsafas="
}

Response contents:
{
  "contentType": "text/csv",
  "data": "dsafas="
}

Response contents:
{
  "contentType": "text/csv",
  "data": "dsafas="
}

Response contents:
{
  "contentType": "text/csv",
  "data": "dsafas="
}

Response contents:
{
  "contentType": "text/csv",
  "data": "dsafas="
}

Response contents:
{
  "contentType": "text/csv",
  "data": "dsafas="
}

Response contents:
{
  "contentType": "text/csv",
  "data": "dsafas="
}

Response trailers received:
(empty)
Sent 1 request and received 9 responses

Copy link

vercel bot commented Jul 24, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
frontier ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 30, 2025 8:56am

@whoAbhishekSah whoAbhishekSah changed the title feat: migrate Admin Organization Export RPCs to ConnectRPC server feat: migrate OrgExport RPCs to ConnectRPC server Jul 24, 2025
@coveralls
Copy link

coveralls commented Jul 28, 2025

Pull Request Test Coverage Report for Build 16618028728

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 0 of 179 (0.0%) changed or added relevant lines in 5 files are covered.
  • 4 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-0.1%) to 31.153%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pkg/server/server.go 0 8 0.0%
internal/api/v1beta1connect/organization_billing.go 0 21 0.0%
pkg/server/connect_interceptors/authentication.go 0 36 0.0%
pkg/server/connect_interceptors/authorization.go 0 38 0.0%
pkg/server/connect_interceptors/session.go 0 76 0.0%
Files with Coverage Reduction New Missed Lines %
pkg/server/connect_interceptors/authentication.go 2 0.0%
pkg/server/connect_interceptors/authorization.go 2 0.0%
Totals Coverage Status
Change from base Build 16491593990: -0.1%
Covered Lines: 10073
Relevant Lines: 32334

💛 - Coveralls

@whoAbhishekSah whoAbhishekSah changed the title feat: migrate OrgExport RPCs to ConnectRPC server feat: migrate OrgExport RPC to ConnectRPC server Jul 28, 2025
@whoAbhishekSah whoAbhishekSah merged commit 03da476 into main Jul 30, 2025
7 checks passed
@whoAbhishekSah whoAbhishekSah deleted the connectrpc_admin_org_export_apis branch July 30, 2025 09:00
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.

3 participants