diff options
author | Francisco Javier López <fjlopez@gitlab.com> | 2021-05-20 19:10:13 +0300 |
---|---|---|
committer | Francisco Javier López <fjlopez@gitlab.com> | 2021-05-20 19:10:13 +0300 |
commit | 5b01e449330898e10f155fa2693a00cfd4ffe26d (patch) | |
tree | e1ec253eb6dd2349a7e46b9b94f24205913df578 | |
parent | c93530dd0922e7554d6d1e486e830f72980fe083 (diff) |
Initial commit
-rw-r--r-- | proto/go/gitalypb/wiki.pb.go | 145 | ||||
-rw-r--r-- | proto/wiki.proto | 7 | ||||
-rw-r--r-- | ruby/lib/gitaly_server/wiki_service.rb | 12 | ||||
-rw-r--r-- | ruby/lib/gitlab/git/wiki.rb | 31 | ||||
-rw-r--r-- | ruby/proto/gitaly/wiki_pb.rb | 2 |
5 files changed, 116 insertions, 81 deletions
diff --git a/proto/go/gitalypb/wiki.pb.go b/proto/go/gitalypb/wiki.pb.go index 036f46fcc..bd1faa95e 100644 --- a/proto/go/gitalypb/wiki.pb.go +++ b/proto/go/gitalypb/wiki.pb.go @@ -398,7 +398,8 @@ type WikiWritePageRequest struct { Name []byte `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Format string `protobuf:"bytes,3,opt,name=format,proto3" json:"format,omitempty"` CommitDetails *WikiCommitDetails `protobuf:"bytes,4,opt,name=commit_details,json=commitDetails,proto3" json:"commit_details,omitempty"` - // This field is present in all messages. + Ref []byte `protobuf:"bytes,6,opt,name=ref,proto3" json:"ref,omitempty"` + // These fields is present in all messages. Content []byte `protobuf:"bytes,5,opt,name=content,proto3" json:"content,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` @@ -458,6 +459,13 @@ func (m *WikiWritePageRequest) GetCommitDetails() *WikiCommitDetails { return nil } +func (m *WikiWritePageRequest) GetRef() []byte { + if m != nil { + return m.Ref + } + return nil +} + func (m *WikiWritePageRequest) GetContent() []byte { if m != nil { return m.Content @@ -511,7 +519,8 @@ type WikiUpdatePageRequest struct { Title []byte `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"` Format string `protobuf:"bytes,4,opt,name=format,proto3" json:"format,omitempty"` CommitDetails *WikiCommitDetails `protobuf:"bytes,5,opt,name=commit_details,json=commitDetails,proto3" json:"commit_details,omitempty"` - // This field is present in all messages + Ref []byte `protobuf:"bytes,7,opt,name=ref,proto3" json:"ref,omitempty"` + // These fields is present in all messages Content []byte `protobuf:"bytes,6,opt,name=content,proto3" json:"content,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` @@ -578,6 +587,13 @@ func (m *WikiUpdatePageRequest) GetCommitDetails() *WikiCommitDetails { return nil } +func (m *WikiUpdatePageRequest) GetRef() []byte { + if m != nil { + return m.Ref + } + return nil +} + func (m *WikiUpdatePageRequest) GetContent() []byte { if m != nil { return m.Content @@ -1064,71 +1080,72 @@ func init() { func init() { proto.RegisterFile("wiki.proto", fileDescriptor_5c56f90469cec0af) } var fileDescriptor_5c56f90469cec0af = []byte{ - // 1014 bytes of a gzipped FileDescriptorProto + // 1026 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x57, 0x4f, 0x6f, 0x1b, 0x45, - 0x14, 0x67, 0x1d, 0xff, 0x59, 0xbf, 0xc4, 0x6e, 0x3a, 0x94, 0x66, 0xeb, 0x84, 0x10, 0x6d, 0xa8, + 0x14, 0x67, 0x1d, 0xff, 0x59, 0xbf, 0xc4, 0x6e, 0x3a, 0x94, 0xc6, 0xdd, 0x84, 0x10, 0x6d, 0xa8, 0x30, 0x12, 0x38, 0x25, 0x3d, 0x00, 0x12, 0x48, 0x4d, 0xea, 0x10, 0x55, 0xaa, 0xa0, 0xda, 0x98, 0x46, 0x20, 0xa4, 0xd5, 0x64, 0x77, 0x6c, 0x8f, 0xba, 0xde, 0x59, 0x66, 0xc6, 0x89, 0x72, 0xe6, - 0x0c, 0x57, 0x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0xe7, 0xbb, 0x8c, 0x0f, 0xf6, 0xcc, 0xf9, 0x3d, 0xfd, 0x77, 0x60, 0x6f, 0xc0, - 0x52, 0x39, 0x39, 0x3b, 0xab, 0x6a, 0xd5, 0xc3, 0xbf, 0x02, 0x00, 0x00, 0xff, 0xff, 0x29, 0xb1, - 0x3b, 0xcf, 0x51, 0x0c, 0x00, 0x00, + 0x86, 0x04, 0x57, 0xb8, 0x21, 0xf1, 0x09, 0xf8, 0x14, 0x7c, 0x17, 0xb8, 0x70, 0xe7, 0x84, 0x66, + 0x66, 0x6d, 0xef, 0xae, 0xed, 0x40, 0x20, 0x42, 0xbd, 0xed, 0xfb, 0x33, 0x6f, 0xde, 0xef, 0xf7, + 0xfe, 0x8c, 0x0d, 0x70, 0x41, 0x5f, 0xd0, 0x4e, 0xc2, 0x99, 0x64, 0xa8, 0x3a, 0xa0, 0x12, 0x47, + 0x97, 0x0e, 0x44, 0x34, 0x96, 0x46, 0xe7, 0xac, 0x89, 0x21, 0xe6, 0x24, 0x34, 0x92, 0xfb, 0x9d, + 0x05, 0xb7, 0x4f, 0xe9, 0x0b, 0xfa, 0x98, 0x8d, 0x46, 0x54, 0x76, 0x89, 0xc4, 0x34, 0x12, 0x08, + 0x41, 0x39, 0xc6, 0x23, 0xd2, 0xb2, 0x76, 0xac, 0xf6, 0x9a, 0xa7, 0xbf, 0xd1, 0x1d, 0xa8, 0x90, + 0x11, 0xa6, 0x51, 0xab, 0xa4, 0x95, 0x46, 0x40, 0x2d, 0xa8, 0x8d, 0x88, 0x10, 0x78, 0x40, 0x5a, + 0x2b, 0x5a, 0x3f, 0x11, 0xd1, 0x06, 0xd4, 0xc6, 0x82, 0x70, 0x9f, 0x86, 0xad, 0xf2, 0x8e, 0xd5, + 0xae, 0x78, 0x55, 0x25, 0x3e, 0x09, 0xd1, 0x26, 0xd4, 0xb5, 0x41, 0xdf, 0x50, 0xd1, 0x87, 0x6c, + 0xa5, 0xf8, 0x14, 0x8f, 0x88, 0xd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b7, 0xc8, 0x45, 0xca, 0xa7, 0x5a, 0x7b, 0x19, 0x16, 0x8d, 0xe0, 0xfe, 0x62, + 0x19, 0xf2, 0xba, 0x24, 0x22, 0xff, 0x0b, 0x79, 0xf3, 0x74, 0xac, 0x5c, 0x8f, 0x0e, 0xb7, 0x65, + 0x20, 0x66, 0x33, 0x36, 0x10, 0xdd, 0x9f, 0x2c, 0x78, 0x55, 0x99, 0x3e, 0xa1, 0x71, 0x78, 0x33, + 0x50, 0xa6, 0xa5, 0x2e, 0x65, 0x4b, 0xed, 0x80, 0xcd, 0xc9, 0x39, 0xd5, 0x9b, 0xd7, 0xf4, 0xc0, + 0x54, 0x46, 0x5b, 0x50, 0x0f, 0x29, 0x27, 0x81, 0xbe, 0xaa, 0xac, 0x8d, 0x33, 0x85, 0xfb, 0x91, + 0x99, 0xec, 0x59, 0x82, 0x69, 0x71, 0xde, 0x4c, 0xb7, 0x8e, 0xc9, 0x6d, 0xbd, 0xb8, 0x23, 0xcc, + 0x1e, 0x72, 0xff, 0xb0, 0x0c, 0xf4, 0x63, 0x22, 0x0f, 0xa2, 0x48, 0x19, 0xc4, 0x8d, 0x40, 0x8c, + 0xa8, 0x7a, 0x94, 0x14, 0xc4, 0x86, 0x67, 0x04, 0x74, 0x1f, 0x9a, 0x26, 0x6b, 0xca, 0x62, 0x3f, + 0x24, 0x22, 0xd0, 0x40, 0x6d, 0xaf, 0x31, 0xd5, 0x76, 0x89, 0x08, 0xd0, 0x87, 0x50, 0x16, 0x8c, + 0x9b, 0x96, 0x6f, 0xee, 0xdf, 0xcf, 0xe6, 0x3d, 0x9f, 0x64, 0xe7, 0x84, 0x71, 0x79, 0x78, 0xe9, + 0xe9, 0x23, 0xee, 0x2e, 0x54, 0x8d, 0x8c, 0xea, 0x50, 0xe9, 0x3d, 0xe9, 0x3d, 0x3d, 0x5a, 0x7f, + 0x05, 0x35, 0x01, 0x1e, 0x7b, 0x47, 0x07, 0xbd, 0xa3, 0xae, 0x7f, 0xd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+ 0x36, 0xce, 0x11, 0xfc, 0x95, 0xf9, 0x19, 0x9b, 0x19, 0x40, 0xb4, 0x7d, 0xf5, 0x94, 0x3b, 0x6f, + 0x2c, 0xb5, 0x2f, 0x2b, 0xdf, 0xb4, 0xef, 0xf2, 0xe5, 0x2b, 0x36, 0x7c, 0xbe, 0x7c, 0x73, 0xcd, + 0x3a, 0x8b, 0x7b, 0xf8, 0xe0, 0x4b, 0xe5, 0x19, 0xe1, 0xb3, 0x4e, 0xc0, 0x46, 0x7b, 0xe6, 0xf3, + 0x5d, 0xc6, 0x07, 0x7b, 0xe6, 0xfc, 0x9e, 0xfe, 0xcb, 0xb0, 0x37, 0x60, 0xa9, 0x9c, 0x9c, 0x9d, + 0x55, 0xb5, 0xea, 0xe1, 0x5f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x1d, 0x6a, 0xa0, 0x46, 0x75, 0x0c, + 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/proto/wiki.proto b/proto/wiki.proto index 453920fc6..d8fed11f2 100644 --- a/proto/wiki.proto +++ b/proto/wiki.proto @@ -94,7 +94,9 @@ message WikiWritePageRequest { bytes name = 2; string format = 3; WikiCommitDetails commit_details = 4; - // This field is present in all messages. + bytes ref = 6; + + // These fields is present in all messages. bytes content = 5; } @@ -109,8 +111,9 @@ message WikiUpdatePageRequest { bytes title = 3; string format = 4; WikiCommitDetails commit_details = 5; + bytes ref = 7; - // This field is present in all messages + // These fields is present in all messages bytes content = 6; } diff --git a/ruby/lib/gitaly_server/wiki_service.rb b/ruby/lib/gitaly_server/wiki_service.rb index ebc2012cc..6b7d031a5 100644 --- a/ruby/lib/gitaly_server/wiki_service.rb +++ b/ruby/lib/gitaly_server/wiki_service.rb @@ -14,7 +14,7 @@ module GitalyServer end def wiki_write_page(call) - repo = name = format = commit_details = nil + repo = name = format = commit_details = ref = nil content = "" call.each_remote_read.with_index do |request, index| @@ -23,6 +23,9 @@ module GitalyServer name = set_utf8!(request.name) format = request.format commit_details = request.commit_details + ref = set_utf8!(request.ref) + puts "!!!!!!!!" + puts request.inspect end content << request.content @@ -31,7 +34,7 @@ module GitalyServer wiki = Gitlab::Git::Wiki.new(repo) commit_details = commit_details_from_gitaly(commit_details) - wiki.write_page(name, format.to_sym, content, commit_details) + wiki.write_page(name, format.to_sym, ref, content, commit_details) Gitaly::WikiWritePageResponse.new rescue Gitlab::Git::Wiki::DuplicatePageError => e @@ -129,7 +132,7 @@ module GitalyServer end def wiki_update_page(call) - repo = wiki = title = format = page_path = commit_details = nil + repo = wiki = title = format = page_path = commit_details = ref = nil content = "" call.each_remote_read.with_index do |request, index| @@ -139,6 +142,7 @@ module GitalyServer title = set_utf8!(request.title) page_path = set_utf8!(request.page_path) format = request.format + ref = set_utf8!(request.ref) commit_details = commit_details_from_gitaly(request.commit_details) end @@ -146,7 +150,7 @@ module GitalyServer content << request.content end - wiki.update_page(page_path, title, format.to_sym, content, commit_details) + wiki.update_page(page_path, title, format.to_sym, ref, content, commit_details) Gitaly::WikiUpdatePageResponse.new end diff --git a/ruby/lib/gitlab/git/wiki.rb b/ruby/lib/gitlab/git/wiki.rb index 445feb0a2..34aade06e 100644 --- a/ruby/lib/gitlab/git/wiki.rb +++ b/ruby/lib/gitlab/git/wiki.rb @@ -27,16 +27,19 @@ module Gitlab @repository.exists? end - def write_page(name, format, content, commit_details) - gollum_write_page(name, format, content, commit_details) + def write_page(name, format, ref, content, commit_details) + puts "###########" + puts ref + puts "##########" + gollum_write_page(name, format, ref, content, commit_details) end def delete_page(page_path, commit_details) gollum_delete_page(page_path, commit_details) end - def update_page(page_path, title, format, content, commit_details) - gollum_update_page(page_path, title, format, content, commit_details) + def update_page(page_path, title, format, ref, content, commit_details) + gollum_update_page(page_path, title, format, ref, content, commit_details) end def pages(limit: nil, sort: nil, direction_desc: false) @@ -63,8 +66,13 @@ module Gitlab page.url_path end - def gollum_wiki - @gollum_wiki ||= Gollum::Wiki.new(@repository.path) + def gollum_wiki(ref = nil) + options = {} + options[:ref] = ref if ref + puts "*************" + puts ref + puts "********" + @gollum_wiki ||= Gollum::Wiki.new(@repository.path, ref: 'main') end private @@ -123,7 +131,7 @@ module Gitlab gollum_wiki.paged(page_name, page_dir) || (raise PageNotFound, page_path) end - def gollum_write_page(name, format, content, commit_details) + def gollum_write_page(name, format, ref, content, commit_details) assert_type!(format, Symbol) assert_type!(commit_details, CommitDetails) @@ -131,7 +139,7 @@ module Gitlab filename = File.basename(name) dir = (tmp_dir = File.dirname(name)) == '.' ? '' : tmp_dir - gollum_wiki.write_page(filename, format, content, { committer: committer }, dir) + gollum_wiki(ref).write_page(filename, format, content, { committer: committer }, dir) end rescue Gollum::DuplicatePageError => e raise Gitlab::Git::Wiki::DuplicatePageError, e.message @@ -145,17 +153,18 @@ module Gitlab end end - def gollum_update_page(page_path, title, format, content, commit_details) + def gollum_update_page(page_path, title, format, ref, content, commit_details) assert_type!(format, Symbol) assert_type!(commit_details, CommitDetails) + gw = gollum_wiki(ref) with_committer_with_hooks(commit_details) do |committer| page = gollum_page_by_path(page_path) # Instead of performing two renames if the title has changed, # the update_page will only update the format and content and # the rename_page will do anything related to moving/renaming - gollum_wiki.update_page(page, page.name, format, content, committer: committer) - gollum_wiki.rename_page(page, title, committer: committer) + gw.update_page(page, page.name, format, content, committer: committer) + gw.rename_page(page, title, committer: committer) end end diff --git a/ruby/proto/gitaly/wiki_pb.rb b/ruby/proto/gitaly/wiki_pb.rb index fd0154fc4..2d3a923b2 100644 --- a/ruby/proto/gitaly/wiki_pb.rb +++ b/ruby/proto/gitaly/wiki_pb.rb @@ -42,6 +42,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do optional :name, :bytes, 2 optional :format, :string, 3 optional :commit_details, :message, 4, "gitaly.WikiCommitDetails" + optional :ref, :bytes, 6 optional :content, :bytes, 5 end add_message "gitaly.WikiWritePageResponse" do @@ -53,6 +54,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do optional :title, :bytes, 3 optional :format, :string, 4 optional :commit_details, :message, 5, "gitaly.WikiCommitDetails" + optional :ref, :bytes, 7 optional :content, :bytes, 6 end add_message "gitaly.WikiUpdatePageResponse" do |