Skip to content
Snippets Groups Projects

WIP: Add grpc-gateway support

Closed Andrew Newdigate requested to merge experimental/grpc-gateway into master

Related to https://gitlab.com/gitlab-org/gitaly/issues/191

Experimenting in adding grpc-gateway, Swagger and auto-generated Ruby client support to gitaly-proto

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Very impressive. So if I understand correctly, the changes in this MR are:

    • run extra code generation plugin when building libs from .proto
    • some of these code generator plugins use Java -> would be a development dependency for gitaly-proto only, not runtime, no Java needed for gitaly server / clients
    • we would have to annotate each RPC to indicate what it's REST endpoint would be
  • added 1 commit

    • 505b15aa - :sparkles: Feature: now generating a full API client

    Compare with previous version

  • Author Maintainer

    run extra code generation plugin when building libs from .proto

    There are two new protoc generators

    • a Go grpc Gateway generator (gateway/*.pb.gw.go), which generates the JSON to gRPC go server logic
    • a Swagger generator, (swagger/*.swagger.json), which generators a Swagger definition of the JSON gateway

    Once we have the Swagger generator, we're able to generator a native Ruby client (or client for any other major language, for that matter). In order to do this, we run swagger-codegen generate. Unfortunately, the Swagger generator is written in Java, so we have a build time dependency on Java.

    we would have to annotate each RPC to indicate what it's REST endpoint would be

    Yes, although this this is a fairly trivial thing to do. I did this for all the existing endpoints in a matter of minutes.

Please register or sign in to reply
Loading