googleapis / gax-ruby

Google API Extensions for Ruby
https://rubygems.org/gems/google-gax
BSD 3-Clause "New" or "Revised" License
20 stars 22 forks source link

Consider removing OperationsClient #181

Closed jbolinger closed 5 years ago

jbolinger commented 5 years ago

The operations client defined in lib/google/longrunning/operations_client.rb is a generated client that tends to get out of sync with the generator.

Consider if this client is really needed at all or if it could be replaced with a simpler hand-written class.

blowmage commented 5 years ago

googleapis/gapic-generator-ruby#129 is a PR that adds a generated Operations client to the service output. It is also added as part of the public API, so users can use it to safely call get_operation without potential naming conflicts. It basically replaces OperationsClient as defined in Gax.

@quartzmo and I discussed the pros and cons of this today, and he had a great rule of thumb being that anything that originates an API call should not be part of a shared/runtime dependency, due to the volatility of API stub implementations. Moving OperationsClient out of Gax is one way to ensure that it does not get out of sync.

Additional feedback on the PR is welcome.

quartzmo commented 5 years ago

After discussing with @blowmage, my take is that maintaining a hand-written client in Gax would require ensuring that changes to the generated clients and changes to the Gax client be synchronized, and that the Gax dependency in generated code be pinned to a specific version and kept in lockstep. The reason for this onerous requirement would be to ensure that any update to the behavior of generated client code would also be present in the Gax client code. So it seems that moving the OperationsClient to the generated code might save a lot of trouble.