)]}'
{
  "commit": "2082ee8bb5a7966d7e921c848778eb0dec431d56",
  "tree": "7ff29f810316ff0e8f9bd885fa0518e7f15aae5b",
  "parents": [
    "d8791df72e83efae99a149d854fcd6c16680825a"
  ],
  "author": {
    "name": "KJ Tsanaktsidis",
    "email": "ktsanaktsidis@zendesk.com",
    "time": "Fri Mar 22 10:32:08 2024 -0700"
  },
  "committer": {
    "name": "Copybara-Service",
    "email": "copybara-worker@google.com",
    "time": "Fri Mar 22 10:35:56 2024 -0700"
  },
  "message": "Implement service \u0026 method descriptor lookup in Ruby (#15817)\n\nThis PR implements lookup of service descriptor and method descriptor objects in Ruby as described in issue https://github.com/protocolbuffers/protobuf/issues/14891.\n\nIt contains three implementations - one for the CRuby extension API, one for JRuby, and one for FFI.\n\nWith this patch,\n\n* `DescriptorPool#lookup(\u0027fully.qualified.service.name\u0027)` works and returns a `Google::Protobuf::ServiceDescriptor` object\n* You can call `#options` on that to get the service options\n* You can call `#methods` on that to get the services\u0027 methods as `Google::Protobuf::MethodDescriptor` objects,\n* You can call `MethodDescriptor#options` to get method options\n* You can also get the streaming flags \u0026 input/output types of the method with `#input_type`, `#output_type`, `#client_streaming`, and `#server_streaming`.\n\nIn order to make the FFI implementation work, I had to mark some more methods in the UPB header as exported - I guess that\u0027s something which will have to be done on the UPB side, like this https://github.com/protocolbuffers/upb/commit/01fed1cc1ba255bf22b49393ba054b8d270e6ba3\n\nCC @dazuma \u0026 @haberman from the original issue, and @JasonLunn (since you work on protobuf it seems - small world!)\n\nI apologies for the large volume of copy-pasta\u0027d code from the existing descriptor class implementations into the new ones - I felt this was probably better than designing new abstractions to reduce it off the bat though; this feels like it \"fits in\" with the existing implementation.\n\nCloses #15817\n\nCOPYBARA_INTEGRATE_REVIEW\u003dhttps://github.com/protocolbuffers/protobuf/pull/15817 from KJTsanaktsidis:ktsanaktsidis/add_service_method_descriptors 54d72184310d7d9bfc06d4a58956e3871170c43d\nPiperOrigin-RevId: 618221016\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "f25b4f7cdfb1af9e96b754aba8cce08b2affa6a6",
      "old_mode": 33188,
      "old_path": ".gitignore",
      "new_id": "37d7aebc74b8de21fef2655952eb16e79df71749",
      "new_mode": 33188,
      "new_path": ".gitignore"
    },
    {
      "type": "modify",
      "old_id": "efcb17c82f815f76533e0b316c7a3676d1ee034e",
      "old_mode": 33188,
      "old_path": "ruby/Rakefile",
      "new_id": "92118af99c446de7d75687bb38264bc14f3df58d",
      "new_mode": 33188,
      "new_path": "ruby/Rakefile"
    },
    {
      "type": "modify",
      "old_id": "4f8b6bee1620c3e4c7797b4d4329836bd50bb7d8",
      "old_mode": 33188,
      "old_path": "ruby/ext/google/protobuf_c/defs.c",
      "new_id": "5ef73d5ac9d3026ed22103a245db0f58e96a6fcf",
      "new_mode": 33188,
      "new_path": "ruby/ext/google/protobuf_c/defs.c"
    },
    {
      "type": "modify",
      "old_id": "e51e364279f5a9c8b9dc88c2971884bb6619dc31",
      "old_mode": 33188,
      "old_path": "ruby/ext/google/protobuf_c/glue.c",
      "new_id": "3c84d7fb47555544ad60d9e3455f4081dad47d7d",
      "new_mode": 33188,
      "new_path": "ruby/ext/google/protobuf_c/glue.c"
    },
    {
      "type": "modify",
      "old_id": "96c7d09417dfdc2479a0900a30e3f732440df085",
      "old_mode": 33188,
      "old_path": "ruby/lib/google/protobuf/ffi/descriptor_pool.rb",
      "new_id": "4dc177d5821497390bc374a9529c7ce74292bbed",
      "new_mode": 33188,
      "new_path": "ruby/lib/google/protobuf/ffi/descriptor_pool.rb"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "b7bbf0af08747bbd190cb9258c7499f17f357fd3",
      "new_mode": 33188,
      "new_path": "ruby/lib/google/protobuf/ffi/method_descriptor.rb"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "d8554d379d6d05c7f1db391b9cef433441738c25",
      "new_mode": 33188,
      "new_path": "ruby/lib/google/protobuf/ffi/service_descriptor.rb"
    },
    {
      "type": "modify",
      "old_id": "0839b36d3f345876840fd00d316796d910b198d8",
      "old_mode": 33188,
      "old_path": "ruby/lib/google/protobuf_ffi.rb",
      "new_id": "6580df49a1e3d3907d05ea1fbdb63275759ca2c6",
      "new_mode": 33188,
      "new_path": "ruby/lib/google/protobuf_ffi.rb"
    },
    {
      "type": "modify",
      "old_id": "7c01eb92709a390b3a61f04d4ee397d85cbbc5f6",
      "old_mode": 33188,
      "old_path": "ruby/src/main/java/com/google/protobuf/jruby/RubyDescriptorPool.java",
      "new_id": "017c9d5394d2585be49746d93df2d8cfbfc61f1e",
      "new_mode": 33188,
      "new_path": "ruby/src/main/java/com/google/protobuf/jruby/RubyDescriptorPool.java"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "1f339357934a8a8b356e5b60473bd95f87b9b853",
      "new_mode": 33188,
      "new_path": "ruby/src/main/java/com/google/protobuf/jruby/RubyMethodDescriptor.java"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "0a7a7e346efdc2b5fea65d4bc28e26cafd208312",
      "new_mode": 33188,
      "new_path": "ruby/src/main/java/com/google/protobuf/jruby/RubyServiceDescriptor.java"
    },
    {
      "type": "modify",
      "old_id": "00d60a1498ec921e08b6982420c2c742807dc2f9",
      "old_mode": 33188,
      "old_path": "ruby/src/main/java/google/ProtobufJavaService.java",
      "new_id": "c9b7c4e5220706f1695661ebc49344f16e5fcca0",
      "new_mode": 33188,
      "new_path": "ruby/src/main/java/google/ProtobufJavaService.java"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "dc131fea0a5a1c5cbbff8a565635ebec21f6028c",
      "new_mode": 33188,
      "new_path": "ruby/tests/service_test.proto"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "729b7995994acb6b5630269e262efeda67779491",
      "new_mode": 33188,
      "new_path": "ruby/tests/service_test.rb"
    },
    {
      "type": "modify",
      "old_id": "7ca02a88daa405ea640e0548c19db331b0fca57c",
      "old_mode": 33188,
      "old_path": "upb/reflection/def_pool.h",
      "new_id": "9a372876db6a3fd2e93608ac90be7674f8ccc128",
      "new_mode": 33188,
      "new_path": "upb/reflection/def_pool.h"
    },
    {
      "type": "modify",
      "old_id": "4abfb69e0f60bc70cdc673b196057d924706e1b4",
      "old_mode": 33188,
      "old_path": "upb/reflection/method_def.h",
      "new_id": "082c5091716d2c5bf94ad9f9dcb4ed3934044832",
      "new_mode": 33188,
      "new_path": "upb/reflection/method_def.h"
    },
    {
      "type": "modify",
      "old_id": "781932e176fc211a581ed75a14a3a8642c8aa621",
      "old_mode": 33188,
      "old_path": "upb/reflection/service_def.h",
      "new_id": "da3f32afde04cdfe76f682fe75d387e52a17ab73",
      "new_mode": 33188,
      "new_path": "upb/reflection/service_def.h"
    }
  ]
}
