diff --git a/api/gen/proto/go/vcs/v1/vcs.pb.go b/api/gen/proto/go/vcs/v1/vcs.pb.go index 194183d9a2..8755c82fc5 100644 --- a/api/gen/proto/go/vcs/v1/vcs.pb.go +++ b/api/gen/proto/go/vcs/v1/vcs.pb.go @@ -605,6 +605,193 @@ func (x *CommitAuthor) GetAvatarURL() string { return "" } +type CommitInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // the commit message + Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` + // the commit author login + Author *CommitAuthor `protobuf:"bytes,2,opt,name=author,proto3" json:"author,omitempty"` + // the commit date + Date string `protobuf:"bytes,3,opt,name=date,proto3" json:"date,omitempty"` + // the commit sha + Sha string `protobuf:"bytes,4,opt,name=sha,proto3" json:"sha,omitempty"` + // the full URL to the commit + URL string `protobuf:"bytes,5,opt,name=URL,proto3" json:"URL,omitempty"` +} + +func (x *CommitInfo) Reset() { + *x = CommitInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_vcs_v1_vcs_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CommitInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CommitInfo) ProtoMessage() {} + +func (x *CommitInfo) ProtoReflect() protoreflect.Message { + mi := &file_vcs_v1_vcs_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CommitInfo.ProtoReflect.Descriptor instead. +func (*CommitInfo) Descriptor() ([]byte, []int) { + return file_vcs_v1_vcs_proto_rawDescGZIP(), []int{11} +} + +func (x *CommitInfo) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +func (x *CommitInfo) GetAuthor() *CommitAuthor { + if x != nil { + return x.Author + } + return nil +} + +func (x *CommitInfo) GetDate() string { + if x != nil { + return x.Date + } + return "" +} + +func (x *CommitInfo) GetSha() string { + if x != nil { + return x.Sha + } + return "" +} + +func (x *CommitInfo) GetURL() string { + if x != nil { + return x.URL + } + return "" +} + +// New messages for the GetCommits method +type GetCommitsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RepositoryUrl string `protobuf:"bytes,1,opt,name=repository_url,json=repositoryUrl,proto3" json:"repository_url,omitempty"` + Refs []string `protobuf:"bytes,2,rep,name=refs,proto3" json:"refs,omitempty"` +} + +func (x *GetCommitsRequest) Reset() { + *x = GetCommitsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_vcs_v1_vcs_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetCommitsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetCommitsRequest) ProtoMessage() {} + +func (x *GetCommitsRequest) ProtoReflect() protoreflect.Message { + mi := &file_vcs_v1_vcs_proto_msgTypes[12] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetCommitsRequest.ProtoReflect.Descriptor instead. +func (*GetCommitsRequest) Descriptor() ([]byte, []int) { + return file_vcs_v1_vcs_proto_rawDescGZIP(), []int{12} +} + +func (x *GetCommitsRequest) GetRepositoryUrl() string { + if x != nil { + return x.RepositoryUrl + } + return "" +} + +func (x *GetCommitsRequest) GetRefs() []string { + if x != nil { + return x.Refs + } + return nil +} + +type GetCommitsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Commits []*CommitInfo `protobuf:"bytes,1,rep,name=commits,proto3" json:"commits,omitempty"` +} + +func (x *GetCommitsResponse) Reset() { + *x = GetCommitsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_vcs_v1_vcs_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetCommitsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetCommitsResponse) ProtoMessage() {} + +func (x *GetCommitsResponse) ProtoReflect() protoreflect.Message { + mi := &file_vcs_v1_vcs_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetCommitsResponse.ProtoReflect.Descriptor instead. +func (*GetCommitsResponse) Descriptor() ([]byte, []int) { + return file_vcs_v1_vcs_proto_rawDescGZIP(), []int{13} +} + +func (x *GetCommitsResponse) GetCommits() []*CommitInfo { + if x != nil { + return x.Commits + } + return nil +} + var File_vcs_v1_vcs_proto protoreflect.FileDescriptor var file_vcs_v1_vcs_proto_rawDesc = []byte{ @@ -654,39 +841,62 @@ var file_vcs_v1_vcs_proto_rawDesc = []byte{ 0x74, 0x68, 0x6f, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x55, 0x52, 0x4c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, - 0x76, 0x61, 0x74, 0x61, 0x72, 0x55, 0x52, 0x4c, 0x32, 0xec, 0x02, 0x0a, 0x0a, 0x56, 0x43, 0x53, - 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x42, 0x0a, 0x09, 0x47, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x41, 0x70, 0x70, 0x12, 0x18, 0x2e, 0x76, 0x63, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x41, 0x70, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, - 0x2e, 0x76, 0x63, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x69, 0x74, 0x68, 0x75, 0x62, 0x41, 0x70, - 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x48, 0x0a, 0x0b, 0x47, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x1a, 0x2e, 0x76, 0x63, 0x73, - 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x69, 0x74, 0x68, 0x75, 0x62, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x76, 0x63, 0x73, 0x2e, 0x76, 0x31, 0x2e, - 0x47, 0x69, 0x74, 0x68, 0x75, 0x62, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4e, 0x0a, 0x0d, 0x47, 0x69, 0x74, 0x68, 0x75, 0x62, 0x52, - 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x12, 0x1c, 0x2e, 0x76, 0x63, 0x73, 0x2e, 0x76, 0x31, 0x2e, - 0x47, 0x69, 0x74, 0x68, 0x75, 0x62, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x76, 0x63, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x3c, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x46, 0x69, 0x6c, 0x65, - 0x12, 0x16, 0x2e, 0x76, 0x63, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x46, 0x69, 0x6c, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x76, 0x63, 0x73, 0x2e, 0x76, - 0x31, 0x2e, 0x47, 0x65, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x00, 0x12, 0x42, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, - 0x12, 0x18, 0x2e, 0x76, 0x63, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, - 0x6d, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x76, 0x63, 0x73, - 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x8b, 0x01, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, - 0x76, 0x63, 0x73, 0x2e, 0x76, 0x31, 0x42, 0x08, 0x56, 0x63, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, - 0x50, 0x01, 0x5a, 0x3a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, - 0x72, 0x61, 0x66, 0x61, 0x6e, 0x61, 0x2f, 0x70, 0x79, 0x72, 0x6f, 0x73, 0x63, 0x6f, 0x70, 0x65, - 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, - 0x6f, 0x2f, 0x76, 0x63, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x76, 0x63, 0x73, 0x76, 0x31, 0xa2, 0x02, - 0x03, 0x56, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x56, 0x63, 0x73, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x06, - 0x56, 0x63, 0x73, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x12, 0x56, 0x63, 0x73, 0x5c, 0x56, 0x31, 0x5c, - 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x07, 0x56, 0x63, - 0x73, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x76, 0x61, 0x74, 0x61, 0x72, 0x55, 0x52, 0x4c, 0x22, 0x8c, 0x01, 0x0a, 0x0a, 0x43, 0x6f, 0x6d, + 0x6d, 0x69, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x12, 0x2c, 0x0a, 0x06, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x14, 0x2e, 0x76, 0x63, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, + 0x74, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x52, 0x06, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x12, + 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, + 0x61, 0x74, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x68, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x73, 0x68, 0x61, 0x12, 0x10, 0x0a, 0x03, 0x55, 0x52, 0x4c, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x55, 0x52, 0x4c, 0x22, 0x4e, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x43, 0x6f, + 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x25, 0x0a, 0x0e, + 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, + 0x55, 0x72, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x65, 0x66, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x04, 0x72, 0x65, 0x66, 0x73, 0x22, 0x42, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x43, 0x6f, + 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2c, 0x0a, + 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, + 0x2e, 0x76, 0x63, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x49, 0x6e, + 0x66, 0x6f, 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x32, 0xb3, 0x03, 0x0a, 0x0a, + 0x56, 0x43, 0x53, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x42, 0x0a, 0x09, 0x47, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x41, 0x70, 0x70, 0x12, 0x18, 0x2e, 0x76, 0x63, 0x73, 0x2e, 0x76, 0x31, + 0x2e, 0x47, 0x69, 0x74, 0x68, 0x75, 0x62, 0x41, 0x70, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x19, 0x2e, 0x76, 0x63, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x41, 0x70, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x48, + 0x0a, 0x0b, 0x47, 0x69, 0x74, 0x68, 0x75, 0x62, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x1a, 0x2e, + 0x76, 0x63, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x69, 0x74, 0x68, 0x75, 0x62, 0x4c, 0x6f, 0x67, + 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x76, 0x63, 0x73, 0x2e, + 0x76, 0x31, 0x2e, 0x47, 0x69, 0x74, 0x68, 0x75, 0x62, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4e, 0x0a, 0x0d, 0x47, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x12, 0x1c, 0x2e, 0x76, 0x63, 0x73, 0x2e, + 0x76, 0x31, 0x2e, 0x47, 0x69, 0x74, 0x68, 0x75, 0x62, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x76, 0x63, 0x73, 0x2e, 0x76, 0x31, + 0x2e, 0x47, 0x69, 0x74, 0x68, 0x75, 0x62, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x3c, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x46, + 0x69, 0x6c, 0x65, 0x12, 0x16, 0x2e, 0x76, 0x63, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, + 0x46, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x76, 0x63, + 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x46, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x42, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, + 0x6d, 0x69, 0x74, 0x12, 0x18, 0x2e, 0x76, 0x63, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, + 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, + 0x76, 0x63, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x45, 0x0a, 0x0a, 0x47, 0x65, + 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x12, 0x19, 0x2e, 0x76, 0x63, 0x73, 0x2e, 0x76, + 0x31, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x76, 0x63, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, + 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x00, 0x42, 0x8b, 0x01, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x63, 0x73, 0x2e, 0x76, 0x31, + 0x42, 0x08, 0x56, 0x63, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3a, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x72, 0x61, 0x66, 0x61, 0x6e, 0x61, + 0x2f, 0x70, 0x79, 0x72, 0x6f, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x67, + 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x2f, 0x76, 0x63, 0x73, 0x2f, + 0x76, 0x31, 0x3b, 0x76, 0x63, 0x73, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x56, 0x58, 0x58, 0xaa, 0x02, + 0x06, 0x56, 0x63, 0x73, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x06, 0x56, 0x63, 0x73, 0x5c, 0x56, 0x31, + 0xe2, 0x02, 0x12, 0x56, 0x63, 0x73, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x07, 0x56, 0x63, 0x73, 0x3a, 0x3a, 0x56, 0x31, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -701,7 +911,7 @@ func file_vcs_v1_vcs_proto_rawDescGZIP() []byte { return file_vcs_v1_vcs_proto_rawDescData } -var file_vcs_v1_vcs_proto_msgTypes = make([]protoimpl.MessageInfo, 11) +var file_vcs_v1_vcs_proto_msgTypes = make([]protoimpl.MessageInfo, 14) var file_vcs_v1_vcs_proto_goTypes = []any{ (*GithubAppRequest)(nil), // 0: vcs.v1.GithubAppRequest (*GithubAppResponse)(nil), // 1: vcs.v1.GithubAppResponse @@ -714,24 +924,31 @@ var file_vcs_v1_vcs_proto_goTypes = []any{ (*GetCommitRequest)(nil), // 8: vcs.v1.GetCommitRequest (*GetCommitResponse)(nil), // 9: vcs.v1.GetCommitResponse (*CommitAuthor)(nil), // 10: vcs.v1.CommitAuthor + (*CommitInfo)(nil), // 11: vcs.v1.CommitInfo + (*GetCommitsRequest)(nil), // 12: vcs.v1.GetCommitsRequest + (*GetCommitsResponse)(nil), // 13: vcs.v1.GetCommitsResponse } var file_vcs_v1_vcs_proto_depIdxs = []int32{ 10, // 0: vcs.v1.GetCommitResponse.author:type_name -> vcs.v1.CommitAuthor - 0, // 1: vcs.v1.VCSService.GithubApp:input_type -> vcs.v1.GithubAppRequest - 2, // 2: vcs.v1.VCSService.GithubLogin:input_type -> vcs.v1.GithubLoginRequest - 4, // 3: vcs.v1.VCSService.GithubRefresh:input_type -> vcs.v1.GithubRefreshRequest - 6, // 4: vcs.v1.VCSService.GetFile:input_type -> vcs.v1.GetFileRequest - 8, // 5: vcs.v1.VCSService.GetCommit:input_type -> vcs.v1.GetCommitRequest - 1, // 6: vcs.v1.VCSService.GithubApp:output_type -> vcs.v1.GithubAppResponse - 3, // 7: vcs.v1.VCSService.GithubLogin:output_type -> vcs.v1.GithubLoginResponse - 5, // 8: vcs.v1.VCSService.GithubRefresh:output_type -> vcs.v1.GithubRefreshResponse - 7, // 9: vcs.v1.VCSService.GetFile:output_type -> vcs.v1.GetFileResponse - 9, // 10: vcs.v1.VCSService.GetCommit:output_type -> vcs.v1.GetCommitResponse - 6, // [6:11] is the sub-list for method output_type - 1, // [1:6] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name + 10, // 1: vcs.v1.CommitInfo.author:type_name -> vcs.v1.CommitAuthor + 11, // 2: vcs.v1.GetCommitsResponse.commits:type_name -> vcs.v1.CommitInfo + 0, // 3: vcs.v1.VCSService.GithubApp:input_type -> vcs.v1.GithubAppRequest + 2, // 4: vcs.v1.VCSService.GithubLogin:input_type -> vcs.v1.GithubLoginRequest + 4, // 5: vcs.v1.VCSService.GithubRefresh:input_type -> vcs.v1.GithubRefreshRequest + 6, // 6: vcs.v1.VCSService.GetFile:input_type -> vcs.v1.GetFileRequest + 8, // 7: vcs.v1.VCSService.GetCommit:input_type -> vcs.v1.GetCommitRequest + 12, // 8: vcs.v1.VCSService.GetCommits:input_type -> vcs.v1.GetCommitsRequest + 1, // 9: vcs.v1.VCSService.GithubApp:output_type -> vcs.v1.GithubAppResponse + 3, // 10: vcs.v1.VCSService.GithubLogin:output_type -> vcs.v1.GithubLoginResponse + 5, // 11: vcs.v1.VCSService.GithubRefresh:output_type -> vcs.v1.GithubRefreshResponse + 7, // 12: vcs.v1.VCSService.GetFile:output_type -> vcs.v1.GetFileResponse + 9, // 13: vcs.v1.VCSService.GetCommit:output_type -> vcs.v1.GetCommitResponse + 13, // 14: vcs.v1.VCSService.GetCommits:output_type -> vcs.v1.GetCommitsResponse + 9, // [9:15] is the sub-list for method output_type + 3, // [3:9] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name } func init() { file_vcs_v1_vcs_proto_init() } @@ -872,6 +1089,42 @@ func file_vcs_v1_vcs_proto_init() { return nil } } + file_vcs_v1_vcs_proto_msgTypes[11].Exporter = func(v any, i int) any { + switch v := v.(*CommitInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_vcs_v1_vcs_proto_msgTypes[12].Exporter = func(v any, i int) any { + switch v := v.(*GetCommitsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_vcs_v1_vcs_proto_msgTypes[13].Exporter = func(v any, i int) any { + switch v := v.(*GetCommitsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ @@ -879,7 +1132,7 @@ func file_vcs_v1_vcs_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_vcs_v1_vcs_proto_rawDesc, NumEnums: 0, - NumMessages: 11, + NumMessages: 14, NumExtensions: 0, NumServices: 1, }, diff --git a/api/gen/proto/go/vcs/v1/vcs_vtproto.pb.go b/api/gen/proto/go/vcs/v1/vcs_vtproto.pb.go index 2fdca50621..c532b2c4ad 100644 --- a/api/gen/proto/go/vcs/v1/vcs_vtproto.pb.go +++ b/api/gen/proto/go/vcs/v1/vcs_vtproto.pb.go @@ -217,6 +217,72 @@ func (m *CommitAuthor) CloneMessageVT() proto.Message { return m.CloneVT() } +func (m *CommitInfo) CloneVT() *CommitInfo { + if m == nil { + return (*CommitInfo)(nil) + } + r := new(CommitInfo) + r.Message = m.Message + r.Author = m.Author.CloneVT() + r.Date = m.Date + r.Sha = m.Sha + r.URL = m.URL + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *CommitInfo) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *GetCommitsRequest) CloneVT() *GetCommitsRequest { + if m == nil { + return (*GetCommitsRequest)(nil) + } + r := new(GetCommitsRequest) + r.RepositoryUrl = m.RepositoryUrl + if rhs := m.Refs; rhs != nil { + tmpContainer := make([]string, len(rhs)) + copy(tmpContainer, rhs) + r.Refs = tmpContainer + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *GetCommitsRequest) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *GetCommitsResponse) CloneVT() *GetCommitsResponse { + if m == nil { + return (*GetCommitsResponse)(nil) + } + r := new(GetCommitsResponse) + if rhs := m.Commits; rhs != nil { + tmpContainer := make([]*CommitInfo, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.Commits = tmpContainer + } + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *GetCommitsResponse) CloneMessageVT() proto.Message { + return m.CloneVT() +} + func (this *GithubAppRequest) EqualVT(that *GithubAppRequest) bool { if this == that { return true @@ -447,6 +513,98 @@ func (this *CommitAuthor) EqualMessageVT(thatMsg proto.Message) bool { } return this.EqualVT(that) } +func (this *CommitInfo) EqualVT(that *CommitInfo) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.Message != that.Message { + return false + } + if !this.Author.EqualVT(that.Author) { + return false + } + if this.Date != that.Date { + return false + } + if this.Sha != that.Sha { + return false + } + if this.URL != that.URL { + return false + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *CommitInfo) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*CommitInfo) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *GetCommitsRequest) EqualVT(that *GetCommitsRequest) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if this.RepositoryUrl != that.RepositoryUrl { + return false + } + if len(this.Refs) != len(that.Refs) { + return false + } + for i, vx := range this.Refs { + vy := that.Refs[i] + if vx != vy { + return false + } + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *GetCommitsRequest) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*GetCommitsRequest) + if !ok { + return false + } + return this.EqualVT(that) +} +func (this *GetCommitsResponse) EqualVT(that *GetCommitsResponse) bool { + if this == that { + return true + } else if this == nil || that == nil { + return false + } + if len(this.Commits) != len(that.Commits) { + return false + } + for i, vx := range this.Commits { + vy := that.Commits[i] + if p, q := vx, vy; p != q { + if p == nil { + p = &CommitInfo{} + } + if q == nil { + q = &CommitInfo{} + } + if !p.EqualVT(q) { + return false + } + } + } + return string(this.unknownFields) == string(that.unknownFields) +} + +func (this *GetCommitsResponse) EqualMessageVT(thatMsg proto.Message) bool { + that, ok := thatMsg.(*GetCommitsResponse) + if !ok { + return false + } + return this.EqualVT(that) +} // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. @@ -462,6 +620,7 @@ type VCSServiceClient interface { GithubRefresh(ctx context.Context, in *GithubRefreshRequest, opts ...grpc.CallOption) (*GithubRefreshResponse, error) GetFile(ctx context.Context, in *GetFileRequest, opts ...grpc.CallOption) (*GetFileResponse, error) GetCommit(ctx context.Context, in *GetCommitRequest, opts ...grpc.CallOption) (*GetCommitResponse, error) + GetCommits(ctx context.Context, in *GetCommitsRequest, opts ...grpc.CallOption) (*GetCommitsResponse, error) } type vCSServiceClient struct { @@ -517,6 +676,15 @@ func (c *vCSServiceClient) GetCommit(ctx context.Context, in *GetCommitRequest, return out, nil } +func (c *vCSServiceClient) GetCommits(ctx context.Context, in *GetCommitsRequest, opts ...grpc.CallOption) (*GetCommitsResponse, error) { + out := new(GetCommitsResponse) + err := c.cc.Invoke(ctx, "/vcs.v1.VCSService/GetCommits", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // VCSServiceServer is the server API for VCSService service. // All implementations must embed UnimplementedVCSServiceServer // for forward compatibility @@ -526,6 +694,7 @@ type VCSServiceServer interface { GithubRefresh(context.Context, *GithubRefreshRequest) (*GithubRefreshResponse, error) GetFile(context.Context, *GetFileRequest) (*GetFileResponse, error) GetCommit(context.Context, *GetCommitRequest) (*GetCommitResponse, error) + GetCommits(context.Context, *GetCommitsRequest) (*GetCommitsResponse, error) mustEmbedUnimplementedVCSServiceServer() } @@ -548,6 +717,9 @@ func (UnimplementedVCSServiceServer) GetFile(context.Context, *GetFileRequest) ( func (UnimplementedVCSServiceServer) GetCommit(context.Context, *GetCommitRequest) (*GetCommitResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetCommit not implemented") } +func (UnimplementedVCSServiceServer) GetCommits(context.Context, *GetCommitsRequest) (*GetCommitsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetCommits not implemented") +} func (UnimplementedVCSServiceServer) mustEmbedUnimplementedVCSServiceServer() {} // UnsafeVCSServiceServer may be embedded to opt out of forward compatibility for this service. @@ -651,6 +823,24 @@ func _VCSService_GetCommit_Handler(srv interface{}, ctx context.Context, dec fun return interceptor(ctx, in, info, handler) } +func _VCSService_GetCommits_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetCommitsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(VCSServiceServer).GetCommits(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/vcs.v1.VCSService/GetCommits", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(VCSServiceServer).GetCommits(ctx, req.(*GetCommitsRequest)) + } + return interceptor(ctx, in, info, handler) +} + // VCSService_ServiceDesc is the grpc.ServiceDesc for VCSService service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -678,6 +868,10 @@ var VCSService_ServiceDesc = grpc.ServiceDesc{ MethodName: "GetCommit", Handler: _VCSService_GetCommit_Handler, }, + { + MethodName: "GetCommits", + Handler: _VCSService_GetCommits_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "vcs/v1/vcs.proto", @@ -1175,66 +1369,231 @@ func (m *CommitAuthor) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *GithubAppRequest) SizeVT() (n int) { +func (m *CommitInfo) MarshalVT() (dAtA []byte, err error) { if m == nil { - return 0 + return nil, nil } - var l int - _ = l - n += len(m.unknownFields) - return n + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil } -func (m *GithubAppResponse) SizeVT() (n int) { +func (m *CommitInfo) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *CommitInfo) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { - return 0 + return 0, nil } + i := len(dAtA) + _ = i var l int _ = l - l = len(m.ClientID) - if l > 0 { - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) } - n += len(m.unknownFields) - return n + if len(m.URL) > 0 { + i -= len(m.URL) + copy(dAtA[i:], m.URL) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.URL))) + i-- + dAtA[i] = 0x2a + } + if len(m.Sha) > 0 { + i -= len(m.Sha) + copy(dAtA[i:], m.Sha) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Sha))) + i-- + dAtA[i] = 0x22 + } + if len(m.Date) > 0 { + i -= len(m.Date) + copy(dAtA[i:], m.Date) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Date))) + i-- + dAtA[i] = 0x1a + } + if m.Author != nil { + size, err := m.Author.MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } + if len(m.Message) > 0 { + i -= len(m.Message) + copy(dAtA[i:], m.Message) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Message))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } -func (m *GithubLoginRequest) SizeVT() (n int) { +func (m *GetCommitsRequest) MarshalVT() (dAtA []byte, err error) { if m == nil { - return 0 + return nil, nil } - var l int - _ = l - l = len(m.AuthorizationCode) - if l > 0 { - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err } - n += len(m.unknownFields) - return n + return dAtA[:n], nil } -func (m *GithubLoginResponse) SizeVT() (n int) { +func (m *GetCommitsRequest) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *GetCommitsRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { - return 0 + return 0, nil } + i := len(dAtA) + _ = i var l int _ = l - l = len(m.Cookie) - if l > 0 { - n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) } - n += len(m.unknownFields) - return n + if len(m.Refs) > 0 { + for iNdEx := len(m.Refs) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Refs[iNdEx]) + copy(dAtA[i:], m.Refs[iNdEx]) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.Refs[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if len(m.RepositoryUrl) > 0 { + i -= len(m.RepositoryUrl) + copy(dAtA[i:], m.RepositoryUrl) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(m.RepositoryUrl))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } -func (m *GithubRefreshRequest) SizeVT() (n int) { +func (m *GetCommitsResponse) MarshalVT() (dAtA []byte, err error) { if m == nil { - return 0 + return nil, nil } - var l int - _ = l - n += len(m.unknownFields) - return n + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GetCommitsResponse) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *GetCommitsResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Commits) > 0 { + for iNdEx := len(m.Commits) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Commits[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *GithubAppRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += len(m.unknownFields) + return n +} + +func (m *GithubAppResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ClientID) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *GithubLoginRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.AuthorizationCode) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *GithubLoginResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Cookie) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *GithubRefreshRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += len(m.unknownFields) + return n } func (m *GithubRefreshResponse) SizeVT() (n int) { @@ -1357,6 +1716,72 @@ func (m *CommitAuthor) SizeVT() (n int) { return n } +func (m *CommitInfo) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Message) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.Author != nil { + l = m.Author.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.Date) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.Sha) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + l = len(m.URL) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *GetCommitsRequest) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.RepositoryUrl) + if l > 0 { + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if len(m.Refs) > 0 { + for _, s := range m.Refs { + l = len(s) + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + n += len(m.unknownFields) + return n +} + +func (m *GetCommitsResponse) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Commits) > 0 { + for _, e := range m.Commits { + l = e.SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } + n += len(m.unknownFields) + return n +} + func (m *GithubAppRequest) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -2498,3 +2923,418 @@ func (m *CommitAuthor) UnmarshalVT(dAtA []byte) error { } return nil } +func (m *CommitInfo) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CommitInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CommitInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Message = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Author", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Author == nil { + m.Author = &CommitAuthor{} + } + if err := m.Author.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Date", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Date = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sha", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Sha = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field URL", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.URL = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetCommitsRequest) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GetCommitsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetCommitsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RepositoryUrl", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RepositoryUrl = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Refs", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Refs = append(m.Refs, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetCommitsResponse) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GetCommitsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetCommitsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Commits", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protohelpers.ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protohelpers.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protohelpers.ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Commits = append(m.Commits, &CommitInfo{}) + if err := m.Commits[len(m.Commits)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := protohelpers.Skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protohelpers.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} diff --git a/api/gen/proto/go/vcs/v1/vcsv1connect/vcs.connect.go b/api/gen/proto/go/vcs/v1/vcsv1connect/vcs.connect.go index 1176a6bb5b..32425fb8bc 100644 --- a/api/gen/proto/go/vcs/v1/vcsv1connect/vcs.connect.go +++ b/api/gen/proto/go/vcs/v1/vcsv1connect/vcs.connect.go @@ -44,6 +44,8 @@ const ( VCSServiceGetFileProcedure = "/vcs.v1.VCSService/GetFile" // VCSServiceGetCommitProcedure is the fully-qualified name of the VCSService's GetCommit RPC. VCSServiceGetCommitProcedure = "/vcs.v1.VCSService/GetCommit" + // VCSServiceGetCommitsProcedure is the fully-qualified name of the VCSService's GetCommits RPC. + VCSServiceGetCommitsProcedure = "/vcs.v1.VCSService/GetCommits" ) // These variables are the protoreflect.Descriptor objects for the RPCs defined in this package. @@ -54,6 +56,7 @@ var ( vCSServiceGithubRefreshMethodDescriptor = vCSServiceServiceDescriptor.Methods().ByName("GithubRefresh") vCSServiceGetFileMethodDescriptor = vCSServiceServiceDescriptor.Methods().ByName("GetFile") vCSServiceGetCommitMethodDescriptor = vCSServiceServiceDescriptor.Methods().ByName("GetCommit") + vCSServiceGetCommitsMethodDescriptor = vCSServiceServiceDescriptor.Methods().ByName("GetCommits") ) // VCSServiceClient is a client for the vcs.v1.VCSService service. @@ -63,6 +66,7 @@ type VCSServiceClient interface { GithubRefresh(context.Context, *connect.Request[v1.GithubRefreshRequest]) (*connect.Response[v1.GithubRefreshResponse], error) GetFile(context.Context, *connect.Request[v1.GetFileRequest]) (*connect.Response[v1.GetFileResponse], error) GetCommit(context.Context, *connect.Request[v1.GetCommitRequest]) (*connect.Response[v1.GetCommitResponse], error) + GetCommits(context.Context, *connect.Request[v1.GetCommitsRequest]) (*connect.Response[v1.GetCommitsResponse], error) } // NewVCSServiceClient constructs a client for the vcs.v1.VCSService service. By default, it uses @@ -105,6 +109,12 @@ func NewVCSServiceClient(httpClient connect.HTTPClient, baseURL string, opts ... connect.WithSchema(vCSServiceGetCommitMethodDescriptor), connect.WithClientOptions(opts...), ), + getCommits: connect.NewClient[v1.GetCommitsRequest, v1.GetCommitsResponse]( + httpClient, + baseURL+VCSServiceGetCommitsProcedure, + connect.WithSchema(vCSServiceGetCommitsMethodDescriptor), + connect.WithClientOptions(opts...), + ), } } @@ -115,6 +125,7 @@ type vCSServiceClient struct { githubRefresh *connect.Client[v1.GithubRefreshRequest, v1.GithubRefreshResponse] getFile *connect.Client[v1.GetFileRequest, v1.GetFileResponse] getCommit *connect.Client[v1.GetCommitRequest, v1.GetCommitResponse] + getCommits *connect.Client[v1.GetCommitsRequest, v1.GetCommitsResponse] } // GithubApp calls vcs.v1.VCSService.GithubApp. @@ -142,6 +153,11 @@ func (c *vCSServiceClient) GetCommit(ctx context.Context, req *connect.Request[v return c.getCommit.CallUnary(ctx, req) } +// GetCommits calls vcs.v1.VCSService.GetCommits. +func (c *vCSServiceClient) GetCommits(ctx context.Context, req *connect.Request[v1.GetCommitsRequest]) (*connect.Response[v1.GetCommitsResponse], error) { + return c.getCommits.CallUnary(ctx, req) +} + // VCSServiceHandler is an implementation of the vcs.v1.VCSService service. type VCSServiceHandler interface { GithubApp(context.Context, *connect.Request[v1.GithubAppRequest]) (*connect.Response[v1.GithubAppResponse], error) @@ -149,6 +165,7 @@ type VCSServiceHandler interface { GithubRefresh(context.Context, *connect.Request[v1.GithubRefreshRequest]) (*connect.Response[v1.GithubRefreshResponse], error) GetFile(context.Context, *connect.Request[v1.GetFileRequest]) (*connect.Response[v1.GetFileResponse], error) GetCommit(context.Context, *connect.Request[v1.GetCommitRequest]) (*connect.Response[v1.GetCommitResponse], error) + GetCommits(context.Context, *connect.Request[v1.GetCommitsRequest]) (*connect.Response[v1.GetCommitsResponse], error) } // NewVCSServiceHandler builds an HTTP handler from the service implementation. It returns the path @@ -187,6 +204,12 @@ func NewVCSServiceHandler(svc VCSServiceHandler, opts ...connect.HandlerOption) connect.WithSchema(vCSServiceGetCommitMethodDescriptor), connect.WithHandlerOptions(opts...), ) + vCSServiceGetCommitsHandler := connect.NewUnaryHandler( + VCSServiceGetCommitsProcedure, + svc.GetCommits, + connect.WithSchema(vCSServiceGetCommitsMethodDescriptor), + connect.WithHandlerOptions(opts...), + ) return "/vcs.v1.VCSService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { switch r.URL.Path { case VCSServiceGithubAppProcedure: @@ -199,6 +222,8 @@ func NewVCSServiceHandler(svc VCSServiceHandler, opts ...connect.HandlerOption) vCSServiceGetFileHandler.ServeHTTP(w, r) case VCSServiceGetCommitProcedure: vCSServiceGetCommitHandler.ServeHTTP(w, r) + case VCSServiceGetCommitsProcedure: + vCSServiceGetCommitsHandler.ServeHTTP(w, r) default: http.NotFound(w, r) } @@ -227,3 +252,7 @@ func (UnimplementedVCSServiceHandler) GetFile(context.Context, *connect.Request[ func (UnimplementedVCSServiceHandler) GetCommit(context.Context, *connect.Request[v1.GetCommitRequest]) (*connect.Response[v1.GetCommitResponse], error) { return nil, connect.NewError(connect.CodeUnimplemented, errors.New("vcs.v1.VCSService.GetCommit is not implemented")) } + +func (UnimplementedVCSServiceHandler) GetCommits(context.Context, *connect.Request[v1.GetCommitsRequest]) (*connect.Response[v1.GetCommitsResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("vcs.v1.VCSService.GetCommits is not implemented")) +} diff --git a/api/gen/proto/go/vcs/v1/vcsv1connect/vcs.connect.mux.go b/api/gen/proto/go/vcs/v1/vcsv1connect/vcs.connect.mux.go index 51ade2586d..a8e61ecae4 100644 --- a/api/gen/proto/go/vcs/v1/vcsv1connect/vcs.connect.mux.go +++ b/api/gen/proto/go/vcs/v1/vcsv1connect/vcs.connect.mux.go @@ -44,4 +44,9 @@ func RegisterVCSServiceHandler(mux *mux.Router, svc VCSServiceHandler, opts ...c svc.GetCommit, opts..., )) + mux.Handle("/vcs.v1.VCSService/GetCommits", connect.NewUnaryHandler( + "/vcs.v1.VCSService/GetCommits", + svc.GetCommits, + opts..., + )) } diff --git a/api/openapiv2/gen/phlare.swagger.json b/api/openapiv2/gen/phlare.swagger.json index fbc2dd0b9c..9ddd87bf69 100644 --- a/api/openapiv2/gen/phlare.swagger.json +++ b/api/openapiv2/gen/phlare.swagger.json @@ -650,6 +650,31 @@ } } }, + "v1CommitInfo": { + "type": "object", + "properties": { + "message": { + "type": "string", + "title": "the commit message" + }, + "author": { + "$ref": "#/definitions/v1CommitAuthor", + "title": "the commit author login" + }, + "date": { + "type": "string", + "title": "the commit date" + }, + "sha": { + "type": "string", + "title": "the commit sha" + }, + "URL": { + "type": "string", + "title": "the full URL to the commit" + } + } + }, "v1CompactionJob": { "type": "object", "properties": { @@ -977,6 +1002,18 @@ } } }, + "v1GetCommitsResponse": { + "type": "object", + "properties": { + "commits": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/v1CommitInfo" + } + } + } + }, "v1GetCompactionResponse": { "type": "object", "properties": { diff --git a/api/vcs/v1/vcs.proto b/api/vcs/v1/vcs.proto index a691241886..0fc9e7a525 100644 --- a/api/vcs/v1/vcs.proto +++ b/api/vcs/v1/vcs.proto @@ -8,6 +8,7 @@ service VCSService { rpc GithubRefresh(GithubRefreshRequest) returns (GithubRefreshResponse) {} rpc GetFile(GetFileRequest) returns (GetFileResponse) {} rpc GetCommit(GetCommitRequest) returns (GetCommitResponse) {} + rpc GetCommits(GetCommitsRequest) returns (GetCommitsResponse) {} } message GithubAppRequest {} @@ -71,3 +72,26 @@ message CommitAuthor { // the author avatar URL string avatarURL = 2; } + +message CommitInfo { + // the commit message + string message = 1; + // the commit author login + CommitAuthor author = 2; + // the commit date + string date = 3; + // the commit sha + string sha = 4; + // the full URL to the commit + string URL = 5; +} + +// New messages for the GetCommits method +message GetCommitsRequest { + string repository_url = 1; + repeated string refs = 2; +} + +message GetCommitsResponse { + repeated CommitInfo commits = 1; +} diff --git a/docs/sources/configure-server/reference-configuration-parameters/index.md b/docs/sources/configure-server/reference-configuration-parameters/index.md index c97607e8c4..948fb22eb7 100644 --- a/docs/sources/configure-server/reference-configuration-parameters/index.md +++ b/docs/sources/configure-server/reference-configuration-parameters/index.md @@ -633,10 +633,6 @@ lifecycler: # values: # # Secure Ciphers: - # - TLS_RSA_WITH_AES_128_CBC_SHA - # - TLS_RSA_WITH_AES_256_CBC_SHA - # - TLS_RSA_WITH_AES_128_GCM_SHA256 - # - TLS_RSA_WITH_AES_256_GCM_SHA384 # - TLS_AES_128_GCM_SHA256 # - TLS_AES_256_GCM_SHA384 # - TLS_CHACHA20_POLY1305_SHA256 @@ -654,7 +650,11 @@ lifecycler: # Insecure Ciphers: # - TLS_RSA_WITH_RC4_128_SHA # - TLS_RSA_WITH_3DES_EDE_CBC_SHA + # - TLS_RSA_WITH_AES_128_CBC_SHA + # - TLS_RSA_WITH_AES_256_CBC_SHA # - TLS_RSA_WITH_AES_128_CBC_SHA256 + # - TLS_RSA_WITH_AES_128_GCM_SHA256 + # - TLS_RSA_WITH_AES_256_GCM_SHA384 # - TLS_ECDHE_ECDSA_WITH_RC4_128_SHA # - TLS_ECDHE_RSA_WITH_RC4_128_SHA # - TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA @@ -990,10 +990,6 @@ sharding_ring: # values: # # Secure Ciphers: - # - TLS_RSA_WITH_AES_128_CBC_SHA - # - TLS_RSA_WITH_AES_256_CBC_SHA - # - TLS_RSA_WITH_AES_128_GCM_SHA256 - # - TLS_RSA_WITH_AES_256_GCM_SHA384 # - TLS_AES_128_GCM_SHA256 # - TLS_AES_256_GCM_SHA384 # - TLS_CHACHA20_POLY1305_SHA256 @@ -1011,7 +1007,11 @@ sharding_ring: # Insecure Ciphers: # - TLS_RSA_WITH_RC4_128_SHA # - TLS_RSA_WITH_3DES_EDE_CBC_SHA + # - TLS_RSA_WITH_AES_128_CBC_SHA + # - TLS_RSA_WITH_AES_256_CBC_SHA # - TLS_RSA_WITH_AES_128_CBC_SHA256 + # - TLS_RSA_WITH_AES_128_GCM_SHA256 + # - TLS_RSA_WITH_AES_256_GCM_SHA384 # - TLS_ECDHE_ECDSA_WITH_RC4_128_SHA # - TLS_ECDHE_RSA_WITH_RC4_128_SHA # - TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA @@ -1339,10 +1339,6 @@ sharding_ring: # values: # # Secure Ciphers: - # - TLS_RSA_WITH_AES_128_CBC_SHA - # - TLS_RSA_WITH_AES_256_CBC_SHA - # - TLS_RSA_WITH_AES_128_GCM_SHA256 - # - TLS_RSA_WITH_AES_256_GCM_SHA384 # - TLS_AES_128_GCM_SHA256 # - TLS_AES_256_GCM_SHA384 # - TLS_CHACHA20_POLY1305_SHA256 @@ -1360,7 +1356,11 @@ sharding_ring: # Insecure Ciphers: # - TLS_RSA_WITH_RC4_128_SHA # - TLS_RSA_WITH_3DES_EDE_CBC_SHA + # - TLS_RSA_WITH_AES_128_CBC_SHA + # - TLS_RSA_WITH_AES_256_CBC_SHA # - TLS_RSA_WITH_AES_128_CBC_SHA256 + # - TLS_RSA_WITH_AES_128_GCM_SHA256 + # - TLS_RSA_WITH_AES_256_GCM_SHA384 # - TLS_ECDHE_ECDSA_WITH_RC4_128_SHA # - TLS_ECDHE_RSA_WITH_RC4_128_SHA # - TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA @@ -1547,10 +1547,6 @@ backoff_config: # Override the default cipher suite list (separated by commas). Allowed values: # # Secure Ciphers: -# - TLS_RSA_WITH_AES_128_CBC_SHA -# - TLS_RSA_WITH_AES_256_CBC_SHA -# - TLS_RSA_WITH_AES_128_GCM_SHA256 -# - TLS_RSA_WITH_AES_256_GCM_SHA384 # - TLS_AES_128_GCM_SHA256 # - TLS_AES_256_GCM_SHA384 # - TLS_CHACHA20_POLY1305_SHA256 @@ -1568,7 +1564,11 @@ backoff_config: # Insecure Ciphers: # - TLS_RSA_WITH_RC4_128_SHA # - TLS_RSA_WITH_3DES_EDE_CBC_SHA +# - TLS_RSA_WITH_AES_128_CBC_SHA +# - TLS_RSA_WITH_AES_256_CBC_SHA # - TLS_RSA_WITH_AES_128_CBC_SHA256 +# - TLS_RSA_WITH_AES_128_GCM_SHA256 +# - TLS_RSA_WITH_AES_256_GCM_SHA384 # - TLS_ECDHE_ECDSA_WITH_RC4_128_SHA # - TLS_ECDHE_RSA_WITH_RC4_128_SHA # - TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA @@ -1760,10 +1760,6 @@ The `memberlist` block configures the Gossip memberlist. # Override the default cipher suite list (separated by commas). Allowed values: # # Secure Ciphers: -# - TLS_RSA_WITH_AES_128_CBC_SHA -# - TLS_RSA_WITH_AES_256_CBC_SHA -# - TLS_RSA_WITH_AES_128_GCM_SHA256 -# - TLS_RSA_WITH_AES_256_GCM_SHA384 # - TLS_AES_128_GCM_SHA256 # - TLS_AES_256_GCM_SHA384 # - TLS_CHACHA20_POLY1305_SHA256 @@ -1781,7 +1777,11 @@ The `memberlist` block configures the Gossip memberlist. # Insecure Ciphers: # - TLS_RSA_WITH_RC4_128_SHA # - TLS_RSA_WITH_3DES_EDE_CBC_SHA +# - TLS_RSA_WITH_AES_128_CBC_SHA +# - TLS_RSA_WITH_AES_256_CBC_SHA # - TLS_RSA_WITH_AES_128_CBC_SHA256 +# - TLS_RSA_WITH_AES_128_GCM_SHA256 +# - TLS_RSA_WITH_AES_256_GCM_SHA384 # - TLS_ECDHE_ECDSA_WITH_RC4_128_SHA # - TLS_ECDHE_RSA_WITH_RC4_128_SHA # - TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA diff --git a/pkg/frontend/frontend_vcs.go b/pkg/frontend/frontend_vcs.go index c74a86ff05..a642c74c9f 100644 --- a/pkg/frontend/frontend_vcs.go +++ b/pkg/frontend/frontend_vcs.go @@ -28,3 +28,7 @@ func (f *Frontend) GetFile(ctx context.Context, req *connect.Request[vcsv1.GetFi func (f *Frontend) GetCommit(ctx context.Context, req *connect.Request[vcsv1.GetCommitRequest]) (*connect.Response[vcsv1.GetCommitResponse], error) { return connectgrpc.RoundTripUnary[vcsv1.GetCommitRequest, vcsv1.GetCommitResponse](ctx, f, req) } + +func (f *Frontend) GetCommits(ctx context.Context, req *connect.Request[vcsv1.GetCommitsRequest]) (*connect.Response[vcsv1.GetCommitsResponse], error) { + return connectgrpc.RoundTripUnary[vcsv1.GetCommitsRequest, vcsv1.GetCommitsResponse](ctx, f, req) +} diff --git a/pkg/querier/vcs/client/github.go b/pkg/querier/vcs/client/github.go index ac35dedd6d..4ee493c82e 100644 --- a/pkg/querier/vcs/client/github.go +++ b/pkg/querier/vcs/client/github.go @@ -26,7 +26,7 @@ type githubClient struct { client *github.Client } -func (gh *githubClient) GetCommit(ctx context.Context, owner, repo, ref string) (*vcsv1.GetCommitResponse, error) { +func (gh *githubClient) GetCommit(ctx context.Context, owner, repo, ref string) (*vcsv1.CommitInfo, error) { commit, _, err := gh.client.Repositories.GetCommit(ctx, owner, repo, ref, nil) if err != nil { var githubErr *github.ErrorResponse @@ -37,7 +37,7 @@ func (gh *githubClient) GetCommit(ctx context.Context, owner, repo, ref string) return nil, err } - return &vcsv1.GetCommitResponse{ + return &vcsv1.CommitInfo{ Sha: toString(commit.SHA), Message: toString(commit.Commit.Message), Author: &vcsv1.CommitAuthor{ diff --git a/pkg/querier/vcs/commit.go b/pkg/querier/vcs/commit.go new file mode 100644 index 0000000000..b5c8455390 --- /dev/null +++ b/pkg/querier/vcs/commit.go @@ -0,0 +1,83 @@ +package vcs + +import ( + "context" + "fmt" + "sync" + + vcsv1 "github.com/grafana/pyroscope/api/gen/proto/go/vcs/v1" +) + +type gitHubCommitGetter interface { + GetCommit(context.Context, string, string, string) (*vcsv1.CommitInfo, error) +} + +// getCommits fetches multiple commits in parallel for a given repository. +// It attempts to retrieve commits for all provided refs and returns: +// 1. Successfully fetched commits +// 2. Errors for failed fetches +// 3. An overall error if no commits were successfully fetched +// This function provides partial success behavior, returning any commits +// that were successfully fetched along with errors for those that failed. +func getCommits(ctx context.Context, client gitHubCommitGetter, owner, repo string, refs []string) ([]*vcsv1.CommitInfo, []error, error) { + type result struct { + commit *vcsv1.CommitInfo + err error + } + + var wg sync.WaitGroup + resultsCh := make(chan result, len(refs)) + + for _, ref := range refs { + wg.Add(1) + go func(ref string) { + defer wg.Done() + commit, err := tryGetCommit(ctx, client, owner, repo, ref) + resultsCh <- result{commit, err} + }(ref) + } + + go func() { + wg.Wait() + close(resultsCh) + }() + + var validCommits []*vcsv1.CommitInfo + var failedFetches []error + for r := range resultsCh { + if r.err != nil { + failedFetches = append(failedFetches, r.err) + } + if r.commit != nil { + validCommits = append(validCommits, r.commit) + } + } + + if len(validCommits) == 0 && len(failedFetches) > 0 { + return nil, failedFetches, fmt.Errorf("failed to fetch any commits") + } + + return validCommits, failedFetches, nil +} + +// tryGetCommit attempts to retrieve a commit using different ref formats (commit hash, branch, tag). +// It tries each format in order and returns the first successful result. +func tryGetCommit(ctx context.Context, client gitHubCommitGetter, owner, repo, ref string) (*vcsv1.CommitInfo, error) { + refFormats := []string{ + ref, // Try as a commit hash + "heads/" + ref, // Try as a branch + "tags/" + ref, // Try as a tag + } + + var lastErr error + for _, format := range refFormats { + commit, err := client.GetCommit(ctx, owner, repo, format) + if err == nil { + return commit, nil + } + + lastErr = err + } + + return nil, lastErr +} diff --git a/pkg/querier/vcs/commit_test.go b/pkg/querier/vcs/commit_test.go new file mode 100644 index 0000000000..4e72aa77b9 --- /dev/null +++ b/pkg/querier/vcs/commit_test.go @@ -0,0 +1,167 @@ +package vcs + +import ( + "context" + "errors" + "net/http" + "testing" + + "github.com/google/go-github/v58/github" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + + vcsv1 "github.com/grafana/pyroscope/api/gen/proto/go/vcs/v1" +) + +type gitHubCommitGetterMock struct { + mock.Mock +} + +func (m *gitHubCommitGetterMock) GetCommit(ctx context.Context, owner, repo, ref string) (*vcsv1.CommitInfo, error) { + args := m.Called(ctx, owner, repo, ref) + if args.Get(0) == nil { + return nil, args.Error(1) + } + + return args.Get(0).(*vcsv1.CommitInfo), args.Error(1) +} + +func TestGetCommits(t *testing.T) { + tests := []struct { + name string + refs []string + mockSetup func(*gitHubCommitGetterMock) + expectedCommits int + expectedErrors int + expectError bool + }{ + { + name: "All commits succeed", + refs: []string{"ref1", "ref2"}, + mockSetup: func(m *gitHubCommitGetterMock) { + m.On("GetCommit", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&vcsv1.CommitInfo{}, nil) + }, + expectedCommits: 2, + expectedErrors: 0, + expectError: false, + }, + { + name: "Partial fetch commits success", + refs: []string{"ref1", "ref2", "ref3"}, + mockSetup: func(m *gitHubCommitGetterMock) { + // ref1 succeeds on first try + m.On("GetCommit", mock.Anything, mock.Anything, mock.Anything, "ref1").Return(&vcsv1.CommitInfo{}, nil) + // ref2 fails on first try, succeeds with "heads/" prefix + m.On("GetCommit", mock.Anything, mock.Anything, mock.Anything, "ref2").Return(nil, errors.New("not found")) + m.On("GetCommit", mock.Anything, mock.Anything, mock.Anything, "heads/ref2").Return(&vcsv1.CommitInfo{}, nil) + // ref3 fails on all attempts + m.On("GetCommit", mock.Anything, mock.Anything, mock.Anything, "ref3").Return(nil, errors.New("not found")) + m.On("GetCommit", mock.Anything, mock.Anything, mock.Anything, "heads/ref3").Return(nil, errors.New("not found")) + m.On("GetCommit", mock.Anything, mock.Anything, mock.Anything, "tags/ref3").Return(nil, errors.New("not found")) + }, + expectedCommits: 2, + expectedErrors: 1, + expectError: false, + }, + { + name: "All commits fail to fetch", + refs: []string{"ref1", "ref2"}, + mockSetup: func(m *gitHubCommitGetterMock) { + m.On("GetCommit", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(nil, errors.New("not found")) + }, + expectedCommits: 0, + expectedErrors: 2, + expectError: true, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + mockGetter := new(gitHubCommitGetterMock) + tt.mockSetup(mockGetter) + + commits, failedFetches, err := getCommits(context.Background(), mockGetter, "owner", "repo", tt.refs) + + assert.Len(t, commits, tt.expectedCommits) + assert.Len(t, failedFetches, tt.expectedErrors) + + if tt.expectError { + assert.Error(t, err) + } else { + assert.NoError(t, err) + } + + mockGetter.AssertExpectations(t) + }) + } +} + +func TestTryGetCommit(t *testing.T) { + tests := []struct { + name string + setupMock func(*gitHubCommitGetterMock) + ref string + wantErr bool + }{ + { + name: "Direct commit hash", + setupMock: func(m *gitHubCommitGetterMock) { + m.On("GetCommit", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(&vcsv1.CommitInfo{}, nil) + }, + ref: "abcdef", + wantErr: false, + }, + { + name: "Branch reference with heads prefix", + setupMock: func(m *gitHubCommitGetterMock) { + m.On("GetCommit", mock.Anything, mock.Anything, mock.Anything, "main").Return(nil, errors.New("not found")) + m.On("GetCommit", mock.Anything, mock.Anything, mock.Anything, "heads/main").Return(&vcsv1.CommitInfo{}, nil) + }, + ref: "main", + wantErr: false, + }, + { + name: "Tag reference with tags prefix", + setupMock: func(m *gitHubCommitGetterMock) { + m.On("GetCommit", mock.Anything, mock.Anything, mock.Anything, mock.Anything). + Return(nil, assert.AnError).Times(2) + m.On("GetCommit", mock.Anything, mock.Anything, mock.Anything, "tags/v1").Return(&vcsv1.CommitInfo{}, nil).Times(1) + }, + ref: "v1", + wantErr: false, + }, + { + name: "GitHub API returns not found error", + setupMock: func(m *gitHubCommitGetterMock) { + notFoundErr := &github.ErrorResponse{ + Response: &http.Response{StatusCode: http.StatusNotFound}, + } + m.On("GetCommit", mock.Anything, mock.Anything, mock.Anything, mock.Anything). + Return(nil, notFoundErr).Times(3) + }, + ref: "nonexistent", + wantErr: true, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + mockGetter := new(gitHubCommitGetterMock) + tt.setupMock(mockGetter) + + commit, err := tryGetCommit(context.Background(), mockGetter, "owner", "repo", tt.ref) + + if tt.wantErr { + assert.Error(t, err) + var githubErr *github.ErrorResponse + assert.True(t, errors.As(err, &githubErr), "Expected a GitHub error") + assert.Nil(t, commit) + } else { + assert.NoError(t, err) + assert.NotNil(t, commit) + } + + mockGetter.AssertExpectations(t) + }) + } +} diff --git a/pkg/querier/vcs/service.go b/pkg/querier/vcs/service.go index 4232eabf10..eaa0305db4 100644 --- a/pkg/querier/vcs/service.go +++ b/pkg/querier/vcs/service.go @@ -15,8 +15,8 @@ import ( "golang.org/x/oauth2" vcsv1 "github.com/grafana/pyroscope/api/gen/proto/go/vcs/v1" - vcsv1connect "github.com/grafana/pyroscope/api/gen/proto/go/vcs/v1/vcsv1connect" - client "github.com/grafana/pyroscope/pkg/querier/vcs/client" + "github.com/grafana/pyroscope/api/gen/proto/go/vcs/v1/vcsv1connect" + "github.com/grafana/pyroscope/pkg/querier/vcs/client" "github.com/grafana/pyroscope/pkg/querier/vcs/source" ) @@ -27,10 +27,6 @@ type Service struct { httpClient *http.Client } -type gitHubCommitGetter interface { - GetCommit(context.Context, string, string, string) (*vcsv1.GetCommitResponse, error) -} - func New(logger log.Logger, reg prometheus.Registerer) *Service { httpClient := client.InstrumentedHTTPClient(logger, reg) @@ -197,35 +193,64 @@ func (q *Service) GetCommit(ctx context.Context, req *connect.Request[vcsv1.GetC repo := gitURL.GetRepoName() ref := req.Msg.GetRef() - commit, err := q.tryGetCommit(ctx, ghClient, owner, repo, ref) + commit, err := tryGetCommit(ctx, ghClient, owner, repo, ref) if err != nil { return nil, err } - return connect.NewResponse(commit), nil + return connect.NewResponse(&vcsv1.GetCommitResponse{ + Message: commit.GetMessage(), + Author: commit.GetAuthor(), + Date: commit.GetDate(), + Sha: commit.GetSha(), + URL: commit.GetURL(), + }), nil } -// tryGetCommit attempts to retrieve a commit using different ref formats (commit hash, branch, tag). -// It tries each format in order and returns the first successful result. -func (q *Service) tryGetCommit(ctx context.Context, client gitHubCommitGetter, owner, repo, ref string) (*vcsv1.GetCommitResponse, error) { - refFormats := []string{ - ref, // Try as a commit hash - "heads/" + ref, // Try as a branch - "tags/" + ref, // Try as a tag +func (q *Service) GetCommits(ctx context.Context, req *connect.Request[vcsv1.GetCommitsRequest]) (*connect.Response[vcsv1.GetCommitsResponse], error) { + token, err := tokenFromRequest(ctx, req) + if err != nil { + q.logger.Log("err", err, "msg", "failed to extract token from request") + return nil, connect.NewError(connect.CodeUnauthenticated, fmt.Errorf("invalid token")) } - var lastErr error - for _, format := range refFormats { - commit, err := client.GetCommit(ctx, owner, repo, format) - if err == nil { - return commit, nil - } + err = rejectExpiredToken(token) + if err != nil { + return nil, err + } + + gitURL, err := giturl.NewGitURL(req.Msg.RepositoryUrl) + if err != nil { + return nil, connect.NewError(connect.CodeInvalidArgument, err) + } - lastErr = err - q.logger.Log("err", lastErr, "msg", "Failed to get commit", "ref", format) + if gitURL.GetProvider() != apis.ProviderGitHub.String() { + return nil, connect.NewError(connect.CodeInvalidArgument, errors.New("only GitHub repositories are supported")) + } + + ghClient, err := client.GithubClient(ctx, token, q.httpClient) + if err != nil { + return nil, err + } + + owner := gitURL.GetOwnerName() + repo := gitURL.GetRepoName() + refs := req.Msg.Refs + + commits, failedFetches, err := getCommits(ctx, ghClient, owner, repo, refs) + if err != nil { + q.logger.Log("err", err, "msg", "failed to get any commits", "owner", owner, "repo", repo) + return nil, err + } + + if len(failedFetches) > 0 { + q.logger.Log("warn", "partial success fetching commits", "owner", owner, "repo", repo, "successCount", len(commits), "failureCount", len(failedFetches)) + for _, fetchErr := range failedFetches { + q.logger.Log("err", fetchErr, "msg", "failed to fetch commit") + } } - return nil, lastErr + return connect.NewResponse(&vcsv1.GetCommitsResponse{Commits: commits}), nil } func rejectExpiredToken(token *oauth2.Token) error { diff --git a/pkg/querier/vcs/service_test.go b/pkg/querier/vcs/service_test.go deleted file mode 100644 index eb16d77ad8..0000000000 --- a/pkg/querier/vcs/service_test.go +++ /dev/null @@ -1,108 +0,0 @@ -package vcs - -import ( - "context" - "errors" - "net/http" - "testing" - - "github.com/go-kit/log" - "github.com/google/go-github/v58/github" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/mock" - - vcsv1 "github.com/grafana/pyroscope/api/gen/proto/go/vcs/v1" -) - -type gitHubCommitGetterMock struct { - mock.Mock -} - -func (m *gitHubCommitGetterMock) GetCommit(ctx context.Context, owner, repo, ref string) (*vcsv1.GetCommitResponse, error) { - args := m.Called(ctx, owner, repo, ref) - if args.Get(0) == nil { - return nil, args.Error(1) - } - - return args.Get(0).(*vcsv1.GetCommitResponse), args.Error(1) -} - -func TestTryGetCommit(t *testing.T) { - svc := Service{logger: log.NewNopLogger()} - - tests := []struct { - name string - setupMock func(*gitHubCommitGetterMock) - ref string - wantCommit *vcsv1.GetCommitResponse - wantErr bool - }{ - { - name: "Direct commit hash", - setupMock: func(m *gitHubCommitGetterMock) { - m.On("GetCommit", mock.Anything, mock.Anything, mock.Anything, mock.Anything). - Return(&vcsv1.GetCommitResponse{Sha: "abc123"}, nil) - }, - ref: "", - wantCommit: &vcsv1.GetCommitResponse{Sha: "abc123"}, - wantErr: false, - }, - { - name: "Branch reference with 'heads/' prefix", - setupMock: func(m *gitHubCommitGetterMock) { - m.On("GetCommit", mock.Anything, mock.Anything, mock.Anything, mock.Anything). - Return(nil, assert.AnError).Times(1) - m.On("GetCommit", mock.Anything, mock.Anything, mock.Anything, "heads/main"). - Return(&vcsv1.GetCommitResponse{Sha: "def456"}, nil).Times(1) - }, - ref: "main", - wantCommit: &vcsv1.GetCommitResponse{Sha: "def456"}, - wantErr: false, - }, - { - name: "Tag reference with 'tags/' prefix", - setupMock: func(m *gitHubCommitGetterMock) { - m.On("GetCommit", mock.Anything, mock.Anything, mock.Anything, mock.Anything). - Return(nil, assert.AnError).Times(2) - m.On("GetCommit", mock.Anything, mock.Anything, mock.Anything, "tags/v1"). - Return(&vcsv1.GetCommitResponse{Sha: "def456"}, nil).Times(1) - }, - ref: "v1", - wantCommit: &vcsv1.GetCommitResponse{Sha: "def456"}, - wantErr: false, - }, - { - name: "GitHub API returns not found error", - setupMock: func(m *gitHubCommitGetterMock) { - notFoundErr := &github.ErrorResponse{ - Response: &http.Response{StatusCode: http.StatusNotFound}, - } - m.On("GetCommit", mock.Anything, mock.Anything, mock.Anything, mock.Anything). - Return(nil, notFoundErr).Times(3) - }, - ref: "nonexistent", - wantCommit: nil, - wantErr: true, - }, - } - - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - mockGetter := new(gitHubCommitGetterMock) - tt.setupMock(mockGetter) - - gotCommit, err := svc.tryGetCommit(context.Background(), mockGetter, "owner", "repo", tt.ref) - - if tt.wantErr { - assert.Error(t, err) - var githubErr *github.ErrorResponse - assert.True(t, errors.As(err, &githubErr), "Expected a GitHub error") - } else { - assert.NoError(t, err) - } - - assert.Equal(t, tt.wantCommit, gotCommit) - mockGetter.AssertExpectations(t) - }) - } -}