From 6707213b447778ccb7223e95614bf9144ed5dab3 Mon Sep 17 00:00:00 2001 From: Matt Toohey Date: Thu, 5 Dec 2024 09:18:16 +1100 Subject: [PATCH] feat: timeline service keeps events in memory (#3618) closes #3626 Very simple implementation to be begin with. Allows: - creating events - getting events with super simple filters - clearing out old events --- .../xyz/block/ftl/timeline/v1/timeline.pb.go | 431 +++++++++++++++--- .../xyz/block/ftl/timeline/v1/timeline.proto | 18 + .../v1/timelinev1connect/timeline.connect.go | 27 ++ backend/timeline/events.go | 68 +++ backend/timeline/service.go | 93 +++- backend/timeline/service_test.go | 104 +++++ .../block/ftl/timeline/v1/timeline_connect.ts | 11 +- .../xyz/block/ftl/timeline/v1/timeline_pb.ts | 132 +++++- .../xyz/block/ftl/timeline/v1/timeline_pb2.py | 18 +- .../block/ftl/timeline/v1/timeline_pb2.pyi | 26 ++ 10 files changed, 851 insertions(+), 77 deletions(-) create mode 100644 backend/timeline/events.go create mode 100644 backend/timeline/service_test.go diff --git a/backend/protos/xyz/block/ftl/timeline/v1/timeline.pb.go b/backend/protos/xyz/block/ftl/timeline/v1/timeline.pb.go index f7aa9d17e..57935d5d5 100644 --- a/backend/protos/xyz/block/ftl/timeline/v1/timeline.pb.go +++ b/backend/protos/xyz/block/ftl/timeline/v1/timeline.pb.go @@ -135,6 +135,219 @@ func (x *GetTimelineResponse) GetEvents() []*Event { return nil } +type CreateEventRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Entry: + // + // *CreateEventRequest_Log + // *CreateEventRequest_Call + // *CreateEventRequest_DeploymentCreated + // *CreateEventRequest_DeploymentUpdated + // *CreateEventRequest_Ingress + // *CreateEventRequest_CronScheduled + // *CreateEventRequest_AsyncExecute + // *CreateEventRequest_PubsubPublish + // *CreateEventRequest_PubsubConsume + Entry isCreateEventRequest_Entry `protobuf_oneof:"entry"` +} + +func (x *CreateEventRequest) Reset() { + *x = CreateEventRequest{} + mi := &file_xyz_block_ftl_timeline_v1_timeline_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateEventRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateEventRequest) ProtoMessage() {} + +func (x *CreateEventRequest) ProtoReflect() protoreflect.Message { + mi := &file_xyz_block_ftl_timeline_v1_timeline_proto_msgTypes[2] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateEventRequest.ProtoReflect.Descriptor instead. +func (*CreateEventRequest) Descriptor() ([]byte, []int) { + return file_xyz_block_ftl_timeline_v1_timeline_proto_rawDescGZIP(), []int{2} +} + +func (m *CreateEventRequest) GetEntry() isCreateEventRequest_Entry { + if m != nil { + return m.Entry + } + return nil +} + +func (x *CreateEventRequest) GetLog() *LogEvent { + if x, ok := x.GetEntry().(*CreateEventRequest_Log); ok { + return x.Log + } + return nil +} + +func (x *CreateEventRequest) GetCall() *CallEvent { + if x, ok := x.GetEntry().(*CreateEventRequest_Call); ok { + return x.Call + } + return nil +} + +func (x *CreateEventRequest) GetDeploymentCreated() *DeploymentCreatedEvent { + if x, ok := x.GetEntry().(*CreateEventRequest_DeploymentCreated); ok { + return x.DeploymentCreated + } + return nil +} + +func (x *CreateEventRequest) GetDeploymentUpdated() *DeploymentUpdatedEvent { + if x, ok := x.GetEntry().(*CreateEventRequest_DeploymentUpdated); ok { + return x.DeploymentUpdated + } + return nil +} + +func (x *CreateEventRequest) GetIngress() *IngressEvent { + if x, ok := x.GetEntry().(*CreateEventRequest_Ingress); ok { + return x.Ingress + } + return nil +} + +func (x *CreateEventRequest) GetCronScheduled() *CronScheduledEvent { + if x, ok := x.GetEntry().(*CreateEventRequest_CronScheduled); ok { + return x.CronScheduled + } + return nil +} + +func (x *CreateEventRequest) GetAsyncExecute() *AsyncExecuteEvent { + if x, ok := x.GetEntry().(*CreateEventRequest_AsyncExecute); ok { + return x.AsyncExecute + } + return nil +} + +func (x *CreateEventRequest) GetPubsubPublish() *PubSubPublishEvent { + if x, ok := x.GetEntry().(*CreateEventRequest_PubsubPublish); ok { + return x.PubsubPublish + } + return nil +} + +func (x *CreateEventRequest) GetPubsubConsume() *PubSubConsumeEvent { + if x, ok := x.GetEntry().(*CreateEventRequest_PubsubConsume); ok { + return x.PubsubConsume + } + return nil +} + +type isCreateEventRequest_Entry interface { + isCreateEventRequest_Entry() +} + +type CreateEventRequest_Log struct { + Log *LogEvent `protobuf:"bytes,1,opt,name=log,proto3,oneof"` +} + +type CreateEventRequest_Call struct { + Call *CallEvent `protobuf:"bytes,2,opt,name=call,proto3,oneof"` +} + +type CreateEventRequest_DeploymentCreated struct { + DeploymentCreated *DeploymentCreatedEvent `protobuf:"bytes,3,opt,name=deployment_created,json=deploymentCreated,proto3,oneof"` +} + +type CreateEventRequest_DeploymentUpdated struct { + DeploymentUpdated *DeploymentUpdatedEvent `protobuf:"bytes,4,opt,name=deployment_updated,json=deploymentUpdated,proto3,oneof"` +} + +type CreateEventRequest_Ingress struct { + Ingress *IngressEvent `protobuf:"bytes,5,opt,name=ingress,proto3,oneof"` +} + +type CreateEventRequest_CronScheduled struct { + CronScheduled *CronScheduledEvent `protobuf:"bytes,6,opt,name=cron_scheduled,json=cronScheduled,proto3,oneof"` +} + +type CreateEventRequest_AsyncExecute struct { + AsyncExecute *AsyncExecuteEvent `protobuf:"bytes,7,opt,name=async_execute,json=asyncExecute,proto3,oneof"` +} + +type CreateEventRequest_PubsubPublish struct { + PubsubPublish *PubSubPublishEvent `protobuf:"bytes,8,opt,name=pubsub_publish,json=pubsubPublish,proto3,oneof"` +} + +type CreateEventRequest_PubsubConsume struct { + PubsubConsume *PubSubConsumeEvent `protobuf:"bytes,9,opt,name=pubsub_consume,json=pubsubConsume,proto3,oneof"` +} + +func (*CreateEventRequest_Log) isCreateEventRequest_Entry() {} + +func (*CreateEventRequest_Call) isCreateEventRequest_Entry() {} + +func (*CreateEventRequest_DeploymentCreated) isCreateEventRequest_Entry() {} + +func (*CreateEventRequest_DeploymentUpdated) isCreateEventRequest_Entry() {} + +func (*CreateEventRequest_Ingress) isCreateEventRequest_Entry() {} + +func (*CreateEventRequest_CronScheduled) isCreateEventRequest_Entry() {} + +func (*CreateEventRequest_AsyncExecute) isCreateEventRequest_Entry() {} + +func (*CreateEventRequest_PubsubPublish) isCreateEventRequest_Entry() {} + +func (*CreateEventRequest_PubsubConsume) isCreateEventRequest_Entry() {} + +type CreateEventResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *CreateEventResponse) Reset() { + *x = CreateEventResponse{} + mi := &file_xyz_block_ftl_timeline_v1_timeline_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *CreateEventResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateEventResponse) ProtoMessage() {} + +func (x *CreateEventResponse) ProtoReflect() protoreflect.Message { + mi := &file_xyz_block_ftl_timeline_v1_timeline_proto_msgTypes[3] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CreateEventResponse.ProtoReflect.Descriptor instead. +func (*CreateEventResponse) Descriptor() ([]byte, []int) { + return file_xyz_block_ftl_timeline_v1_timeline_proto_rawDescGZIP(), []int{3} +} + type DeleteOldEventsRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -146,7 +359,7 @@ type DeleteOldEventsRequest struct { func (x *DeleteOldEventsRequest) Reset() { *x = DeleteOldEventsRequest{} - mi := &file_xyz_block_ftl_timeline_v1_timeline_proto_msgTypes[2] + mi := &file_xyz_block_ftl_timeline_v1_timeline_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -158,7 +371,7 @@ func (x *DeleteOldEventsRequest) String() string { func (*DeleteOldEventsRequest) ProtoMessage() {} func (x *DeleteOldEventsRequest) ProtoReflect() protoreflect.Message { - mi := &file_xyz_block_ftl_timeline_v1_timeline_proto_msgTypes[2] + mi := &file_xyz_block_ftl_timeline_v1_timeline_proto_msgTypes[4] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -171,7 +384,7 @@ func (x *DeleteOldEventsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteOldEventsRequest.ProtoReflect.Descriptor instead. func (*DeleteOldEventsRequest) Descriptor() ([]byte, []int) { - return file_xyz_block_ftl_timeline_v1_timeline_proto_rawDescGZIP(), []int{2} + return file_xyz_block_ftl_timeline_v1_timeline_proto_rawDescGZIP(), []int{4} } func (x *DeleteOldEventsRequest) GetEventType() EventType { @@ -198,7 +411,7 @@ type DeleteOldEventsResponse struct { func (x *DeleteOldEventsResponse) Reset() { *x = DeleteOldEventsResponse{} - mi := &file_xyz_block_ftl_timeline_v1_timeline_proto_msgTypes[3] + mi := &file_xyz_block_ftl_timeline_v1_timeline_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -210,7 +423,7 @@ func (x *DeleteOldEventsResponse) String() string { func (*DeleteOldEventsResponse) ProtoMessage() {} func (x *DeleteOldEventsResponse) ProtoReflect() protoreflect.Message { - mi := &file_xyz_block_ftl_timeline_v1_timeline_proto_msgTypes[3] + mi := &file_xyz_block_ftl_timeline_v1_timeline_proto_msgTypes[5] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -223,7 +436,7 @@ func (x *DeleteOldEventsResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteOldEventsResponse.ProtoReflect.Descriptor instead. func (*DeleteOldEventsResponse) Descriptor() ([]byte, []int) { - return file_xyz_block_ftl_timeline_v1_timeline_proto_rawDescGZIP(), []int{3} + return file_xyz_block_ftl_timeline_v1_timeline_proto_rawDescGZIP(), []int{5} } func (x *DeleteOldEventsResponse) GetDeletedCount() int64 { @@ -263,45 +476,102 @@ var file_xyz_block_ftl_timeline_v1_timeline_proto_rawDesc = []byte{ 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x06, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, - 0x22, 0x7e, 0x0a, 0x16, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4f, 0x6c, 0x64, 0x45, 0x76, 0x65, - 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x43, 0x0a, 0x0a, 0x65, 0x76, - 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x24, + 0x22, 0xfc, 0x05, 0x0a, 0x12, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x37, 0x0a, 0x03, 0x6c, 0x6f, 0x67, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, + 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, + 0x2e, 0x4c, 0x6f, 0x67, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x03, 0x6c, 0x6f, 0x67, + 0x12, 0x3a, 0x0a, 0x04, 0x63, 0x61, 0x6c, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x74, - 0x69, 0x6d, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, - 0x54, 0x79, 0x70, 0x65, 0x52, 0x09, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, - 0x1f, 0x0a, 0x0b, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x61, 0x67, 0x65, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, - 0x22, 0x3e, 0x0a, 0x17, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4f, 0x6c, 0x64, 0x45, 0x76, 0x65, - 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x64, - 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x0c, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x43, 0x6f, 0x75, 0x6e, 0x74, - 0x32, 0xcc, 0x02, 0x0a, 0x0f, 0x54, 0x69, 0x6d, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x12, 0x4a, 0x0a, 0x04, 0x50, 0x69, 0x6e, 0x67, 0x12, 0x1d, 0x2e, 0x78, - 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, - 0x50, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x78, 0x79, - 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x50, - 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, - 0x12, 0x71, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x12, - 0x2d, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, - 0x74, 0x69, 0x6d, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x54, - 0x69, 0x6d, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, + 0x69, 0x6d, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x45, + 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x04, 0x63, 0x61, 0x6c, 0x6c, 0x12, 0x62, 0x0a, 0x12, + 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x63, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x6c, 0x69, 0x6e, + 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x11, 0x64, + 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, + 0x12, 0x62, 0x0a, 0x12, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x75, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x78, + 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x74, 0x69, 0x6d, + 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, + 0x65, 0x6e, 0x74, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, + 0x00, 0x52, 0x11, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x64, 0x12, 0x43, 0x0a, 0x07, 0x69, 0x6e, 0x67, 0x72, 0x65, 0x73, 0x73, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, + 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x2e, 0x76, + 0x31, 0x2e, 0x49, 0x6e, 0x67, 0x72, 0x65, 0x73, 0x73, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, + 0x52, 0x07, 0x69, 0x6e, 0x67, 0x72, 0x65, 0x73, 0x73, 0x12, 0x56, 0x0a, 0x0e, 0x63, 0x72, 0x6f, + 0x6e, 0x5f, 0x73, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x2d, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, + 0x6c, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, + 0x6f, 0x6e, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, + 0x48, 0x00, 0x52, 0x0d, 0x63, 0x72, 0x6f, 0x6e, 0x53, 0x63, 0x68, 0x65, 0x64, 0x75, 0x6c, 0x65, + 0x64, 0x12, 0x53, 0x0a, 0x0d, 0x61, 0x73, 0x79, 0x6e, 0x63, 0x5f, 0x65, 0x78, 0x65, 0x63, 0x75, + 0x74, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x6c, 0x69, 0x6e, + 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x73, 0x79, 0x6e, 0x63, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, + 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x0c, 0x61, 0x73, 0x79, 0x6e, 0x63, 0x45, + 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x12, 0x56, 0x0a, 0x0e, 0x70, 0x75, 0x62, 0x73, 0x75, 0x62, + 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x74, - 0x69, 0x6d, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x69, - 0x6d, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, - 0x90, 0x02, 0x01, 0x12, 0x7a, 0x0a, 0x0f, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4f, 0x6c, 0x64, - 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x31, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, + 0x69, 0x6d, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x75, 0x62, 0x53, 0x75, + 0x62, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, + 0x0d, 0x70, 0x75, 0x62, 0x73, 0x75, 0x62, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x12, 0x56, + 0x0a, 0x0e, 0x70, 0x75, 0x62, 0x73, 0x75, 0x62, 0x5f, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, + 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x2e, - 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4f, 0x6c, 0x64, 0x45, 0x76, 0x65, 0x6e, - 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x32, 0x2e, 0x78, 0x79, 0x7a, 0x2e, - 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x6c, 0x69, - 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4f, 0x6c, 0x64, 0x45, - 0x76, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, - 0x52, 0x50, 0x01, 0x5a, 0x4e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, - 0x54, 0x42, 0x44, 0x35, 0x34, 0x35, 0x36, 0x36, 0x39, 0x37, 0x35, 0x2f, 0x66, 0x74, 0x6c, 0x2f, - 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2f, 0x78, - 0x79, 0x7a, 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2f, 0x66, 0x74, 0x6c, 0x2f, 0x74, 0x69, 0x6d, - 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x74, 0x69, 0x6d, 0x65, 0x6c, 0x69, 0x6e, - 0x65, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x76, 0x31, 0x2e, 0x50, 0x75, 0x62, 0x53, 0x75, 0x62, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, + 0x45, 0x76, 0x65, 0x6e, 0x74, 0x48, 0x00, 0x52, 0x0d, 0x70, 0x75, 0x62, 0x73, 0x75, 0x62, 0x43, + 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x42, 0x07, 0x0a, 0x05, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x22, + 0x15, 0x0a, 0x13, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x7e, 0x0a, 0x16, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x4f, 0x6c, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x43, 0x0a, 0x0a, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, + 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, + 0x2e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x09, 0x65, 0x76, 0x65, 0x6e, + 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x65, 0x63, + 0x6f, 0x6e, 0x64, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x61, 0x67, 0x65, 0x53, + 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x22, 0x3e, 0x0a, 0x17, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x4f, 0x6c, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, + 0x64, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x32, 0xbc, 0x03, 0x0a, 0x0f, 0x54, 0x69, 0x6d, 0x65, 0x6c, + 0x69, 0x6e, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x4a, 0x0a, 0x04, 0x50, 0x69, + 0x6e, 0x67, 0x12, 0x1d, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, + 0x74, 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x1e, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, + 0x6c, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x12, 0x71, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x54, 0x69, 0x6d, + 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x12, 0x2d, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, + 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x2e, 0x76, + 0x31, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, + 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, + 0x2e, 0x47, 0x65, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x12, 0x6e, 0x0a, 0x0b, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x2d, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, + 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x6c, 0x69, 0x6e, + 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, + 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x6c, 0x69, 0x6e, 0x65, + 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x7a, 0x0a, 0x0f, 0x44, 0x65, 0x6c, + 0x65, 0x74, 0x65, 0x4f, 0x6c, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x31, 0x2e, 0x78, + 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, 0x74, 0x69, 0x6d, + 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4f, + 0x6c, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x32, 0x2e, 0x78, 0x79, 0x7a, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x66, 0x74, 0x6c, 0x2e, + 0x74, 0x69, 0x6d, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, + 0x74, 0x65, 0x4f, 0x6c, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x52, 0x50, 0x01, 0x5a, 0x4e, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x42, 0x44, 0x35, 0x34, 0x35, 0x36, 0x36, 0x39, 0x37, + 0x35, 0x2f, 0x66, 0x74, 0x6c, 0x2f, 0x62, 0x61, 0x63, 0x6b, 0x65, 0x6e, 0x64, 0x2f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x73, 0x2f, 0x78, 0x79, 0x7a, 0x2f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x2f, 0x66, + 0x74, 0x6c, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x74, + 0x69, 0x6d, 0x65, 0x6c, 0x69, 0x6e, 0x65, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( @@ -316,32 +586,54 @@ func file_xyz_block_ftl_timeline_v1_timeline_proto_rawDescGZIP() []byte { return file_xyz_block_ftl_timeline_v1_timeline_proto_rawDescData } -var file_xyz_block_ftl_timeline_v1_timeline_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_xyz_block_ftl_timeline_v1_timeline_proto_msgTypes = make([]protoimpl.MessageInfo, 6) var file_xyz_block_ftl_timeline_v1_timeline_proto_goTypes = []any{ (*GetTimelineRequest)(nil), // 0: xyz.block.ftl.timeline.v1.GetTimelineRequest (*GetTimelineResponse)(nil), // 1: xyz.block.ftl.timeline.v1.GetTimelineResponse - (*DeleteOldEventsRequest)(nil), // 2: xyz.block.ftl.timeline.v1.DeleteOldEventsRequest - (*DeleteOldEventsResponse)(nil), // 3: xyz.block.ftl.timeline.v1.DeleteOldEventsResponse - (EventType)(0), // 4: xyz.block.ftl.timeline.v1.EventType - (*Event)(nil), // 5: xyz.block.ftl.timeline.v1.Event - (*v1.PingRequest)(nil), // 6: xyz.block.ftl.v1.PingRequest - (*v1.PingResponse)(nil), // 7: xyz.block.ftl.v1.PingResponse + (*CreateEventRequest)(nil), // 2: xyz.block.ftl.timeline.v1.CreateEventRequest + (*CreateEventResponse)(nil), // 3: xyz.block.ftl.timeline.v1.CreateEventResponse + (*DeleteOldEventsRequest)(nil), // 4: xyz.block.ftl.timeline.v1.DeleteOldEventsRequest + (*DeleteOldEventsResponse)(nil), // 5: xyz.block.ftl.timeline.v1.DeleteOldEventsResponse + (EventType)(0), // 6: xyz.block.ftl.timeline.v1.EventType + (*Event)(nil), // 7: xyz.block.ftl.timeline.v1.Event + (*LogEvent)(nil), // 8: xyz.block.ftl.timeline.v1.LogEvent + (*CallEvent)(nil), // 9: xyz.block.ftl.timeline.v1.CallEvent + (*DeploymentCreatedEvent)(nil), // 10: xyz.block.ftl.timeline.v1.DeploymentCreatedEvent + (*DeploymentUpdatedEvent)(nil), // 11: xyz.block.ftl.timeline.v1.DeploymentUpdatedEvent + (*IngressEvent)(nil), // 12: xyz.block.ftl.timeline.v1.IngressEvent + (*CronScheduledEvent)(nil), // 13: xyz.block.ftl.timeline.v1.CronScheduledEvent + (*AsyncExecuteEvent)(nil), // 14: xyz.block.ftl.timeline.v1.AsyncExecuteEvent + (*PubSubPublishEvent)(nil), // 15: xyz.block.ftl.timeline.v1.PubSubPublishEvent + (*PubSubConsumeEvent)(nil), // 16: xyz.block.ftl.timeline.v1.PubSubConsumeEvent + (*v1.PingRequest)(nil), // 17: xyz.block.ftl.v1.PingRequest + (*v1.PingResponse)(nil), // 18: xyz.block.ftl.v1.PingResponse } var file_xyz_block_ftl_timeline_v1_timeline_proto_depIdxs = []int32{ - 4, // 0: xyz.block.ftl.timeline.v1.GetTimelineRequest.event_types:type_name -> xyz.block.ftl.timeline.v1.EventType - 5, // 1: xyz.block.ftl.timeline.v1.GetTimelineResponse.events:type_name -> xyz.block.ftl.timeline.v1.Event - 4, // 2: xyz.block.ftl.timeline.v1.DeleteOldEventsRequest.event_type:type_name -> xyz.block.ftl.timeline.v1.EventType - 6, // 3: xyz.block.ftl.timeline.v1.TimelineService.Ping:input_type -> xyz.block.ftl.v1.PingRequest - 0, // 4: xyz.block.ftl.timeline.v1.TimelineService.GetTimeline:input_type -> xyz.block.ftl.timeline.v1.GetTimelineRequest - 2, // 5: xyz.block.ftl.timeline.v1.TimelineService.DeleteOldEvents:input_type -> xyz.block.ftl.timeline.v1.DeleteOldEventsRequest - 7, // 6: xyz.block.ftl.timeline.v1.TimelineService.Ping:output_type -> xyz.block.ftl.v1.PingResponse - 1, // 7: xyz.block.ftl.timeline.v1.TimelineService.GetTimeline:output_type -> xyz.block.ftl.timeline.v1.GetTimelineResponse - 3, // 8: xyz.block.ftl.timeline.v1.TimelineService.DeleteOldEvents:output_type -> xyz.block.ftl.timeline.v1.DeleteOldEventsResponse - 6, // [6:9] is the sub-list for method output_type - 3, // [3:6] 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 + 6, // 0: xyz.block.ftl.timeline.v1.GetTimelineRequest.event_types:type_name -> xyz.block.ftl.timeline.v1.EventType + 7, // 1: xyz.block.ftl.timeline.v1.GetTimelineResponse.events:type_name -> xyz.block.ftl.timeline.v1.Event + 8, // 2: xyz.block.ftl.timeline.v1.CreateEventRequest.log:type_name -> xyz.block.ftl.timeline.v1.LogEvent + 9, // 3: xyz.block.ftl.timeline.v1.CreateEventRequest.call:type_name -> xyz.block.ftl.timeline.v1.CallEvent + 10, // 4: xyz.block.ftl.timeline.v1.CreateEventRequest.deployment_created:type_name -> xyz.block.ftl.timeline.v1.DeploymentCreatedEvent + 11, // 5: xyz.block.ftl.timeline.v1.CreateEventRequest.deployment_updated:type_name -> xyz.block.ftl.timeline.v1.DeploymentUpdatedEvent + 12, // 6: xyz.block.ftl.timeline.v1.CreateEventRequest.ingress:type_name -> xyz.block.ftl.timeline.v1.IngressEvent + 13, // 7: xyz.block.ftl.timeline.v1.CreateEventRequest.cron_scheduled:type_name -> xyz.block.ftl.timeline.v1.CronScheduledEvent + 14, // 8: xyz.block.ftl.timeline.v1.CreateEventRequest.async_execute:type_name -> xyz.block.ftl.timeline.v1.AsyncExecuteEvent + 15, // 9: xyz.block.ftl.timeline.v1.CreateEventRequest.pubsub_publish:type_name -> xyz.block.ftl.timeline.v1.PubSubPublishEvent + 16, // 10: xyz.block.ftl.timeline.v1.CreateEventRequest.pubsub_consume:type_name -> xyz.block.ftl.timeline.v1.PubSubConsumeEvent + 6, // 11: xyz.block.ftl.timeline.v1.DeleteOldEventsRequest.event_type:type_name -> xyz.block.ftl.timeline.v1.EventType + 17, // 12: xyz.block.ftl.timeline.v1.TimelineService.Ping:input_type -> xyz.block.ftl.v1.PingRequest + 0, // 13: xyz.block.ftl.timeline.v1.TimelineService.GetTimeline:input_type -> xyz.block.ftl.timeline.v1.GetTimelineRequest + 2, // 14: xyz.block.ftl.timeline.v1.TimelineService.CreateEvent:input_type -> xyz.block.ftl.timeline.v1.CreateEventRequest + 4, // 15: xyz.block.ftl.timeline.v1.TimelineService.DeleteOldEvents:input_type -> xyz.block.ftl.timeline.v1.DeleteOldEventsRequest + 18, // 16: xyz.block.ftl.timeline.v1.TimelineService.Ping:output_type -> xyz.block.ftl.v1.PingResponse + 1, // 17: xyz.block.ftl.timeline.v1.TimelineService.GetTimeline:output_type -> xyz.block.ftl.timeline.v1.GetTimelineResponse + 3, // 18: xyz.block.ftl.timeline.v1.TimelineService.CreateEvent:output_type -> xyz.block.ftl.timeline.v1.CreateEventResponse + 5, // 19: xyz.block.ftl.timeline.v1.TimelineService.DeleteOldEvents:output_type -> xyz.block.ftl.timeline.v1.DeleteOldEventsResponse + 16, // [16:20] is the sub-list for method output_type + 12, // [12:16] is the sub-list for method input_type + 12, // [12:12] is the sub-list for extension type_name + 12, // [12:12] is the sub-list for extension extendee + 0, // [0:12] is the sub-list for field type_name } func init() { file_xyz_block_ftl_timeline_v1_timeline_proto_init() } @@ -351,13 +643,24 @@ func file_xyz_block_ftl_timeline_v1_timeline_proto_init() { } file_xyz_block_ftl_timeline_v1_event_proto_init() file_xyz_block_ftl_timeline_v1_timeline_proto_msgTypes[0].OneofWrappers = []any{} + file_xyz_block_ftl_timeline_v1_timeline_proto_msgTypes[2].OneofWrappers = []any{ + (*CreateEventRequest_Log)(nil), + (*CreateEventRequest_Call)(nil), + (*CreateEventRequest_DeploymentCreated)(nil), + (*CreateEventRequest_DeploymentUpdated)(nil), + (*CreateEventRequest_Ingress)(nil), + (*CreateEventRequest_CronScheduled)(nil), + (*CreateEventRequest_AsyncExecute)(nil), + (*CreateEventRequest_PubsubPublish)(nil), + (*CreateEventRequest_PubsubConsume)(nil), + } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_xyz_block_ftl_timeline_v1_timeline_proto_rawDesc, NumEnums: 0, - NumMessages: 4, + NumMessages: 6, NumExtensions: 0, NumServices: 1, }, diff --git a/backend/protos/xyz/block/ftl/timeline/v1/timeline.proto b/backend/protos/xyz/block/ftl/timeline/v1/timeline.proto index 6e2cf03f2..61bc4a70f 100644 --- a/backend/protos/xyz/block/ftl/timeline/v1/timeline.proto +++ b/backend/protos/xyz/block/ftl/timeline/v1/timeline.proto @@ -19,6 +19,22 @@ message GetTimelineResponse { repeated timeline.v1.Event events = 1; } +message CreateEventRequest { + oneof entry { + LogEvent log = 1; + CallEvent call = 2; + DeploymentCreatedEvent deployment_created = 3; + DeploymentUpdatedEvent deployment_updated = 4; + IngressEvent ingress = 5; + CronScheduledEvent cron_scheduled = 6; + AsyncExecuteEvent async_execute = 7; + PubSubPublishEvent pubsub_publish = 8; + PubSubConsumeEvent pubsub_consume = 9; + } +} + +message CreateEventResponse {} + message DeleteOldEventsRequest { timeline.v1.EventType event_type = 1; int64 age_seconds = 2; @@ -39,6 +55,8 @@ service TimelineService { option idempotency_level = NO_SIDE_EFFECTS; } + rpc CreateEvent(CreateEventRequest) returns (CreateEventResponse) {} + // Delete old events of a specific type rpc DeleteOldEvents(DeleteOldEventsRequest) returns (DeleteOldEventsResponse) {} } diff --git a/backend/protos/xyz/block/ftl/timeline/v1/timelinev1connect/timeline.connect.go b/backend/protos/xyz/block/ftl/timeline/v1/timelinev1connect/timeline.connect.go index b67f217e3..2dfef9a72 100644 --- a/backend/protos/xyz/block/ftl/timeline/v1/timelinev1connect/timeline.connect.go +++ b/backend/protos/xyz/block/ftl/timeline/v1/timelinev1connect/timeline.connect.go @@ -39,6 +39,9 @@ const ( // TimelineServiceGetTimelineProcedure is the fully-qualified name of the TimelineService's // GetTimeline RPC. TimelineServiceGetTimelineProcedure = "/xyz.block.ftl.timeline.v1.TimelineService/GetTimeline" + // TimelineServiceCreateEventProcedure is the fully-qualified name of the TimelineService's + // CreateEvent RPC. + TimelineServiceCreateEventProcedure = "/xyz.block.ftl.timeline.v1.TimelineService/CreateEvent" // TimelineServiceDeleteOldEventsProcedure is the fully-qualified name of the TimelineService's // DeleteOldEvents RPC. TimelineServiceDeleteOldEventsProcedure = "/xyz.block.ftl.timeline.v1.TimelineService/DeleteOldEvents" @@ -50,6 +53,7 @@ type TimelineServiceClient interface { Ping(context.Context, *connect.Request[v1.PingRequest]) (*connect.Response[v1.PingResponse], error) // Get timeline events, optionally filtered by type and time GetTimeline(context.Context, *connect.Request[v11.GetTimelineRequest]) (*connect.Response[v11.GetTimelineResponse], error) + CreateEvent(context.Context, *connect.Request[v11.CreateEventRequest]) (*connect.Response[v11.CreateEventResponse], error) // Delete old events of a specific type DeleteOldEvents(context.Context, *connect.Request[v11.DeleteOldEventsRequest]) (*connect.Response[v11.DeleteOldEventsResponse], error) } @@ -76,6 +80,11 @@ func NewTimelineServiceClient(httpClient connect.HTTPClient, baseURL string, opt connect.WithIdempotency(connect.IdempotencyNoSideEffects), connect.WithClientOptions(opts...), ), + createEvent: connect.NewClient[v11.CreateEventRequest, v11.CreateEventResponse]( + httpClient, + baseURL+TimelineServiceCreateEventProcedure, + opts..., + ), deleteOldEvents: connect.NewClient[v11.DeleteOldEventsRequest, v11.DeleteOldEventsResponse]( httpClient, baseURL+TimelineServiceDeleteOldEventsProcedure, @@ -88,6 +97,7 @@ func NewTimelineServiceClient(httpClient connect.HTTPClient, baseURL string, opt type timelineServiceClient struct { ping *connect.Client[v1.PingRequest, v1.PingResponse] getTimeline *connect.Client[v11.GetTimelineRequest, v11.GetTimelineResponse] + createEvent *connect.Client[v11.CreateEventRequest, v11.CreateEventResponse] deleteOldEvents *connect.Client[v11.DeleteOldEventsRequest, v11.DeleteOldEventsResponse] } @@ -101,6 +111,11 @@ func (c *timelineServiceClient) GetTimeline(ctx context.Context, req *connect.Re return c.getTimeline.CallUnary(ctx, req) } +// CreateEvent calls xyz.block.ftl.timeline.v1.TimelineService.CreateEvent. +func (c *timelineServiceClient) CreateEvent(ctx context.Context, req *connect.Request[v11.CreateEventRequest]) (*connect.Response[v11.CreateEventResponse], error) { + return c.createEvent.CallUnary(ctx, req) +} + // DeleteOldEvents calls xyz.block.ftl.timeline.v1.TimelineService.DeleteOldEvents. func (c *timelineServiceClient) DeleteOldEvents(ctx context.Context, req *connect.Request[v11.DeleteOldEventsRequest]) (*connect.Response[v11.DeleteOldEventsResponse], error) { return c.deleteOldEvents.CallUnary(ctx, req) @@ -113,6 +128,7 @@ type TimelineServiceHandler interface { Ping(context.Context, *connect.Request[v1.PingRequest]) (*connect.Response[v1.PingResponse], error) // Get timeline events, optionally filtered by type and time GetTimeline(context.Context, *connect.Request[v11.GetTimelineRequest]) (*connect.Response[v11.GetTimelineResponse], error) + CreateEvent(context.Context, *connect.Request[v11.CreateEventRequest]) (*connect.Response[v11.CreateEventResponse], error) // Delete old events of a specific type DeleteOldEvents(context.Context, *connect.Request[v11.DeleteOldEventsRequest]) (*connect.Response[v11.DeleteOldEventsResponse], error) } @@ -135,6 +151,11 @@ func NewTimelineServiceHandler(svc TimelineServiceHandler, opts ...connect.Handl connect.WithIdempotency(connect.IdempotencyNoSideEffects), connect.WithHandlerOptions(opts...), ) + timelineServiceCreateEventHandler := connect.NewUnaryHandler( + TimelineServiceCreateEventProcedure, + svc.CreateEvent, + opts..., + ) timelineServiceDeleteOldEventsHandler := connect.NewUnaryHandler( TimelineServiceDeleteOldEventsProcedure, svc.DeleteOldEvents, @@ -146,6 +167,8 @@ func NewTimelineServiceHandler(svc TimelineServiceHandler, opts ...connect.Handl timelineServicePingHandler.ServeHTTP(w, r) case TimelineServiceGetTimelineProcedure: timelineServiceGetTimelineHandler.ServeHTTP(w, r) + case TimelineServiceCreateEventProcedure: + timelineServiceCreateEventHandler.ServeHTTP(w, r) case TimelineServiceDeleteOldEventsProcedure: timelineServiceDeleteOldEventsHandler.ServeHTTP(w, r) default: @@ -165,6 +188,10 @@ func (UnimplementedTimelineServiceHandler) GetTimeline(context.Context, *connect return nil, connect.NewError(connect.CodeUnimplemented, errors.New("xyz.block.ftl.timeline.v1.TimelineService.GetTimeline is not implemented")) } +func (UnimplementedTimelineServiceHandler) CreateEvent(context.Context, *connect.Request[v11.CreateEventRequest]) (*connect.Response[v11.CreateEventResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("xyz.block.ftl.timeline.v1.TimelineService.CreateEvent is not implemented")) +} + func (UnimplementedTimelineServiceHandler) DeleteOldEvents(context.Context, *connect.Request[v11.DeleteOldEventsRequest]) (*connect.Response[v11.DeleteOldEventsResponse], error) { return nil, connect.NewError(connect.CodeUnimplemented, errors.New("xyz.block.ftl.timeline.v1.TimelineService.DeleteOldEvents is not implemented")) } diff --git a/backend/timeline/events.go b/backend/timeline/events.go new file mode 100644 index 000000000..eef1f6f60 --- /dev/null +++ b/backend/timeline/events.go @@ -0,0 +1,68 @@ +package timeline + +import ( + "fmt" + "slices" + + timelinepb "github.com/TBD54566975/ftl/backend/protos/xyz/block/ftl/timeline/v1" +) + +func filter(event *timelinepb.Event, depKey string, eventTypes []timelinepb.EventType) bool { + if !slices.Contains(eventTypes, eventType(event)) { + return false + } + if depKey != "" && depKey != deploymentKey(event) { + return false + } + return true +} + +func eventType(event *timelinepb.Event) timelinepb.EventType { + switch event.Entry.(type) { + case *timelinepb.Event_Log: + return timelinepb.EventType_EVENT_TYPE_LOG + case *timelinepb.Event_Call: + return timelinepb.EventType_EVENT_TYPE_CALL + case *timelinepb.Event_DeploymentCreated: + return timelinepb.EventType_EVENT_TYPE_DEPLOYMENT_CREATED + case *timelinepb.Event_DeploymentUpdated: + return timelinepb.EventType_EVENT_TYPE_DEPLOYMENT_UPDATED + case *timelinepb.Event_Ingress: + return timelinepb.EventType_EVENT_TYPE_INGRESS + case *timelinepb.Event_CronScheduled: + return timelinepb.EventType_EVENT_TYPE_CRON_SCHEDULED + case *timelinepb.Event_AsyncExecute: + return timelinepb.EventType_EVENT_TYPE_ASYNC_EXECUTE + case *timelinepb.Event_PubsubPublish: + return timelinepb.EventType_EVENT_TYPE_PUBSUB_PUBLISH + case *timelinepb.Event_PubsubConsume: + return timelinepb.EventType_EVENT_TYPE_PUBSUB_CONSUME + default: + panic(fmt.Sprintf("unexpected event type: %T", event.Entry)) + } +} + +func deploymentKey(event *timelinepb.Event) string { + switch entry := event.Entry.(type) { + case *timelinepb.Event_Log: + return entry.Log.DeploymentKey + case *timelinepb.Event_Call: + return entry.Call.DeploymentKey + case *timelinepb.Event_DeploymentCreated: + return entry.DeploymentCreated.Key + case *timelinepb.Event_DeploymentUpdated: + return entry.DeploymentUpdated.Key + case *timelinepb.Event_Ingress: + return entry.Ingress.DeploymentKey + case *timelinepb.Event_CronScheduled: + return entry.CronScheduled.DeploymentKey + case *timelinepb.Event_AsyncExecute: + return entry.AsyncExecute.DeploymentKey + case *timelinepb.Event_PubsubPublish: + return entry.PubsubPublish.DeploymentKey + case *timelinepb.Event_PubsubConsume: + return entry.PubsubConsume.DeploymentKey + default: + panic(fmt.Sprintf("unexpected event type: %T", event.Entry)) + } +} diff --git a/backend/timeline/service.go b/backend/timeline/service.go index 6d91f1408..665b13db6 100644 --- a/backend/timeline/service.go +++ b/backend/timeline/service.go @@ -4,9 +4,12 @@ import ( "context" "fmt" "net/url" + "sync" + "time" "connectrpc.com/connect" "github.com/alecthomas/kong" + "google.golang.org/protobuf/types/known/timestamppb" timelinepb "github.com/TBD54566975/ftl/backend/protos/xyz/block/ftl/timeline/v1" timelineconnect "github.com/TBD54566975/ftl/backend/protos/xyz/block/ftl/timeline/v1/timelinev1connect" @@ -27,7 +30,9 @@ func (c *Config) SetDefaults() { } type service struct { - // TODO: add timeline schema view? (whatever is needed per the current timeline tables) + lock sync.RWMutex + nextID int + events []*timelinepb.Event } func Start(ctx context.Context, config Config, schemaEventSource schemaeventsource.EventSource) error { @@ -47,13 +52,93 @@ func Start(ctx context.Context, config Config, schemaEventSource schemaeventsour } func (s *service) Ping(ctx context.Context, req *connect.Request[ftlv1.PingRequest]) (*connect.Response[ftlv1.PingResponse], error) { - panic("not implemented") + return connect.NewResponse(&ftlv1.PingResponse{}), nil +} + +func (s *service) CreateEvent(ctx context.Context, req *connect.Request[timelinepb.CreateEventRequest]) (*connect.Response[timelinepb.CreateEventResponse], error) { + s.lock.Lock() + defer s.lock.Unlock() + + event := &timelinepb.Event{ + Id: int64(s.nextID), + TimeStamp: timestamppb.Now(), + } + switch entry := req.Msg.Entry.(type) { + case *timelinepb.CreateEventRequest_Log: + event.Entry = &timelinepb.Event_Log{ + Log: entry.Log, + } + case *timelinepb.CreateEventRequest_Call: + event.Entry = &timelinepb.Event_Call{ + Call: entry.Call, + } + case *timelinepb.CreateEventRequest_DeploymentCreated: + event.Entry = &timelinepb.Event_DeploymentCreated{ + DeploymentCreated: entry.DeploymentCreated, + } + case *timelinepb.CreateEventRequest_DeploymentUpdated: + event.Entry = &timelinepb.Event_DeploymentUpdated{ + DeploymentUpdated: entry.DeploymentUpdated, + } + case *timelinepb.CreateEventRequest_Ingress: + event.Entry = &timelinepb.Event_Ingress{ + Ingress: entry.Ingress, + } + case *timelinepb.CreateEventRequest_CronScheduled: + event.Entry = &timelinepb.Event_CronScheduled{ + CronScheduled: entry.CronScheduled, + } + case *timelinepb.CreateEventRequest_AsyncExecute: + event.Entry = &timelinepb.Event_AsyncExecute{ + AsyncExecute: entry.AsyncExecute, + } + case *timelinepb.CreateEventRequest_PubsubPublish: + event.Entry = &timelinepb.Event_PubsubPublish{ + PubsubPublish: entry.PubsubPublish, + } + case *timelinepb.CreateEventRequest_PubsubConsume: + event.Entry = &timelinepb.Event_PubsubConsume{ + PubsubConsume: entry.PubsubConsume, + } + } + s.events = append(s.events, event) + s.nextID++ + return connect.NewResponse(&timelinepb.CreateEventResponse{}), nil } func (s *service) GetTimeline(ctx context.Context, req *connect.Request[timelinepb.GetTimelineRequest]) (*connect.Response[timelinepb.GetTimelineResponse], error) { - panic("not implemented") + s.lock.RLock() + defer s.lock.RUnlock() + + results := []*timelinepb.Event{} + // TODO: handle sinceId + for i := len(s.events) - 1; i >= 0; i-- { + event := s.events[i] + if !filter(event, req.Msg.DeploymentKey, req.Msg.EventTypes) { + continue + } + results = append(results, s.events[i]) + if req.Msg.Limit != nil && *req.Msg.Limit != 0 && len(results) >= int(*req.Msg.Limit) { + break + } + } + return connect.NewResponse(&timelinepb.GetTimelineResponse{ + Events: results, + }), nil } func (s *service) DeleteOldEvents(ctx context.Context, req *connect.Request[timelinepb.DeleteOldEventsRequest]) (*connect.Response[timelinepb.DeleteOldEventsResponse], error) { - panic("not implemented") + s.lock.Lock() + defer s.lock.Unlock() + + cutoff := time.Now().Add(-1 * time.Duration(req.Msg.AgeSeconds) * time.Second) + filtered := []*timelinepb.Event{} + for _, event := range s.events { + if event.TimeStamp.AsTime().Before(cutoff) && (req.Msg.EventType == timelinepb.EventType_EVENT_TYPE_UNSPECIFIED || req.Msg.EventType != eventType(event)) { + continue + } + filtered = append(filtered, event) + } + s.events = filtered + return connect.NewResponse(&timelinepb.DeleteOldEventsResponse{}), nil } diff --git a/backend/timeline/service_test.go b/backend/timeline/service_test.go new file mode 100644 index 000000000..e438c3a02 --- /dev/null +++ b/backend/timeline/service_test.go @@ -0,0 +1,104 @@ +package timeline + +import ( + "context" + "strconv" + "testing" + "time" + + "connectrpc.com/connect" + timelinepb "github.com/TBD54566975/ftl/backend/protos/xyz/block/ftl/timeline/v1" + "github.com/alecthomas/assert/v2" +) + +func TestGetTimelineWithLimit(t *testing.T) { + t.Parallel() + ctx := context.Background() + service := &service{} + + // Create a bunch of entries + entryCount := 100 + requests := []*timelinepb.CreateEventRequest{} + for i := range entryCount { + requests = append(requests, &timelinepb.CreateEventRequest{ + Entry: &timelinepb.CreateEventRequest_Call{ + Call: &timelinepb.CallEvent{ + Request: strconv.Itoa(i), + Response: strconv.Itoa(i), + }, + }, + }) + } + for _, request := range requests { + _, err := service.CreateEvent(ctx, connect.NewRequest(request)) + assert.NoError(t, err) + } + + // Test with different limits + for _, limit := range []int32{ + 0, + 10, + 33, + 110, + } { + resp, err := service.GetTimeline(ctx, connect.NewRequest(&timelinepb.GetTimelineRequest{ + Limit: &limit, + EventTypes: []timelinepb.EventType{ + timelinepb.EventType_EVENT_TYPE_CALL, + }, + })) + assert.NoError(t, err) + if limit == 0 || limit > int32(entryCount) { + assert.Equal(t, entryCount, len(resp.Msg.Events)) + } else { + assert.Equal(t, int(limit), len(resp.Msg.Events)) + } + } +} + +func TestDeleteOldEvents(t *testing.T) { + t.Parallel() + ctx := context.Background() + service := &service{} + + // Create a bunch of entries of different types + requests := []*timelinepb.CreateEventRequest{} + for i := range 100 { + requests = append(requests, &timelinepb.CreateEventRequest{ + Entry: &timelinepb.CreateEventRequest_Call{ + Call: &timelinepb.CallEvent{ + Request: strconv.Itoa(i), + Response: strconv.Itoa(i), + }, + }, + }, &timelinepb.CreateEventRequest{ + Entry: &timelinepb.CreateEventRequest_Log{ + Log: &timelinepb.LogEvent{ + Message: strconv.Itoa(i), + }, + }, + }, &timelinepb.CreateEventRequest{ + Entry: &timelinepb.CreateEventRequest_DeploymentCreated{ + DeploymentCreated: &timelinepb.DeploymentCreatedEvent{ + Key: strconv.Itoa(i), + }, + }, + }) + } + for i, request := range requests { + if i == 150 { + // Add a delay half way through + time.Sleep(3 * time.Second) + } + _, err := service.CreateEvent(ctx, connect.NewRequest(request)) + assert.NoError(t, err) + } + + // Delete half the events (everything older than 3 seconds) + _, err := service.DeleteOldEvents(ctx, connect.NewRequest(&timelinepb.DeleteOldEventsRequest{ + AgeSeconds: 3, + EventType: timelinepb.EventType_EVENT_TYPE_UNSPECIFIED, + })) + assert.NoError(t, err) + assert.Equal(t, len(service.events), 150, "expected only half the events to be deleted") +} diff --git a/frontend/console/src/protos/xyz/block/ftl/timeline/v1/timeline_connect.ts b/frontend/console/src/protos/xyz/block/ftl/timeline/v1/timeline_connect.ts index 3b353346c..33aa209cd 100644 --- a/frontend/console/src/protos/xyz/block/ftl/timeline/v1/timeline_connect.ts +++ b/frontend/console/src/protos/xyz/block/ftl/timeline/v1/timeline_connect.ts @@ -5,7 +5,7 @@ import { PingRequest, PingResponse } from "../../v1/ftl_pb.js"; import { MethodIdempotency, MethodKind } from "@bufbuild/protobuf"; -import { DeleteOldEventsRequest, DeleteOldEventsResponse, GetTimelineRequest, GetTimelineResponse } from "./timeline_pb.js"; +import { CreateEventRequest, CreateEventResponse, DeleteOldEventsRequest, DeleteOldEventsResponse, GetTimelineRequest, GetTimelineResponse } from "./timeline_pb.js"; /** * @generated from service xyz.block.ftl.timeline.v1.TimelineService @@ -37,6 +37,15 @@ export const TimelineService = { kind: MethodKind.Unary, idempotency: MethodIdempotency.NoSideEffects, }, + /** + * @generated from rpc xyz.block.ftl.timeline.v1.TimelineService.CreateEvent + */ + createEvent: { + name: "CreateEvent", + I: CreateEventRequest, + O: CreateEventResponse, + kind: MethodKind.Unary, + }, /** * Delete old events of a specific type * diff --git a/frontend/console/src/protos/xyz/block/ftl/timeline/v1/timeline_pb.ts b/frontend/console/src/protos/xyz/block/ftl/timeline/v1/timeline_pb.ts index f744635c0..1c6f0a4ec 100644 --- a/frontend/console/src/protos/xyz/block/ftl/timeline/v1/timeline_pb.ts +++ b/frontend/console/src/protos/xyz/block/ftl/timeline/v1/timeline_pb.ts @@ -5,7 +5,7 @@ import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; import { Message, proto3, protoInt64 } from "@bufbuild/protobuf"; -import { Event, EventType } from "./event_pb.js"; +import { AsyncExecuteEvent, CallEvent, CronScheduledEvent, DeploymentCreatedEvent, DeploymentUpdatedEvent, Event, EventType, IngressEvent, LogEvent, PubSubConsumeEvent, PubSubPublishEvent } from "./event_pb.js"; /** * @generated from message xyz.block.ftl.timeline.v1.GetTimelineRequest @@ -99,6 +99,136 @@ export class GetTimelineResponse extends Message { } } +/** + * @generated from message xyz.block.ftl.timeline.v1.CreateEventRequest + */ +export class CreateEventRequest extends Message { + /** + * @generated from oneof xyz.block.ftl.timeline.v1.CreateEventRequest.entry + */ + entry: { + /** + * @generated from field: xyz.block.ftl.timeline.v1.LogEvent log = 1; + */ + value: LogEvent; + case: "log"; + } | { + /** + * @generated from field: xyz.block.ftl.timeline.v1.CallEvent call = 2; + */ + value: CallEvent; + case: "call"; + } | { + /** + * @generated from field: xyz.block.ftl.timeline.v1.DeploymentCreatedEvent deployment_created = 3; + */ + value: DeploymentCreatedEvent; + case: "deploymentCreated"; + } | { + /** + * @generated from field: xyz.block.ftl.timeline.v1.DeploymentUpdatedEvent deployment_updated = 4; + */ + value: DeploymentUpdatedEvent; + case: "deploymentUpdated"; + } | { + /** + * @generated from field: xyz.block.ftl.timeline.v1.IngressEvent ingress = 5; + */ + value: IngressEvent; + case: "ingress"; + } | { + /** + * @generated from field: xyz.block.ftl.timeline.v1.CronScheduledEvent cron_scheduled = 6; + */ + value: CronScheduledEvent; + case: "cronScheduled"; + } | { + /** + * @generated from field: xyz.block.ftl.timeline.v1.AsyncExecuteEvent async_execute = 7; + */ + value: AsyncExecuteEvent; + case: "asyncExecute"; + } | { + /** + * @generated from field: xyz.block.ftl.timeline.v1.PubSubPublishEvent pubsub_publish = 8; + */ + value: PubSubPublishEvent; + case: "pubsubPublish"; + } | { + /** + * @generated from field: xyz.block.ftl.timeline.v1.PubSubConsumeEvent pubsub_consume = 9; + */ + value: PubSubConsumeEvent; + case: "pubsubConsume"; + } | { case: undefined; value?: undefined } = { case: undefined }; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "xyz.block.ftl.timeline.v1.CreateEventRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "log", kind: "message", T: LogEvent, oneof: "entry" }, + { no: 2, name: "call", kind: "message", T: CallEvent, oneof: "entry" }, + { no: 3, name: "deployment_created", kind: "message", T: DeploymentCreatedEvent, oneof: "entry" }, + { no: 4, name: "deployment_updated", kind: "message", T: DeploymentUpdatedEvent, oneof: "entry" }, + { no: 5, name: "ingress", kind: "message", T: IngressEvent, oneof: "entry" }, + { no: 6, name: "cron_scheduled", kind: "message", T: CronScheduledEvent, oneof: "entry" }, + { no: 7, name: "async_execute", kind: "message", T: AsyncExecuteEvent, oneof: "entry" }, + { no: 8, name: "pubsub_publish", kind: "message", T: PubSubPublishEvent, oneof: "entry" }, + { no: 9, name: "pubsub_consume", kind: "message", T: PubSubConsumeEvent, oneof: "entry" }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): CreateEventRequest { + return new CreateEventRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): CreateEventRequest { + return new CreateEventRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): CreateEventRequest { + return new CreateEventRequest().fromJsonString(jsonString, options); + } + + static equals(a: CreateEventRequest | PlainMessage | undefined, b: CreateEventRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(CreateEventRequest, a, b); + } +} + +/** + * @generated from message xyz.block.ftl.timeline.v1.CreateEventResponse + */ +export class CreateEventResponse extends Message { + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "xyz.block.ftl.timeline.v1.CreateEventResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): CreateEventResponse { + return new CreateEventResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): CreateEventResponse { + return new CreateEventResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): CreateEventResponse { + return new CreateEventResponse().fromJsonString(jsonString, options); + } + + static equals(a: CreateEventResponse | PlainMessage | undefined, b: CreateEventResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(CreateEventResponse, a, b); + } +} + /** * @generated from message xyz.block.ftl.timeline.v1.DeleteOldEventsRequest */ diff --git a/python-runtime/ftl/src/ftl/protos/xyz/block/ftl/timeline/v1/timeline_pb2.py b/python-runtime/ftl/src/ftl/protos/xyz/block/ftl/timeline/v1/timeline_pb2.py index d9234d2d8..fb22a630b 100644 --- a/python-runtime/ftl/src/ftl/protos/xyz/block/ftl/timeline/v1/timeline_pb2.py +++ b/python-runtime/ftl/src/ftl/protos/xyz/block/ftl/timeline/v1/timeline_pb2.py @@ -26,7 +26,7 @@ from xyz.block.ftl.v1 import ftl_pb2 as xyz_dot_block_dot_ftl_dot_v1_dot_ftl__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n(xyz/block/ftl/timeline/v1/timeline.proto\x12\x19xyz.block.ftl.timeline.v1\x1a%xyz/block/ftl/timeline/v1/event.proto\x1a\x1axyz/block/ftl/v1/ftl.proto\"\xd4\x01\n\x12GetTimelineRequest\x12%\n\x0e\x64\x65ployment_key\x18\x01 \x01(\tR\rdeploymentKey\x12\x1e\n\x08since_id\x18\x02 \x01(\x03H\x00R\x07sinceId\x88\x01\x01\x12\x19\n\x05limit\x18\x03 \x01(\x05H\x01R\x05limit\x88\x01\x01\x12\x45\n\x0b\x65vent_types\x18\x04 \x03(\x0e\x32$.xyz.block.ftl.timeline.v1.EventTypeR\neventTypesB\x0b\n\t_since_idB\x08\n\x06_limit\"O\n\x13GetTimelineResponse\x12\x38\n\x06\x65vents\x18\x01 \x03(\x0b\x32 .xyz.block.ftl.timeline.v1.EventR\x06\x65vents\"~\n\x16\x44\x65leteOldEventsRequest\x12\x43\n\nevent_type\x18\x01 \x01(\x0e\x32$.xyz.block.ftl.timeline.v1.EventTypeR\teventType\x12\x1f\n\x0b\x61ge_seconds\x18\x02 \x01(\x03R\nageSeconds\">\n\x17\x44\x65leteOldEventsResponse\x12#\n\rdeleted_count\x18\x01 \x01(\x03R\x0c\x64\x65letedCount2\xcc\x02\n\x0fTimelineService\x12J\n\x04Ping\x12\x1d.xyz.block.ftl.v1.PingRequest\x1a\x1e.xyz.block.ftl.v1.PingResponse\"\x03\x90\x02\x01\x12q\n\x0bGetTimeline\x12-.xyz.block.ftl.timeline.v1.GetTimelineRequest\x1a..xyz.block.ftl.timeline.v1.GetTimelineResponse\"\x03\x90\x02\x01\x12z\n\x0f\x44\x65leteOldEvents\x12\x31.xyz.block.ftl.timeline.v1.DeleteOldEventsRequest\x1a\x32.xyz.block.ftl.timeline.v1.DeleteOldEventsResponse\"\x00\x42RP\x01ZNgithub.com/TBD54566975/ftl/backend/protos/xyz/block/ftl/timeline/v1;timelinev1b\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n(xyz/block/ftl/timeline/v1/timeline.proto\x12\x19xyz.block.ftl.timeline.v1\x1a%xyz/block/ftl/timeline/v1/event.proto\x1a\x1axyz/block/ftl/v1/ftl.proto\"\xd4\x01\n\x12GetTimelineRequest\x12%\n\x0e\x64\x65ployment_key\x18\x01 \x01(\tR\rdeploymentKey\x12\x1e\n\x08since_id\x18\x02 \x01(\x03H\x00R\x07sinceId\x88\x01\x01\x12\x19\n\x05limit\x18\x03 \x01(\x05H\x01R\x05limit\x88\x01\x01\x12\x45\n\x0b\x65vent_types\x18\x04 \x03(\x0e\x32$.xyz.block.ftl.timeline.v1.EventTypeR\neventTypesB\x0b\n\t_since_idB\x08\n\x06_limit\"O\n\x13GetTimelineResponse\x12\x38\n\x06\x65vents\x18\x01 \x03(\x0b\x32 .xyz.block.ftl.timeline.v1.EventR\x06\x65vents\"\xfc\x05\n\x12\x43reateEventRequest\x12\x37\n\x03log\x18\x01 \x01(\x0b\x32#.xyz.block.ftl.timeline.v1.LogEventH\x00R\x03log\x12:\n\x04\x63\x61ll\x18\x02 \x01(\x0b\x32$.xyz.block.ftl.timeline.v1.CallEventH\x00R\x04\x63\x61ll\x12\x62\n\x12\x64\x65ployment_created\x18\x03 \x01(\x0b\x32\x31.xyz.block.ftl.timeline.v1.DeploymentCreatedEventH\x00R\x11\x64\x65ploymentCreated\x12\x62\n\x12\x64\x65ployment_updated\x18\x04 \x01(\x0b\x32\x31.xyz.block.ftl.timeline.v1.DeploymentUpdatedEventH\x00R\x11\x64\x65ploymentUpdated\x12\x43\n\x07ingress\x18\x05 \x01(\x0b\x32\'.xyz.block.ftl.timeline.v1.IngressEventH\x00R\x07ingress\x12V\n\x0e\x63ron_scheduled\x18\x06 \x01(\x0b\x32-.xyz.block.ftl.timeline.v1.CronScheduledEventH\x00R\rcronScheduled\x12S\n\rasync_execute\x18\x07 \x01(\x0b\x32,.xyz.block.ftl.timeline.v1.AsyncExecuteEventH\x00R\x0c\x61syncExecute\x12V\n\x0epubsub_publish\x18\x08 \x01(\x0b\x32-.xyz.block.ftl.timeline.v1.PubSubPublishEventH\x00R\rpubsubPublish\x12V\n\x0epubsub_consume\x18\t \x01(\x0b\x32-.xyz.block.ftl.timeline.v1.PubSubConsumeEventH\x00R\rpubsubConsumeB\x07\n\x05\x65ntry\"\x15\n\x13\x43reateEventResponse\"~\n\x16\x44\x65leteOldEventsRequest\x12\x43\n\nevent_type\x18\x01 \x01(\x0e\x32$.xyz.block.ftl.timeline.v1.EventTypeR\teventType\x12\x1f\n\x0b\x61ge_seconds\x18\x02 \x01(\x03R\nageSeconds\">\n\x17\x44\x65leteOldEventsResponse\x12#\n\rdeleted_count\x18\x01 \x01(\x03R\x0c\x64\x65letedCount2\xbc\x03\n\x0fTimelineService\x12J\n\x04Ping\x12\x1d.xyz.block.ftl.v1.PingRequest\x1a\x1e.xyz.block.ftl.v1.PingResponse\"\x03\x90\x02\x01\x12q\n\x0bGetTimeline\x12-.xyz.block.ftl.timeline.v1.GetTimelineRequest\x1a..xyz.block.ftl.timeline.v1.GetTimelineResponse\"\x03\x90\x02\x01\x12n\n\x0b\x43reateEvent\x12-.xyz.block.ftl.timeline.v1.CreateEventRequest\x1a..xyz.block.ftl.timeline.v1.CreateEventResponse\"\x00\x12z\n\x0f\x44\x65leteOldEvents\x12\x31.xyz.block.ftl.timeline.v1.DeleteOldEventsRequest\x1a\x32.xyz.block.ftl.timeline.v1.DeleteOldEventsResponse\"\x00\x42RP\x01ZNgithub.com/TBD54566975/ftl/backend/protos/xyz/block/ftl/timeline/v1;timelinev1b\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) @@ -42,10 +42,14 @@ _globals['_GETTIMELINEREQUEST']._serialized_end=351 _globals['_GETTIMELINERESPONSE']._serialized_start=353 _globals['_GETTIMELINERESPONSE']._serialized_end=432 - _globals['_DELETEOLDEVENTSREQUEST']._serialized_start=434 - _globals['_DELETEOLDEVENTSREQUEST']._serialized_end=560 - _globals['_DELETEOLDEVENTSRESPONSE']._serialized_start=562 - _globals['_DELETEOLDEVENTSRESPONSE']._serialized_end=624 - _globals['_TIMELINESERVICE']._serialized_start=627 - _globals['_TIMELINESERVICE']._serialized_end=959 + _globals['_CREATEEVENTREQUEST']._serialized_start=435 + _globals['_CREATEEVENTREQUEST']._serialized_end=1199 + _globals['_CREATEEVENTRESPONSE']._serialized_start=1201 + _globals['_CREATEEVENTRESPONSE']._serialized_end=1222 + _globals['_DELETEOLDEVENTSREQUEST']._serialized_start=1224 + _globals['_DELETEOLDEVENTSREQUEST']._serialized_end=1350 + _globals['_DELETEOLDEVENTSRESPONSE']._serialized_start=1352 + _globals['_DELETEOLDEVENTSRESPONSE']._serialized_end=1414 + _globals['_TIMELINESERVICE']._serialized_start=1417 + _globals['_TIMELINESERVICE']._serialized_end=1861 # @@protoc_insertion_point(module_scope) diff --git a/python-runtime/ftl/src/ftl/protos/xyz/block/ftl/timeline/v1/timeline_pb2.pyi b/python-runtime/ftl/src/ftl/protos/xyz/block/ftl/timeline/v1/timeline_pb2.pyi index 053f6774a..4f24d12d8 100644 --- a/python-runtime/ftl/src/ftl/protos/xyz/block/ftl/timeline/v1/timeline_pb2.pyi +++ b/python-runtime/ftl/src/ftl/protos/xyz/block/ftl/timeline/v1/timeline_pb2.pyi @@ -25,6 +25,32 @@ class GetTimelineResponse(_message.Message): events: _containers.RepeatedCompositeFieldContainer[_event_pb2.Event] def __init__(self, events: _Optional[_Iterable[_Union[_event_pb2.Event, _Mapping]]] = ...) -> None: ... +class CreateEventRequest(_message.Message): + __slots__ = ("log", "call", "deployment_created", "deployment_updated", "ingress", "cron_scheduled", "async_execute", "pubsub_publish", "pubsub_consume") + LOG_FIELD_NUMBER: _ClassVar[int] + CALL_FIELD_NUMBER: _ClassVar[int] + DEPLOYMENT_CREATED_FIELD_NUMBER: _ClassVar[int] + DEPLOYMENT_UPDATED_FIELD_NUMBER: _ClassVar[int] + INGRESS_FIELD_NUMBER: _ClassVar[int] + CRON_SCHEDULED_FIELD_NUMBER: _ClassVar[int] + ASYNC_EXECUTE_FIELD_NUMBER: _ClassVar[int] + PUBSUB_PUBLISH_FIELD_NUMBER: _ClassVar[int] + PUBSUB_CONSUME_FIELD_NUMBER: _ClassVar[int] + log: _event_pb2.LogEvent + call: _event_pb2.CallEvent + deployment_created: _event_pb2.DeploymentCreatedEvent + deployment_updated: _event_pb2.DeploymentUpdatedEvent + ingress: _event_pb2.IngressEvent + cron_scheduled: _event_pb2.CronScheduledEvent + async_execute: _event_pb2.AsyncExecuteEvent + pubsub_publish: _event_pb2.PubSubPublishEvent + pubsub_consume: _event_pb2.PubSubConsumeEvent + def __init__(self, log: _Optional[_Union[_event_pb2.LogEvent, _Mapping]] = ..., call: _Optional[_Union[_event_pb2.CallEvent, _Mapping]] = ..., deployment_created: _Optional[_Union[_event_pb2.DeploymentCreatedEvent, _Mapping]] = ..., deployment_updated: _Optional[_Union[_event_pb2.DeploymentUpdatedEvent, _Mapping]] = ..., ingress: _Optional[_Union[_event_pb2.IngressEvent, _Mapping]] = ..., cron_scheduled: _Optional[_Union[_event_pb2.CronScheduledEvent, _Mapping]] = ..., async_execute: _Optional[_Union[_event_pb2.AsyncExecuteEvent, _Mapping]] = ..., pubsub_publish: _Optional[_Union[_event_pb2.PubSubPublishEvent, _Mapping]] = ..., pubsub_consume: _Optional[_Union[_event_pb2.PubSubConsumeEvent, _Mapping]] = ...) -> None: ... + +class CreateEventResponse(_message.Message): + __slots__ = () + def __init__(self) -> None: ... + class DeleteOldEventsRequest(_message.Message): __slots__ = ("event_type", "age_seconds") EVENT_TYPE_FIELD_NUMBER: _ClassVar[int]