ruby/proto/gitaly/errors_pb.rb in gitaly-15.11.0.pre.rc1 vs ruby/proto/gitaly/errors_pb.rb in gitaly-16.1.0.pre.rc1
- old
+ new
@@ -1,78 +1,38 @@
+# frozen_string_literal: true
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: errors.proto
-require 'google/protobuf/duration_pb'
require 'google/protobuf'
-Google::Protobuf::DescriptorPool.generated_pool.build do
- add_file("errors.proto", :syntax => :proto3) do
- add_message "gitaly.AccessCheckError" do
- optional :error_message, :string, 1
- optional :protocol, :string, 2
- optional :user_id, :string, 3
- optional :changes, :bytes, 4
+require 'google/protobuf/duration_pb'
+
+
+descriptor_data = "\n\x0c\x65rrors.proto\x12\x06gitaly\x1a\x1egoogle/protobuf/duration.proto\"]\n\x10\x41\x63\x63\x65ssCheckError\x12\x15\n\rerror_message\x18\x01 \x01(\t\x12\x10\n\x08protocol\x18\x02 \x01(\t\x12\x0f\n\x07user_id\x18\x03 \x01(\t\x12\x0f\n\x07\x63hanges\x18\x04 \x01(\x0c\"\xae\x02\n\nIndexError\x12\x0c\n\x04path\x18\x01 \x01(\x0c\x12\x30\n\nerror_type\x18\x02 \x01(\x0e\x32\x1c.gitaly.IndexError.ErrorType\"\xdf\x01\n\tErrorType\x12\x1a\n\x16\x45RROR_TYPE_UNSPECIFIED\x10\x00\x12\x19\n\x15\x45RROR_TYPE_EMPTY_PATH\x10\x01\x12\x1b\n\x17\x45RROR_TYPE_INVALID_PATH\x10\x02\x12\x1f\n\x1b\x45RROR_TYPE_DIRECTORY_EXISTS\x10\x03\x12\"\n\x1e\x45RROR_TYPE_DIRECTORY_TRAVERSAL\x10\x04\x12\x1a\n\x16\x45RROR_TYPE_FILE_EXISTS\x10\x05\x12\x1d\n\x19\x45RROR_TYPE_FILE_NOT_FOUND\x10\x06\"%\n\x15InvalidRefFormatError\x12\x0c\n\x04refs\x18\x02 \x03(\x0c\"C\n\x10NotAncestorError\x12\x17\n\x0fparent_revision\x18\x01 \x01(\x0c\x12\x16\n\x0e\x63hild_revision\x18\x02 \x01(\x0c\"\x1c\n\x1a\x43hangesAlreadyAppliedError\"O\n\x12MergeConflictError\x12\x19\n\x11\x63onflicting_files\x18\x01 \x03(\x0c\x12\x1e\n\x16\x63onflicting_commit_ids\x18\x02 \x03(\t\"%\n\x15ReferencesLockedError\x12\x0c\n\x04refs\x18\x01 \x03(\x0c\";\n\x14ReferenceExistsError\x12\x16\n\x0ereference_name\x18\x01 \x01(\x0c\x12\x0b\n\x03oid\x18\x02 \x01(\t\"0\n\x16ReferenceNotFoundError\x12\x16\n\x0ereference_name\x18\x01 \x01(\x0c\"P\n\x14ReferenceUpdateError\x12\x16\n\x0ereference_name\x18\x01 \x01(\x0c\x12\x0f\n\x07old_oid\x18\x02 \x01(\t\x12\x0f\n\x07new_oid\x18\x03 \x01(\t\"(\n\x14ResolveRevisionError\x12\x10\n\x08revision\x18\x01 \x01(\x0c\"S\n\nLimitError\x12\x15\n\rerror_message\x18\x01 \x01(\t\x12.\n\x0bretry_after\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\"\xd8\x01\n\x0f\x43ustomHookError\x12\x0e\n\x06stdout\x18\x01 \x01(\x0c\x12\x0e\n\x06stderr\x18\x02 \x01(\x0c\x12\x33\n\thook_type\x18\x03 \x01(\x0e\x32 .gitaly.CustomHookError.HookType\"p\n\x08HookType\x12\x19\n\x15HOOK_TYPE_UNSPECIFIED\x10\x00\x12\x18\n\x14HOOK_TYPE_PRERECEIVE\x10\x01\x12\x14\n\x10HOOK_TYPE_UPDATE\x10\x02\x12\x19\n\x15HOOK_TYPE_POSTRECEIVE\x10\x03\x42\x34Z2gitlab.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.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.IndexError" do
- optional :path, :bytes, 1
- optional :error_type, :enum, 2, "gitaly.IndexError.ErrorType"
- end
- add_enum "gitaly.IndexError.ErrorType" do
- value :ERROR_TYPE_UNSPECIFIED, 0
- value :ERROR_TYPE_EMPTY_PATH, 1
- value :ERROR_TYPE_INVALID_PATH, 2
- value :ERROR_TYPE_DIRECTORY_EXISTS, 3
- value :ERROR_TYPE_DIRECTORY_TRAVERSAL, 4
- value :ERROR_TYPE_FILE_EXISTS, 5
- value :ERROR_TYPE_FILE_NOT_FOUND, 6
- end
- add_message "gitaly.InvalidRefFormatError" do
- repeated :refs, :bytes, 2
- end
- add_message "gitaly.NotAncestorError" do
- optional :parent_revision, :bytes, 1
- optional :child_revision, :bytes, 2
- end
- add_message "gitaly.ChangesAlreadyAppliedError" do
- end
- add_message "gitaly.MergeConflictError" do
- repeated :conflicting_files, :bytes, 1
- repeated :conflicting_commit_ids, :string, 2
- end
- add_message "gitaly.ReferencesLockedError" do
- repeated :refs, :bytes, 1
- end
- add_message "gitaly.ReferenceExistsError" do
- optional :reference_name, :bytes, 1
- optional :oid, :string, 2
- end
- add_message "gitaly.ReferenceNotFoundError" do
- optional :reference_name, :bytes, 1
- end
- add_message "gitaly.ReferenceUpdateError" do
- optional :reference_name, :bytes, 1
- optional :old_oid, :string, 2
- optional :new_oid, :string, 3
- end
- add_message "gitaly.ResolveRevisionError" do
- optional :revision, :bytes, 1
- end
- add_message "gitaly.LimitError" do
- optional :error_message, :string, 1
- optional :retry_after, :message, 2, "google.protobuf.Duration"
- end
- add_message "gitaly.CustomHookError" do
- optional :stdout, :bytes, 1
- optional :stderr, :bytes, 2
- optional :hook_type, :enum, 3, "gitaly.CustomHookError.HookType"
- end
- add_enum "gitaly.CustomHookError.HookType" do
- value :HOOK_TYPE_UNSPECIFIED, 0
- value :HOOK_TYPE_PRERECEIVE, 1
- value :HOOK_TYPE_UPDATE, 2
- value :HOOK_TYPE_POSTRECEIVE, 3
- 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
AccessCheckError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gitaly.AccessCheckError").msgclass
IndexError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("gitaly.IndexError").msgclass