ruby/proto/gitaly/service_config_pb.rb in gitaly-15.11.0.pre.rc1 vs ruby/proto/gitaly/service_config_pb.rb in gitaly-16.1.0.pre.rc1
- old
+ new
@@ -1,47 +1,40 @@
+# frozen_string_literal: true
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: service_config.proto
+require 'google/protobuf'
+
require 'google/protobuf/duration_pb'
require 'google/protobuf/wrappers_pb'
-require 'google/protobuf'
-Google::Protobuf::DescriptorPool.generated_pool.build do
- add_file("service_config.proto", :syntax => :proto3) do
- add_message "gitaly.ServiceConfig" do
- repeated :load_balancing_config, :message, 1, "gitaly.LoadBalancingConfig"
- repeated :method_config, :message, 2, "gitaly.MethodConfig"
+
+descriptor_data = "\n\x14service_config.proto\x12\x06gitaly\x1a\x1egoogle/protobuf/duration.proto\x1a\x1egoogle/protobuf/wrappers.proto\"x\n\rServiceConfig\x12:\n\x15load_balancing_config\x18\x01 \x03(\x0b\x32\x1b.gitaly.LoadBalancingConfig\x12+\n\rmethod_config\x18\x02 \x03(\x0b\x32\x14.gitaly.MethodConfig\"\x98\x01\n\x13LoadBalancingConfig\x12\x39\n\npick_first\x18\x01 \x01(\x0b\x32\x17.gitaly.PickFirstConfigH\x00R\npick_first\x12<\n\x0bround_robin\x18\x02 \x01(\x0b\x32\x18.gitaly.RoundRobinConfigH\x00R\x0bround_robinB\x08\n\x06policy\"\x11\n\x0fPickFirstConfig\"\x12\n\x10RoundRobinConfig\"\xc1\x04\n\x0cMethodConfig\x12\'\n\x04name\x18\x01 \x03(\x0b\x32\x19.gitaly.MethodConfig.Name\x12\x32\n\x0ewait_for_ready\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.BoolValue\x12*\n\x07timeout\x18\x03 \x01(\x0b\x32\x19.google.protobuf.Duration\x12?\n\x19max_request_message_bytes\x18\x04 \x01(\x0b\x32\x1c.google.protobuf.UInt32Value\x12@\n\x1amax_response_message_bytes\x18\x05 \x01(\x0b\x32\x1c.google.protobuf.UInt32Value\x12\x36\n\x0cretry_policy\x18\x06 \x01(\x0b\x32 .gitaly.MethodConfig.RetryPolicy\x1a\'\n\x04Name\x12\x0f\n\x07service\x18\x01 \x01(\t\x12\x0e\n\x06method\x18\x02 \x01(\t\x1a\xc3\x01\n\x0bRetryPolicy\x12\x14\n\x0cmax_attempts\x18\x01 \x01(\r\x12\x32\n\x0finitial_backoff\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\x12.\n\x0bmax_backoff\x18\x03 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x1a\n\x12\x62\x61\x63koff_multiplier\x18\x04 \x01(\x02\x12\x1e\n\x16retryable_status_codes\x18\x05 \x03(\tB4Z2gitlab.com/gitlab-org/gitaly/v16/proto/go/gitalypbb\x06proto3"
+
+pool = Google::Protobuf::DescriptorPool.generated_pool
+
+begin
+ pool.add_serialized_file(descriptor_data)
+rescue TypeError => e
+ # Compatibility code: will be removed in the next major version.
+ require 'google/protobuf/descriptor_pb'
+ parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data)
+ parsed.clear_dependency
+ serialized = parsed.class.encode(parsed)
+ file = pool.add_serialized_file(serialized)
+ warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}"
+ imports = [
+ ["google.protobuf.BoolValue", "google/protobuf/wrappers.proto"],
+ ["google.protobuf.Duration", "google/protobuf/duration.proto"],
+ ]
+ imports.each do |type_name, expected_filename|
+ import_file = pool.lookup(type_name).file_descriptor
+ if import_file.name != expected_filename
+ warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}"
end
- add_message "gitaly.LoadBalancingConfig" do
- oneof :policy do
- optional :pick_first, :message, 1, "gitaly.PickFirstConfig", json_name: "pick_first"
- optional :round_robin, :message, 2, "gitaly.RoundRobinConfig", json_name: "round_robin"
- end
- end
- add_message "gitaly.PickFirstConfig" do
- end
- add_message "gitaly.RoundRobinConfig" do
- end
- add_message "gitaly.MethodConfig" do
- repeated :name, :message, 1, "gitaly.MethodConfig.Name"
- optional :wait_for_ready, :message, 2, "google.protobuf.BoolValue"
- optional :timeout, :message, 3, "google.protobuf.Duration"
- optional :max_request_message_bytes, :message, 4, "google.protobuf.UInt32Value"
- optional :max_response_message_bytes, :message, 5, "google.protobuf.UInt32Value"
- optional :retry_policy, :message, 6, "gitaly.MethodConfig.RetryPolicy"
- end
- add_message "gitaly.MethodConfig.Name" do
- optional :service, :string, 1
- optional :method, :string, 2
- end
- add_message "gitaly.MethodConfig.RetryPolicy" do
- optional :max_attempts, :uint32, 1
- optional :initial_backoff, :message, 2, "google.protobuf.Duration"
- optional :max_backoff, :message, 3, "google.protobuf.Duration"
- optional :backoff_multiplier, :float, 4
- repeated :retryable_status_codes, :string, 5
- end
end
+ warn "Each proto file must use a consistent fully-qualified name."
+ warn "This will become an error in the next major version."
end
module Gitaly
ServiceConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gitaly.ServiceConfig").msgclass
LoadBalancingConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gitaly.LoadBalancingConfig").msgclass