diff --git a/common/protos/common.pb.go b/common/protos/common.pb.go index da2413f6..ae8595b4 100644 --- a/common/protos/common.pb.go +++ b/common/protos/common.pb.go @@ -24,7 +24,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.31.0 -// protoc v4.25.3 +// protoc v5.26.1 // source: protos/common.proto package pb @@ -117,7 +117,8 @@ type WorkflowTemplateInfo struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` Path string `protobuf:"bytes,3,opt,name=path,proto3" json:"path,omitempty"` - Public bool `protobuf:"varint,4,opt,name=public,proto3" json:"public,omitempty"` // whether the environment is public or not + Public bool `protobuf:"varint,4,opt,name=public,proto3" json:"public,omitempty"` // whether the environment is public or not + Bookkept bool `protobuf:"varint,5,opt,name=bookkept,proto3" json:"bookkept,omitempty"` // whether the runs should be logged in bookkeeping } func (x *WorkflowTemplateInfo) Reset() { @@ -180,6 +181,13 @@ func (x *WorkflowTemplateInfo) GetPublic() bool { return false } +func (x *WorkflowTemplateInfo) GetBookkept() bool { + if x != nil { + return x.Bookkept + } + return false +} + var File_protos_common_proto protoreflect.FileDescriptor var file_protos_common_proto_rawDesc = []byte{ @@ -191,20 +199,22 @@ var file_protos_common_proto_rawDesc = []byte{ 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x48, 0x01, 0x52, 0x02, 0x69, 0x64, 0x88, 0x01, 0x01, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, - 0x49, 0x64, 0x42, 0x05, 0x0a, 0x03, 0x5f, 0x69, 0x64, 0x22, 0x78, 0x0a, 0x14, 0x57, 0x6f, 0x72, - 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x66, - 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x16, 0x0a, 0x06, 0x70, - 0x75, 0x62, 0x6c, 0x69, 0x63, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x70, 0x75, 0x62, - 0x6c, 0x69, 0x63, 0x42, 0x53, 0x0a, 0x1f, 0x63, 0x68, 0x2e, 0x63, 0x65, 0x72, 0x6e, 0x2e, 0x61, - 0x6c, 0x69, 0x63, 0x65, 0x2e, 0x6f, 0x32, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, - 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x41, 0x6c, 0x69, 0x63, 0x65, 0x4f, 0x32, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x2f, - 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x49, 0x64, 0x42, 0x05, 0x0a, 0x03, 0x5f, 0x69, 0x64, 0x22, 0x94, 0x01, 0x0a, 0x14, 0x57, 0x6f, + 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x49, 0x6e, + 0x66, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x16, 0x0a, 0x06, + 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x70, 0x75, + 0x62, 0x6c, 0x69, 0x63, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x6f, 0x6f, 0x6b, 0x6b, 0x65, 0x70, 0x74, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x62, 0x6f, 0x6f, 0x6b, 0x6b, 0x65, 0x70, 0x74, + 0x42, 0x53, 0x0a, 0x1f, 0x63, 0x68, 0x2e, 0x63, 0x65, 0x72, 0x6e, 0x2e, 0x61, 0x6c, 0x69, 0x63, + 0x65, 0x2e, 0x6f, 0x32, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x63, 0x6f, 0x6d, + 0x6d, 0x6f, 0x6e, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x41, 0x6c, 0x69, 0x63, 0x65, 0x4f, 0x32, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x2f, 0x43, 0x6f, 0x6e, + 0x74, 0x72, 0x6f, 0x6c, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x73, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/common/protos/common.proto b/common/protos/common.proto index 435790e4..ada0c8a3 100644 --- a/common/protos/common.proto +++ b/common/protos/common.proto @@ -45,4 +45,5 @@ message WorkflowTemplateInfo { string description = 2; string path = 3; bool public = 4; // whether the environment is public or not + bool bookkept = 5; // whether the runs should be logged in bookkeeping } \ No newline at end of file diff --git a/common/protos/events.pb.go b/common/protos/events.pb.go index a3654453..21b94290 100644 --- a/common/protos/events.pb.go +++ b/common/protos/events.pb.go @@ -24,7 +24,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.31.0 -// protoc v4.25.3 +// protoc v5.26.1 // source: protos/events.proto package pb diff --git a/core/environment/environment.go b/core/environment/environment.go index ddf5b56b..8228e295 100644 --- a/core/environment/environment.go +++ b/core/environment/environment.go @@ -85,6 +85,7 @@ type Environment struct { Public bool // From workflow or user Description string // From workflow WorkflowPath string // From workflow load + Bookkept bool // From workflow or user callsPendingAwait map[string] /*await expression, trigger only*/ callable.CallsMap currentTransition string @@ -1409,6 +1410,7 @@ func (env *Environment) GetWorkflowInfo() *pb.WorkflowTemplateInfo { Description: env.Description, Path: env.WorkflowPath, Public: env.Public, + Bookkept: env.Bookkept, } return out } diff --git a/core/environment/manager.go b/core/environment/manager.go index 77eff8e3..6b9bc8dd 100644 --- a/core/environment/manager.go +++ b/core/environment/manager.go @@ -253,6 +253,7 @@ func (envs *Manager) CreateEnvironment(workflowPath string, userVars map[string] Public: workflowPublicInfo.IsPublic, Name: workflowPublicInfo.Name, Description: workflowPublicInfo.Description, + Bookkept: workflowPublicInfo.IsBookkept, }, }) @@ -332,6 +333,7 @@ func (envs *Manager) CreateEnvironment(workflowPath string, userVars map[string] env.name = workflowPublicInfo.Name env.Description = workflowPublicInfo.Description env.WorkflowPath = workflowPath + env.Bookkept = workflowPublicInfo.IsBookkept the.EventWriterWithTopic(topic.Environment).WriteEvent(&evpb.Ev_EnvironmentEvent{ EnvironmentId: newId.String(), @@ -1210,6 +1212,7 @@ func (envs *Manager) CreateAutoEnvironment(workflowPath string, userVars map[str Public: workflowPublicInfo.IsPublic, Name: workflowPublicInfo.Name, Description: workflowPublicInfo.Description, + Bookkept: workflowPublicInfo.IsBookkept, }, }) @@ -1232,6 +1235,7 @@ func (envs *Manager) CreateAutoEnvironment(workflowPath string, userVars map[str env.name = workflowPublicInfo.Name env.Description = workflowPublicInfo.Description env.WorkflowPath = workflowPath + env.Bookkept = workflowPublicInfo.IsBookkept the.EventWriterWithTopic(topic.Environment).WriteEvent(&evpb.Ev_EnvironmentEvent{ EnvironmentId: newId.String(), diff --git a/core/environment/utils.go b/core/environment/utils.go index 3270f24c..461aac80 100644 --- a/core/environment/utils.go +++ b/core/environment/utils.go @@ -39,6 +39,7 @@ type WorkflowPublicInfo struct { IsPublic bool Name string Description string + IsBookkept bool } func parseWorkflowPublicInfo(workflowExpr string) (WorkflowPublicInfo, error) { @@ -67,8 +68,12 @@ func parseWorkflowPublicInfo(workflowExpr string) (WorkflowPublicInfo, error) { if nodes["description"].Tag == "!public" { description = nodes["description"].Value } + bookkept := false + if nodes["bookkept"].Tag == "!public" { + bookkept = nodes["bookkept"].Value == "true" + } - return WorkflowPublicInfo{IsPublic: isPublic, Name: name, Description: description}, nil + return WorkflowPublicInfo{IsPublic: isPublic, Name: name, Description: description, IsBookkept: bookkept}, nil } func JSONSliceToSlice(payload string) (slice []string, err error) {