diff --git a/internal/api/runme/runner/v1/runner.proto b/internal/api/runme/runner/v1/runner.proto index 4892023ec..d353aeb34 100644 --- a/internal/api/runme/runner/v1/runner.proto +++ b/internal/api/runme/runner/v1/runner.proto @@ -320,6 +320,14 @@ message MonitorEnvStoreResponseSnapshot { string create_time = 7; string update_time = 8; + + repeated Error errors = 9; + } + + message Error { + uint32 code = 1; + + string message = 2; } enum Status { diff --git a/internal/gen/proto/go/runme/runner/v1/runner.pb.go b/internal/gen/proto/go/runme/runner/v1/runner.pb.go index 9372e33da..1fddc5b2a 100644 --- a/internal/gen/proto/go/runme/runner/v1/runner.pb.go +++ b/internal/gen/proto/go/runme/runner/v1/runner.pb.go @@ -1861,14 +1861,15 @@ type MonitorEnvStoreResponseSnapshot_SnapshotEnv struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Status MonitorEnvStoreResponseSnapshot_Status `protobuf:"varint,1,opt,name=status,proto3,enum=runme.runner.v1.MonitorEnvStoreResponseSnapshot_Status" json:"status,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Spec string `protobuf:"bytes,3,opt,name=spec,proto3" json:"spec,omitempty"` - Origin string `protobuf:"bytes,4,opt,name=origin,proto3" json:"origin,omitempty"` - OriginalValue string `protobuf:"bytes,5,opt,name=original_value,json=originalValue,proto3" json:"original_value,omitempty"` - ResolvedValue string `protobuf:"bytes,6,opt,name=resolved_value,json=resolvedValue,proto3" json:"resolved_value,omitempty"` - CreateTime string `protobuf:"bytes,7,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` - UpdateTime string `protobuf:"bytes,8,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"` + Status MonitorEnvStoreResponseSnapshot_Status `protobuf:"varint,1,opt,name=status,proto3,enum=runme.runner.v1.MonitorEnvStoreResponseSnapshot_Status" json:"status,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Spec string `protobuf:"bytes,3,opt,name=spec,proto3" json:"spec,omitempty"` + Origin string `protobuf:"bytes,4,opt,name=origin,proto3" json:"origin,omitempty"` + OriginalValue string `protobuf:"bytes,5,opt,name=original_value,json=originalValue,proto3" json:"original_value,omitempty"` + ResolvedValue string `protobuf:"bytes,6,opt,name=resolved_value,json=resolvedValue,proto3" json:"resolved_value,omitempty"` + CreateTime string `protobuf:"bytes,7,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"` + UpdateTime string `protobuf:"bytes,8,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"` + Errors []*MonitorEnvStoreResponseSnapshot_Error `protobuf:"bytes,9,rep,name=errors,proto3" json:"errors,omitempty"` } func (x *MonitorEnvStoreResponseSnapshot_SnapshotEnv) Reset() { @@ -1959,6 +1960,68 @@ func (x *MonitorEnvStoreResponseSnapshot_SnapshotEnv) GetUpdateTime() string { return "" } +func (x *MonitorEnvStoreResponseSnapshot_SnapshotEnv) GetErrors() []*MonitorEnvStoreResponseSnapshot_Error { + if x != nil { + return x.Errors + } + return nil +} + +type MonitorEnvStoreResponseSnapshot_Error struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Code uint32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` + Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` +} + +func (x *MonitorEnvStoreResponseSnapshot_Error) Reset() { + *x = MonitorEnvStoreResponseSnapshot_Error{} + if protoimpl.UnsafeEnabled { + mi := &file_runme_runner_v1_runner_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MonitorEnvStoreResponseSnapshot_Error) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MonitorEnvStoreResponseSnapshot_Error) ProtoMessage() {} + +func (x *MonitorEnvStoreResponseSnapshot_Error) ProtoReflect() protoreflect.Message { + mi := &file_runme_runner_v1_runner_proto_msgTypes[24] + 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 MonitorEnvStoreResponseSnapshot_Error.ProtoReflect.Descriptor instead. +func (*MonitorEnvStoreResponseSnapshot_Error) Descriptor() ([]byte, []int) { + return file_runme_runner_v1_runner_proto_rawDescGZIP(), []int{18, 1} +} + +func (x *MonitorEnvStoreResponseSnapshot_Error) GetCode() uint32 { + if x != nil { + return x.Code + } + return 0 +} + +func (x *MonitorEnvStoreResponseSnapshot_Error) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + var File_runme_runner_v1_runner_proto protoreflect.FileDescriptor var file_runme_runner_v1_runner_proto_rawDesc = []byte{ @@ -2159,7 +2222,7 @@ var file_runme_runner_v1_runner_proto_rawDesc = []byte{ 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x32, 0x0a, 0x07, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x72, 0x75, 0x6e, 0x6d, 0x65, 0x2e, 0x72, 0x75, 0x6e, 0x6e, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x73, 0x73, 0x69, - 0x6f, 0x6e, 0x52, 0x07, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x80, 0x04, 0x0a, 0x1f, + 0x6f, 0x6e, 0x52, 0x07, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x87, 0x05, 0x0a, 0x1f, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x45, 0x6e, 0x76, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x12, 0x50, 0x0a, 0x04, 0x65, 0x6e, 0x76, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3c, 0x2e, @@ -2167,7 +2230,7 @@ var file_runme_runner_v1_runner_proto_rawDesc = []byte{ 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x45, 0x6e, 0x76, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x2e, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x45, 0x6e, 0x76, 0x52, 0x04, 0x65, 0x6e, 0x76, - 0x73, 0x1a, 0xae, 0x02, 0x0a, 0x0b, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x45, 0x6e, + 0x73, 0x1a, 0xfe, 0x02, 0x0a, 0x0b, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x45, 0x6e, 0x76, 0x12, 0x4f, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x37, 0x2e, 0x72, 0x75, 0x6e, 0x6d, 0x65, 0x2e, 0x72, 0x75, 0x6e, 0x6e, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x45, 0x6e, 0x76, 0x53, 0x74, @@ -2186,102 +2249,110 @@ var file_runme_runner_v1_runner_proto_rawDesc = []byte{ 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x54, 0x69, - 0x6d, 0x65, 0x22, 0x5a, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, 0x0a, 0x12, - 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, - 0x45, 0x44, 0x10, 0x00, 0x12, 0x12, 0x0a, 0x0e, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x4c, - 0x49, 0x54, 0x45, 0x52, 0x41, 0x4c, 0x10, 0x01, 0x12, 0x11, 0x0a, 0x0d, 0x53, 0x54, 0x41, 0x54, - 0x55, 0x53, 0x5f, 0x48, 0x49, 0x44, 0x44, 0x45, 0x4e, 0x10, 0x02, 0x12, 0x11, 0x0a, 0x0d, 0x53, - 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x4d, 0x41, 0x53, 0x4b, 0x45, 0x44, 0x10, 0x03, 0x22, 0xab, - 0x01, 0x0a, 0x17, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x45, 0x6e, 0x76, 0x53, 0x74, 0x6f, - 0x72, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x38, 0x0a, 0x04, 0x74, 0x79, - 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x72, 0x75, 0x6e, 0x6d, 0x65, - 0x2e, 0x72, 0x75, 0x6e, 0x6e, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x6f, 0x6e, 0x69, 0x74, - 0x6f, 0x72, 0x45, 0x6e, 0x76, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, - 0x74, 0x79, 0x70, 0x65, 0x12, 0x4e, 0x0a, 0x08, 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x72, 0x75, 0x6e, 0x6d, 0x65, 0x2e, 0x72, - 0x75, 0x6e, 0x6e, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, - 0x45, 0x6e, 0x76, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x48, 0x00, 0x52, 0x08, 0x73, 0x6e, 0x61, 0x70, - 0x73, 0x68, 0x6f, 0x74, 0x42, 0x06, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x2a, 0x5d, 0x0a, 0x13, - 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x76, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x54, - 0x79, 0x70, 0x65, 0x12, 0x26, 0x0a, 0x22, 0x53, 0x45, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x45, - 0x4e, 0x56, 0x5f, 0x53, 0x54, 0x4f, 0x52, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, - 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1e, 0x0a, 0x1a, 0x53, - 0x45, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x45, 0x4e, 0x56, 0x5f, 0x53, 0x54, 0x4f, 0x52, 0x45, - 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4f, 0x57, 0x4c, 0x10, 0x01, 0x2a, 0x5e, 0x0a, 0x0b, 0x45, - 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x53, 0x74, 0x6f, 0x70, 0x12, 0x1c, 0x0a, 0x18, 0x45, 0x58, - 0x45, 0x43, 0x55, 0x54, 0x45, 0x5f, 0x53, 0x54, 0x4f, 0x50, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, - 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1a, 0x0a, 0x16, 0x45, 0x58, 0x45, 0x43, - 0x55, 0x54, 0x45, 0x5f, 0x53, 0x54, 0x4f, 0x50, 0x5f, 0x49, 0x4e, 0x54, 0x45, 0x52, 0x52, 0x55, - 0x50, 0x54, 0x10, 0x01, 0x12, 0x15, 0x0a, 0x11, 0x45, 0x58, 0x45, 0x43, 0x55, 0x54, 0x45, 0x5f, - 0x53, 0x54, 0x4f, 0x50, 0x5f, 0x4b, 0x49, 0x4c, 0x4c, 0x10, 0x02, 0x2a, 0x66, 0x0a, 0x0b, 0x43, - 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x1c, 0x0a, 0x18, 0x43, 0x4f, - 0x4d, 0x4d, 0x41, 0x4e, 0x44, 0x5f, 0x4d, 0x4f, 0x44, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, - 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1d, 0x0a, 0x19, 0x43, 0x4f, 0x4d, 0x4d, - 0x41, 0x4e, 0x44, 0x5f, 0x4d, 0x4f, 0x44, 0x45, 0x5f, 0x49, 0x4e, 0x4c, 0x49, 0x4e, 0x45, 0x5f, - 0x53, 0x48, 0x45, 0x4c, 0x4c, 0x10, 0x01, 0x12, 0x1a, 0x0a, 0x16, 0x43, 0x4f, 0x4d, 0x4d, 0x41, - 0x4e, 0x44, 0x5f, 0x4d, 0x4f, 0x44, 0x45, 0x5f, 0x54, 0x45, 0x4d, 0x50, 0x5f, 0x46, 0x49, 0x4c, - 0x45, 0x10, 0x02, 0x2a, 0x55, 0x0a, 0x0f, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x53, 0x74, - 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x12, 0x20, 0x0a, 0x1c, 0x53, 0x45, 0x53, 0x53, 0x49, 0x4f, - 0x4e, 0x5f, 0x53, 0x54, 0x52, 0x41, 0x54, 0x45, 0x47, 0x59, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, - 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x20, 0x0a, 0x1c, 0x53, 0x45, 0x53, 0x53, - 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x54, 0x52, 0x41, 0x54, 0x45, 0x47, 0x59, 0x5f, 0x4d, 0x4f, 0x53, - 0x54, 0x5f, 0x52, 0x45, 0x43, 0x45, 0x4e, 0x54, 0x10, 0x01, 0x2a, 0x62, 0x0a, 0x13, 0x4d, 0x6f, - 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x45, 0x6e, 0x76, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x54, 0x79, 0x70, - 0x65, 0x12, 0x26, 0x0a, 0x22, 0x4d, 0x4f, 0x4e, 0x49, 0x54, 0x4f, 0x52, 0x5f, 0x45, 0x4e, 0x56, - 0x5f, 0x53, 0x54, 0x4f, 0x52, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, - 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x23, 0x0a, 0x1f, 0x4d, 0x4f, 0x4e, - 0x49, 0x54, 0x4f, 0x52, 0x5f, 0x45, 0x4e, 0x56, 0x5f, 0x53, 0x54, 0x4f, 0x52, 0x45, 0x5f, 0x54, - 0x59, 0x50, 0x45, 0x5f, 0x53, 0x4e, 0x41, 0x50, 0x53, 0x48, 0x4f, 0x54, 0x10, 0x01, 0x32, 0xae, - 0x05, 0x0a, 0x0d, 0x52, 0x75, 0x6e, 0x6e, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x12, 0x60, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, - 0x6e, 0x12, 0x25, 0x2e, 0x72, 0x75, 0x6e, 0x6d, 0x65, 0x2e, 0x72, 0x75, 0x6e, 0x6e, 0x65, 0x72, - 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, - 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x72, 0x75, 0x6e, 0x6d, 0x65, + 0x6d, 0x65, 0x12, 0x4e, 0x0a, 0x06, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x18, 0x09, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x36, 0x2e, 0x72, 0x75, 0x6e, 0x6d, 0x65, 0x2e, 0x72, 0x75, 0x6e, 0x6e, 0x65, + 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x45, 0x6e, 0x76, 0x53, + 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x53, 0x6e, 0x61, 0x70, + 0x73, 0x68, 0x6f, 0x74, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x06, 0x65, 0x72, 0x72, 0x6f, + 0x72, 0x73, 0x1a, 0x35, 0x0a, 0x05, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x63, + 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, + 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x5a, 0x0a, 0x06, 0x53, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x12, 0x16, 0x0a, 0x12, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, + 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x12, 0x0a, 0x0e, 0x53, + 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x4c, 0x49, 0x54, 0x45, 0x52, 0x41, 0x4c, 0x10, 0x01, 0x12, + 0x11, 0x0a, 0x0d, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x48, 0x49, 0x44, 0x44, 0x45, 0x4e, + 0x10, 0x02, 0x12, 0x11, 0x0a, 0x0d, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x4d, 0x41, 0x53, + 0x4b, 0x45, 0x44, 0x10, 0x03, 0x22, 0xab, 0x01, 0x0a, 0x17, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, + 0x72, 0x45, 0x6e, 0x76, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x38, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, + 0x24, 0x2e, 0x72, 0x75, 0x6e, 0x6d, 0x65, 0x2e, 0x72, 0x75, 0x6e, 0x6e, 0x65, 0x72, 0x2e, 0x76, + 0x31, 0x2e, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x45, 0x6e, 0x76, 0x53, 0x74, 0x6f, 0x72, + 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x4e, 0x0a, 0x08, 0x73, + 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30, 0x2e, + 0x72, 0x75, 0x6e, 0x6d, 0x65, 0x2e, 0x72, 0x75, 0x6e, 0x6e, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, + 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x45, 0x6e, 0x76, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x48, + 0x00, 0x52, 0x08, 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x42, 0x06, 0x0a, 0x04, 0x64, + 0x61, 0x74, 0x61, 0x2a, 0x5d, 0x0a, 0x13, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x45, 0x6e, + 0x76, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x26, 0x0a, 0x22, 0x53, 0x45, + 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x45, 0x4e, 0x56, 0x5f, 0x53, 0x54, 0x4f, 0x52, 0x45, 0x5f, + 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, + 0x10, 0x00, 0x12, 0x1e, 0x0a, 0x1a, 0x53, 0x45, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x45, 0x4e, + 0x56, 0x5f, 0x53, 0x54, 0x4f, 0x52, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4f, 0x57, 0x4c, + 0x10, 0x01, 0x2a, 0x5e, 0x0a, 0x0b, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x53, 0x74, 0x6f, + 0x70, 0x12, 0x1c, 0x0a, 0x18, 0x45, 0x58, 0x45, 0x43, 0x55, 0x54, 0x45, 0x5f, 0x53, 0x54, 0x4f, + 0x50, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, + 0x1a, 0x0a, 0x16, 0x45, 0x58, 0x45, 0x43, 0x55, 0x54, 0x45, 0x5f, 0x53, 0x54, 0x4f, 0x50, 0x5f, + 0x49, 0x4e, 0x54, 0x45, 0x52, 0x52, 0x55, 0x50, 0x54, 0x10, 0x01, 0x12, 0x15, 0x0a, 0x11, 0x45, + 0x58, 0x45, 0x43, 0x55, 0x54, 0x45, 0x5f, 0x53, 0x54, 0x4f, 0x50, 0x5f, 0x4b, 0x49, 0x4c, 0x4c, + 0x10, 0x02, 0x2a, 0x66, 0x0a, 0x0b, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x4d, 0x6f, 0x64, + 0x65, 0x12, 0x1c, 0x0a, 0x18, 0x43, 0x4f, 0x4d, 0x4d, 0x41, 0x4e, 0x44, 0x5f, 0x4d, 0x4f, 0x44, + 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, + 0x1d, 0x0a, 0x19, 0x43, 0x4f, 0x4d, 0x4d, 0x41, 0x4e, 0x44, 0x5f, 0x4d, 0x4f, 0x44, 0x45, 0x5f, + 0x49, 0x4e, 0x4c, 0x49, 0x4e, 0x45, 0x5f, 0x53, 0x48, 0x45, 0x4c, 0x4c, 0x10, 0x01, 0x12, 0x1a, + 0x0a, 0x16, 0x43, 0x4f, 0x4d, 0x4d, 0x41, 0x4e, 0x44, 0x5f, 0x4d, 0x4f, 0x44, 0x45, 0x5f, 0x54, + 0x45, 0x4d, 0x50, 0x5f, 0x46, 0x49, 0x4c, 0x45, 0x10, 0x02, 0x2a, 0x55, 0x0a, 0x0f, 0x53, 0x65, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x12, 0x20, 0x0a, + 0x1c, 0x53, 0x45, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x54, 0x52, 0x41, 0x54, 0x45, 0x47, + 0x59, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, + 0x20, 0x0a, 0x1c, 0x53, 0x45, 0x53, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x54, 0x52, 0x41, 0x54, + 0x45, 0x47, 0x59, 0x5f, 0x4d, 0x4f, 0x53, 0x54, 0x5f, 0x52, 0x45, 0x43, 0x45, 0x4e, 0x54, 0x10, + 0x01, 0x2a, 0x62, 0x0a, 0x13, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x45, 0x6e, 0x76, 0x53, + 0x74, 0x6f, 0x72, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x26, 0x0a, 0x22, 0x4d, 0x4f, 0x4e, 0x49, + 0x54, 0x4f, 0x52, 0x5f, 0x45, 0x4e, 0x56, 0x5f, 0x53, 0x54, 0x4f, 0x52, 0x45, 0x5f, 0x54, 0x59, + 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, + 0x12, 0x23, 0x0a, 0x1f, 0x4d, 0x4f, 0x4e, 0x49, 0x54, 0x4f, 0x52, 0x5f, 0x45, 0x4e, 0x56, 0x5f, + 0x53, 0x54, 0x4f, 0x52, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x4e, 0x41, 0x50, 0x53, + 0x48, 0x4f, 0x54, 0x10, 0x01, 0x32, 0xae, 0x05, 0x0a, 0x0d, 0x52, 0x75, 0x6e, 0x6e, 0x65, 0x72, + 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x60, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x25, 0x2e, 0x72, 0x75, 0x6e, 0x6d, 0x65, 0x2e, 0x72, 0x75, 0x6e, 0x6e, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x00, 0x12, 0x57, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, - 0x12, 0x22, 0x2e, 0x72, 0x75, 0x6e, 0x6d, 0x65, 0x2e, 0x72, 0x75, 0x6e, 0x6e, 0x65, 0x72, 0x2e, - 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x72, 0x75, 0x6e, 0x6d, 0x65, 0x2e, 0x72, 0x75, 0x6e, - 0x6e, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, - 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5d, 0x0a, 0x0c, 0x4c, - 0x69, 0x73, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x24, 0x2e, 0x72, 0x75, - 0x6e, 0x6d, 0x65, 0x2e, 0x72, 0x75, 0x6e, 0x6e, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, - 0x73, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x25, 0x2e, 0x72, 0x75, 0x6e, 0x6d, 0x65, 0x2e, 0x72, 0x75, 0x6e, 0x6e, 0x65, 0x72, - 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x60, 0x0a, 0x0d, 0x44, 0x65, - 0x6c, 0x65, 0x74, 0x65, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x25, 0x2e, 0x72, 0x75, - 0x6e, 0x6d, 0x65, 0x2e, 0x72, 0x75, 0x6e, 0x6e, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, - 0x6c, 0x65, 0x74, 0x65, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x72, 0x75, 0x6e, 0x6d, 0x65, 0x2e, 0x72, 0x75, 0x6e, 0x6e, 0x65, + 0x65, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x26, 0x2e, 0x72, 0x75, 0x6e, 0x6d, 0x65, 0x2e, 0x72, 0x75, 0x6e, 0x6e, 0x65, 0x72, 0x2e, 0x76, + 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x57, 0x0a, 0x0a, 0x47, 0x65, 0x74, + 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x22, 0x2e, 0x72, 0x75, 0x6e, 0x6d, 0x65, 0x2e, + 0x72, 0x75, 0x6e, 0x6e, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x65, 0x73, + 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x72, 0x75, + 0x6e, 0x6d, 0x65, 0x2e, 0x72, 0x75, 0x6e, 0x6e, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, + 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x00, 0x12, 0x5d, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x73, 0x12, 0x24, 0x2e, 0x72, 0x75, 0x6e, 0x6d, 0x65, 0x2e, 0x72, 0x75, 0x6e, 0x6e, 0x65, + 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x72, 0x75, 0x6e, 0x6d, 0x65, + 0x2e, 0x72, 0x75, 0x6e, 0x6e, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x53, + 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x00, 0x12, 0x60, 0x0a, 0x0d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x65, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x12, 0x25, 0x2e, 0x72, 0x75, 0x6e, 0x6d, 0x65, 0x2e, 0x72, 0x75, 0x6e, 0x6e, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x65, 0x73, 0x73, 0x69, - 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x68, 0x0a, 0x0f, - 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x45, 0x6e, 0x76, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x12, - 0x27, 0x2e, 0x72, 0x75, 0x6e, 0x6d, 0x65, 0x2e, 0x72, 0x75, 0x6e, 0x6e, 0x65, 0x72, 0x2e, 0x76, + 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x72, 0x75, 0x6e, 0x6d, + 0x65, 0x2e, 0x72, 0x75, 0x6e, 0x6e, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, + 0x74, 0x65, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x00, 0x12, 0x68, 0x0a, 0x0f, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x45, 0x6e, + 0x76, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x12, 0x27, 0x2e, 0x72, 0x75, 0x6e, 0x6d, 0x65, 0x2e, 0x72, + 0x75, 0x6e, 0x6e, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, + 0x45, 0x6e, 0x76, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x28, 0x2e, 0x72, 0x75, 0x6e, 0x6d, 0x65, 0x2e, 0x72, 0x75, 0x6e, 0x6e, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x45, 0x6e, 0x76, 0x53, 0x74, 0x6f, 0x72, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x72, 0x75, 0x6e, 0x6d, 0x65, - 0x2e, 0x72, 0x75, 0x6e, 0x6e, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x6f, 0x6e, 0x69, 0x74, - 0x6f, 0x72, 0x45, 0x6e, 0x76, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x12, 0x52, 0x0a, 0x07, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, - 0x65, 0x12, 0x1f, 0x2e, 0x72, 0x75, 0x6e, 0x6d, 0x65, 0x2e, 0x72, 0x75, 0x6e, 0x6e, 0x65, 0x72, - 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x72, 0x75, 0x6e, 0x6d, 0x65, 0x2e, 0x72, 0x75, 0x6e, 0x6e, 0x65, - 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x12, 0x63, 0x0a, 0x0e, 0x52, 0x65, - 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x12, 0x26, 0x2e, 0x72, - 0x75, 0x6e, 0x6d, 0x65, 0x2e, 0x72, 0x75, 0x6e, 0x6e, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x52, - 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x72, 0x75, 0x6e, 0x6d, 0x65, 0x2e, 0x72, 0x75, 0x6e, - 0x6e, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x50, 0x72, - 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, - 0x4d, 0x5a, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x74, - 0x61, 0x74, 0x65, 0x66, 0x75, 0x6c, 0x2f, 0x72, 0x75, 0x6e, 0x6d, 0x65, 0x2f, 0x76, 0x33, 0x2f, - 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x2f, 0x72, 0x75, 0x6e, 0x6d, 0x65, 0x2f, 0x72, 0x75, 0x6e, 0x6e, - 0x65, 0x72, 0x2f, 0x76, 0x31, 0x3b, 0x72, 0x75, 0x6e, 0x6e, 0x65, 0x72, 0x76, 0x31, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x30, 0x01, 0x12, 0x52, 0x0a, + 0x07, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x12, 0x1f, 0x2e, 0x72, 0x75, 0x6e, 0x6d, 0x65, + 0x2e, 0x72, 0x75, 0x6e, 0x6e, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, + 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x72, 0x75, 0x6e, 0x6d, + 0x65, 0x2e, 0x72, 0x75, 0x6e, 0x6e, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, + 0x75, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x28, 0x01, 0x30, + 0x01, 0x12, 0x63, 0x0a, 0x0e, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x50, 0x72, 0x6f, 0x67, + 0x72, 0x61, 0x6d, 0x12, 0x26, 0x2e, 0x72, 0x75, 0x6e, 0x6d, 0x65, 0x2e, 0x72, 0x75, 0x6e, 0x6e, + 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x50, 0x72, 0x6f, + 0x67, 0x72, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x72, 0x75, + 0x6e, 0x6d, 0x65, 0x2e, 0x72, 0x75, 0x6e, 0x6e, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, + 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x4d, 0x5a, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x66, 0x75, 0x6c, 0x2f, 0x72, 0x75, + 0x6e, 0x6d, 0x65, 0x2f, 0x76, 0x33, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, + 0x67, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x2f, 0x72, 0x75, 0x6e, + 0x6d, 0x65, 0x2f, 0x72, 0x75, 0x6e, 0x6e, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x3b, 0x72, 0x75, 0x6e, + 0x6e, 0x65, 0x72, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -2297,7 +2368,7 @@ func file_runme_runner_v1_runner_proto_rawDescGZIP() []byte { } var file_runme_runner_v1_runner_proto_enumTypes = make([]protoimpl.EnumInfo, 8) -var file_runme_runner_v1_runner_proto_msgTypes = make([]protoimpl.MessageInfo, 24) +var file_runme_runner_v1_runner_proto_msgTypes = make([]protoimpl.MessageInfo, 25) var file_runme_runner_v1_runner_proto_goTypes = []interface{}{ (SessionEnvStoreType)(0), // 0: runme.runner.v1.SessionEnvStoreType (ExecuteStop)(0), // 1: runme.runner.v1.ExecuteStop @@ -2331,7 +2402,8 @@ var file_runme_runner_v1_runner_proto_goTypes = []interface{}{ nil, // 29: runme.runner.v1.CreateSessionRequest.MetadataEntry (*ResolveProgramResponse_VarResult)(nil), // 30: runme.runner.v1.ResolveProgramResponse.VarResult (*MonitorEnvStoreResponseSnapshot_SnapshotEnv)(nil), // 31: runme.runner.v1.MonitorEnvStoreResponseSnapshot.SnapshotEnv - (*wrapperspb.UInt32Value)(nil), // 32: google.protobuf.UInt32Value + (*MonitorEnvStoreResponseSnapshot_Error)(nil), // 32: runme.runner.v1.MonitorEnvStoreResponseSnapshot.Error + (*wrapperspb.UInt32Value)(nil), // 33: google.protobuf.UInt32Value } var file_runme_runner_v1_runner_proto_depIdxs = []int32{ 28, // 0: runme.runner.v1.Session.metadata:type_name -> runme.runner.v1.Session.MetadataEntry @@ -2346,7 +2418,7 @@ var file_runme_runner_v1_runner_proto_depIdxs = []int32{ 3, // 9: runme.runner.v1.ExecuteRequest.session_strategy:type_name -> runme.runner.v1.SessionStrategy 17, // 10: runme.runner.v1.ExecuteRequest.project:type_name -> runme.runner.v1.Project 2, // 11: runme.runner.v1.ExecuteRequest.command_mode:type_name -> runme.runner.v1.CommandMode - 32, // 12: runme.runner.v1.ExecuteResponse.exit_code:type_name -> google.protobuf.UInt32Value + 33, // 12: runme.runner.v1.ExecuteResponse.exit_code:type_name -> google.protobuf.UInt32Value 20, // 13: runme.runner.v1.ExecuteResponse.pid:type_name -> runme.runner.v1.ProcessPID 22, // 14: runme.runner.v1.ResolveProgramRequest.commands:type_name -> runme.runner.v1.ResolveProgramCommandList 5, // 15: runme.runner.v1.ResolveProgramRequest.mode:type_name -> runme.runner.v1.ResolveProgramRequest.Mode @@ -2360,25 +2432,26 @@ var file_runme_runner_v1_runner_proto_depIdxs = []int32{ 26, // 23: runme.runner.v1.MonitorEnvStoreResponse.snapshot:type_name -> runme.runner.v1.MonitorEnvStoreResponseSnapshot 6, // 24: runme.runner.v1.ResolveProgramResponse.VarResult.status:type_name -> runme.runner.v1.ResolveProgramResponse.Status 7, // 25: runme.runner.v1.MonitorEnvStoreResponseSnapshot.SnapshotEnv.status:type_name -> runme.runner.v1.MonitorEnvStoreResponseSnapshot.Status - 9, // 26: runme.runner.v1.RunnerService.CreateSession:input_type -> runme.runner.v1.CreateSessionRequest - 11, // 27: runme.runner.v1.RunnerService.GetSession:input_type -> runme.runner.v1.GetSessionRequest - 13, // 28: runme.runner.v1.RunnerService.ListSessions:input_type -> runme.runner.v1.ListSessionsRequest - 15, // 29: runme.runner.v1.RunnerService.DeleteSession:input_type -> runme.runner.v1.DeleteSessionRequest - 25, // 30: runme.runner.v1.RunnerService.MonitorEnvStore:input_type -> runme.runner.v1.MonitorEnvStoreRequest - 19, // 31: runme.runner.v1.RunnerService.Execute:input_type -> runme.runner.v1.ExecuteRequest - 23, // 32: runme.runner.v1.RunnerService.ResolveProgram:input_type -> runme.runner.v1.ResolveProgramRequest - 10, // 33: runme.runner.v1.RunnerService.CreateSession:output_type -> runme.runner.v1.CreateSessionResponse - 12, // 34: runme.runner.v1.RunnerService.GetSession:output_type -> runme.runner.v1.GetSessionResponse - 14, // 35: runme.runner.v1.RunnerService.ListSessions:output_type -> runme.runner.v1.ListSessionsResponse - 16, // 36: runme.runner.v1.RunnerService.DeleteSession:output_type -> runme.runner.v1.DeleteSessionResponse - 27, // 37: runme.runner.v1.RunnerService.MonitorEnvStore:output_type -> runme.runner.v1.MonitorEnvStoreResponse - 21, // 38: runme.runner.v1.RunnerService.Execute:output_type -> runme.runner.v1.ExecuteResponse - 24, // 39: runme.runner.v1.RunnerService.ResolveProgram:output_type -> runme.runner.v1.ResolveProgramResponse - 33, // [33:40] is the sub-list for method output_type - 26, // [26:33] is the sub-list for method input_type - 26, // [26:26] is the sub-list for extension type_name - 26, // [26:26] is the sub-list for extension extendee - 0, // [0:26] is the sub-list for field type_name + 32, // 26: runme.runner.v1.MonitorEnvStoreResponseSnapshot.SnapshotEnv.errors:type_name -> runme.runner.v1.MonitorEnvStoreResponseSnapshot.Error + 9, // 27: runme.runner.v1.RunnerService.CreateSession:input_type -> runme.runner.v1.CreateSessionRequest + 11, // 28: runme.runner.v1.RunnerService.GetSession:input_type -> runme.runner.v1.GetSessionRequest + 13, // 29: runme.runner.v1.RunnerService.ListSessions:input_type -> runme.runner.v1.ListSessionsRequest + 15, // 30: runme.runner.v1.RunnerService.DeleteSession:input_type -> runme.runner.v1.DeleteSessionRequest + 25, // 31: runme.runner.v1.RunnerService.MonitorEnvStore:input_type -> runme.runner.v1.MonitorEnvStoreRequest + 19, // 32: runme.runner.v1.RunnerService.Execute:input_type -> runme.runner.v1.ExecuteRequest + 23, // 33: runme.runner.v1.RunnerService.ResolveProgram:input_type -> runme.runner.v1.ResolveProgramRequest + 10, // 34: runme.runner.v1.RunnerService.CreateSession:output_type -> runme.runner.v1.CreateSessionResponse + 12, // 35: runme.runner.v1.RunnerService.GetSession:output_type -> runme.runner.v1.GetSessionResponse + 14, // 36: runme.runner.v1.RunnerService.ListSessions:output_type -> runme.runner.v1.ListSessionsResponse + 16, // 37: runme.runner.v1.RunnerService.DeleteSession:output_type -> runme.runner.v1.DeleteSessionResponse + 27, // 38: runme.runner.v1.RunnerService.MonitorEnvStore:output_type -> runme.runner.v1.MonitorEnvStoreResponse + 21, // 39: runme.runner.v1.RunnerService.Execute:output_type -> runme.runner.v1.ExecuteResponse + 24, // 40: runme.runner.v1.RunnerService.ResolveProgram:output_type -> runme.runner.v1.ResolveProgramResponse + 34, // [34:41] is the sub-list for method output_type + 27, // [27:34] is the sub-list for method input_type + 27, // [27:27] is the sub-list for extension type_name + 27, // [27:27] is the sub-list for extension extendee + 0, // [0:27] is the sub-list for field type_name } func init() { file_runme_runner_v1_runner_proto_init() } @@ -2651,6 +2724,18 @@ func file_runme_runner_v1_runner_proto_init() { return nil } } + file_runme_runner_v1_runner_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MonitorEnvStoreResponseSnapshot_Error); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } file_runme_runner_v1_runner_proto_msgTypes[1].OneofWrappers = []interface{}{} file_runme_runner_v1_runner_proto_msgTypes[11].OneofWrappers = []interface{}{} @@ -2667,7 +2752,7 @@ func file_runme_runner_v1_runner_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_runme_runner_v1_runner_proto_rawDesc, NumEnums: 8, - NumMessages: 24, + NumMessages: 25, NumExtensions: 0, NumServices: 1, }, diff --git a/internal/gen/proto/ts/runme/runner/v1/runner_pb.d.ts b/internal/gen/proto/ts/runme/runner/v1/runner_pb.d.ts index 0c50b70b9..0a7523c6f 100644 --- a/internal/gen/proto/ts/runme/runner/v1/runner_pb.d.ts +++ b/internal/gen/proto/ts/runme/runner/v1/runner_pb.d.ts @@ -570,6 +570,23 @@ export interface MonitorEnvStoreResponseSnapshot_SnapshotEnv { * @generated from protobuf field: string update_time = 8; */ updateTime: string; + /** + * @generated from protobuf field: repeated runme.runner.v1.MonitorEnvStoreResponseSnapshot.Error errors = 9; + */ + errors: MonitorEnvStoreResponseSnapshot_Error[]; +} +/** + * @generated from protobuf message runme.runner.v1.MonitorEnvStoreResponseSnapshot.Error + */ +export interface MonitorEnvStoreResponseSnapshot_Error { + /** + * @generated from protobuf field: uint32 code = 1; + */ + code: number; + /** + * @generated from protobuf field: string message = 2; + */ + message: string; } /** * @generated from protobuf enum runme.runner.v1.MonitorEnvStoreResponseSnapshot.Status @@ -850,6 +867,13 @@ declare class MonitorEnvStoreResponseSnapshot_SnapshotEnv$Type extends MessageTy * @generated MessageType for protobuf message runme.runner.v1.MonitorEnvStoreResponseSnapshot.SnapshotEnv */ export declare const MonitorEnvStoreResponseSnapshot_SnapshotEnv: MonitorEnvStoreResponseSnapshot_SnapshotEnv$Type; +declare class MonitorEnvStoreResponseSnapshot_Error$Type extends MessageType { + constructor(); +} +/** + * @generated MessageType for protobuf message runme.runner.v1.MonitorEnvStoreResponseSnapshot.Error + */ +export declare const MonitorEnvStoreResponseSnapshot_Error: MonitorEnvStoreResponseSnapshot_Error$Type; declare class MonitorEnvStoreResponse$Type extends MessageType { constructor(); } diff --git a/internal/gen/proto/ts/runme/runner/v1/runner_pb.js b/internal/gen/proto/ts/runme/runner/v1/runner_pb.js index 4be8b1ec2..6d9f7e6ec 100644 --- a/internal/gen/proto/ts/runme/runner/v1/runner_pb.js +++ b/internal/gen/proto/ts/runme/runner/v1/runner_pb.js @@ -474,7 +474,8 @@ class MonitorEnvStoreResponseSnapshot_SnapshotEnv$Type extends MessageType { { no: 5, name: "original_value", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, { no: 6, name: "resolved_value", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, { no: 7, name: "create_time", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 8, name: "update_time", kind: "scalar", T: 9 /*ScalarType.STRING*/ } + { no: 8, name: "update_time", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, + { no: 9, name: "errors", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => MonitorEnvStoreResponseSnapshot_Error } ]); } } @@ -483,6 +484,19 @@ class MonitorEnvStoreResponseSnapshot_SnapshotEnv$Type extends MessageType { */ export const MonitorEnvStoreResponseSnapshot_SnapshotEnv = new MonitorEnvStoreResponseSnapshot_SnapshotEnv$Type(); // @generated message type with reflection information, may provide speed optimized methods +class MonitorEnvStoreResponseSnapshot_Error$Type extends MessageType { + constructor() { + super("runme.runner.v1.MonitorEnvStoreResponseSnapshot.Error", [ + { no: 1, name: "code", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }, + { no: 2, name: "message", kind: "scalar", T: 9 /*ScalarType.STRING*/ } + ]); + } +} +/** + * @generated MessageType for protobuf message runme.runner.v1.MonitorEnvStoreResponseSnapshot.Error + */ +export const MonitorEnvStoreResponseSnapshot_Error = new MonitorEnvStoreResponseSnapshot_Error$Type(); +// @generated message type with reflection information, may provide speed optimized methods class MonitorEnvStoreResponse$Type extends MessageType { constructor() { super("runme.runner.v1.MonitorEnvStoreResponse", [ diff --git a/internal/owl/graph.go b/internal/owl/graph.go index 0f4313f5c..9e9e26d77 100644 --- a/internal/owl/graph.go +++ b/internal/owl/graph.go @@ -16,9 +16,9 @@ type specType struct { } var ( - Schema graphql.Schema - EnvironmentType, ValidateType *graphql.Object - SpecTypes map[string]*specType + Schema graphql.Schema + EnvironmentType, ValidateType, RenderType, SpecTypeErrorsType *graphql.Object + SpecTypes map[string]*specType ) type QueryNodeReducer func(*ast.OperationDefinition, *ast.SelectionSet) (*ast.SelectionSet, error) @@ -66,7 +66,30 @@ func registerSpec(spec string, sensitive, mask bool, resolver graphql.FieldResol }, }, "errors": &graphql.Field{ - Type: graphql.NewList(graphql.String), + Type: graphql.NewList(SpecTypeErrorsType), + Resolve: func(p graphql.ResolveParams) (interface{}, error) { + opSet, ok := p.Source.(*OperationSet) + if !ok { + return nil, errors.New("source is not an OperationSet") + } + + // todo(sebastian): move into interface? + var verrs []*SetVarError + for _, spec := range opSet.specs { + if spec.Spec.Error == nil { + continue + } + + code := spec.Spec.Error.Code() + verr := &SetVarError{ + Code: int(code), + Message: spec.Spec.Error.Message(), + } + verrs = append(verrs, verr) + } + + return verrs, nil + }, }, "done": &graphql.Field{ Type: EnvironmentType, @@ -98,26 +121,34 @@ func specResolver(mutator SpecResolverMutator) graphql.FieldResolveFn { opSet := p.Source.(*OperationSet) for _, kArg := range keysArg { k := kArg.(string) - v, vOk := opSet.values[k] - s, sOk := opSet.specs[k] - if !vOk && !sOk { - // todo(sebastian): should UNSET/delete ever come in here? + val, valOk := opSet.values[k] + spec, specOk := opSet.specs[k] + if !valOk && !specOk { + // todo(sebastian): superfluous keys are only possible in hand-written queries continue } // skip if last known status was DELETED - if vOk && v.Value.Status == "DELETED" { + if valOk && val.Value.Status == "DELETED" { continue } - if vOk && v.Value.Status == "UNRESOLVED" { - // todo(sebastian): most obvious validation error? - continue + // todo(sebastian): poc, move to something more generic + if valOk && val.Value.Status == "UNRESOLVED" { + if !specOk { + // todo(sebastian): without spec, we can't decide if unresolved is valid - should be impossible + continue + } + + if spec.Spec.Required { + spec.Spec.Error = RequiredError{varItem: &SetVarItem{Var: val.Var, Value: val.Value, Spec: spec.Spec}} + continue + } } - mutator(v, s, insecure) - if sOk { - s.Spec.Checked = true + mutator(val, spec, insecure) + if specOk { + spec.Spec.Checked = true } } @@ -162,11 +193,21 @@ func resolveSnapshot() graphql.FieldResolveFn { if !ok { return nil, fmt.Errorf("missing spec for %s", v.Var.Key) } - snapshot = append(snapshot, &SetVarItem{ + + item := &SetVarItem{ Var: v.Var, Value: v.Value, Spec: s.Spec, - }) + } + if s.Spec != nil && s.Spec.Error != nil { + code := s.Spec.Error.Code() + item.Errors = append(item.Errors, &SetVarError{ + Code: int(code), + Message: s.Spec.Error.Message(), + }) + } + + snapshot = append(snapshot, item) } snapshot.sort() @@ -347,6 +388,18 @@ func init() { }), ) + SpecTypeErrorsType = graphql.NewObject(graphql.ObjectConfig{ + Name: "SpecTypeErrorsType", + Fields: graphql.Fields{ + "message": &graphql.Field{ + Type: graphql.String, + }, + "code": &graphql.Field{ + Type: graphql.Int, + }, + }, + }) + ValidateType = graphql.NewObject(graphql.ObjectConfig{ Name: "ValidateType", Fields: (graphql.FieldsThunk)(func() graphql.Fields { @@ -445,10 +498,39 @@ func init() { }, }), }, + "errors": &graphql.Field{ + Type: graphql.NewList(SpecTypeErrorsType), + Resolve: func(p graphql.ResolveParams) (interface{}, error) { + vars, ok := p.Source.(*SetVarItem) + if !ok { + return nil, errors.New("source is not a *SetVarItem") + } + + return vars.Errors, nil + }, + }, }, }, ) + RenderType = graphql.NewObject(graphql.ObjectConfig{ + Name: "RenderType", + Fields: (graphql.FieldsThunk)(func() graphql.Fields { + return graphql.Fields{ + "snapshot": &graphql.Field{ + Type: graphql.NewNonNull(graphql.NewList(VariableType)), + Args: graphql.FieldConfigArgument{ + "insecure": &graphql.ArgumentConfig{ + Type: graphql.Boolean, + DefaultValue: false, + }, + }, + Resolve: resolveSnapshot(), + }, + } + }), + }) + VariableInputType := graphql.NewInputObject(graphql.InputObjectConfig{ Name: "VariableInput", Fields: graphql.InputObjectConfigFieldMap{ @@ -608,30 +690,11 @@ func init() { return p.Source, nil }, }, - // "location": &graphql.Field{ - // Type: graphql.NewNonNull(graphql.String), - // Resolve: func(p graphql.ResolveParams) (interface{}, error) { - // // todo(sebastian): bring this back? - // switch p.Source.(type) { - // case *OperationSet: - // opSet := p.Source.(*OperationSet) - // return opSet.operation.location, nil - // default: - // // noop - // } - - // return nil, nil - // }, - // }, - "snapshot": &graphql.Field{ - Type: graphql.NewNonNull(graphql.NewList(VariableType)), - Args: graphql.FieldConfigArgument{ - "insecure": &graphql.ArgumentConfig{ - Type: graphql.Boolean, - DefaultValue: false, - }, + "render": &graphql.Field{ + Type: RenderType, + Resolve: func(p graphql.ResolveParams) (interface{}, error) { + return p.Source, nil }, - Resolve: resolveSnapshot(), }, } }), diff --git a/internal/owl/graph_test.go b/internal/owl/graph_test.go index 37dc8c42e..5c366981f 100644 --- a/internal/owl/graph_test.go +++ b/internal/owl/graph_test.go @@ -8,6 +8,7 @@ import ( "github.com/graphql-go/graphql" "github.com/graphql-go/graphql/testutil" "github.com/stretchr/testify/require" + "gopkg.in/yaml.v3" ) func Test_Graph(t *testing.T) { @@ -29,7 +30,7 @@ func Test_Graph(t *testing.T) { require.NotNil(t, b) }) - t.Run("query environment", func(t *testing.T) { + t.Run("query simple environment", func(t *testing.T) { var vars map[string]interface{} err := json.Unmarshal([]byte(`{"load_0":[{"var":{"key":"GOPATH","created":"2024-03-02T13:25:01.270468-05:00","operation":null},"spec":{"checked":false,"name":"Opaque","required":false},"value":{"resolved":"/Users/sourishkrout/go","status":""}},{"var":{"key":"HOME","created":"2024-03-02T13:25:01.270469-05:00","operation":null},"spec":{"checked":false,"name":"Opaque","required":false},"value":{"resolved":"/Users/sourishkrout","status":""}},{"var":{"key":"HOMEBREW_REPOSITORY","created":"2024-03-02T13:25:01.270471-05:00","operation":null},"spec":{"checked":false,"name":"Opaque","required":false},"value":{"resolved":"/opt/homebrew","status":""}}]}`), &vars) require.NoError(t, err) @@ -39,21 +40,27 @@ func Test_Graph(t *testing.T) { RequestString: `query ResolveOwlSnapshot($insecure: Boolean = false, $load_0: [VariableInput]!) { environment { load(vars: $load_0, hasSpecs: false) { - snapshot(insecure: $insecure) { - var { - key - origin - created - updated - } - value { - original - resolved - status - } - spec { - name - required + render { + snapshot(insecure: $insecure) { + var { + key + origin + created + updated + } + value { + original + resolved + status + } + spec { + name + required + } + errors { + code + message + } } } } @@ -68,13 +75,13 @@ func Test_Graph(t *testing.T) { fmt.Println(string(b)) require.NotNil(t, b) - snapshot := result.Data.(map[string]interface{})["environment"].(map[string]interface{})["load"].(map[string]interface{})["snapshot"] + snapshot := result.Data.(map[string]interface{})["environment"].(map[string]interface{})["load"].(map[string]interface{})["render"].(map[string]interface{})["snapshot"] require.NoError(t, err) require.Len(t, snapshot, 3) }) t.Run("query complex environment", func(t *testing.T) { - jsonVars := `{"insecure":false,"load_0":[{"value":{"original":"/opt/homebrew/share/man:/usr/share/man:/usr/local/share/man:/Users/sourishkrout/.cache/zsh4humans/v5/fzf/man:","status":""},"var":{"created":"2024-03-11T16:42:52.999456-04:00","key":"MANPATH","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"/private/tmp/com.apple.launchd.WJncT7ZrHW/Listeners","status":""},"var":{"created":"2024-03-11T16:42:52.999462-04:00","key":"SSH_AUTH_SOCK","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"89716","status":""},"var":{"created":"2024-03-11T16:42:52.999469-04:00","key":"VSCODE_PID","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"/opt/homebrew","status":""},"var":{"created":"2024-03-11T16:42:52.999447-04:00","key":"HOMEBREW_PREFIX","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"en_US.UTF-8","status":""},"var":{"created":"2024-03-11T16:42:52.999452-04:00","key":"LC_ALL","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"-iRFXMx4","status":""},"var":{"created":"2024-03-11T16:42:52.999453-04:00","key":"LESS","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","status":""},"var":{"created":"2024-03-11T16:42:52.999457-04:00","key":"OPENAI_API_KEY","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"/","status":""},"var":{"created":"2024-03-11T16:42:52.999459-04:00","key":"PWD","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"{\"locale\":\"en-us\",\"osLocale\":\"en-us\",\"availableLanguages\":{},\"_languagePackSupport\":true}","status":""},"var":{"created":"2024-03-11T16:42:52.999468-04:00","key":"VSCODE_NLS_CONFIG","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"/opt/homebrew","status":""},"var":{"created":"2024-03-11T16:42:52.999448-04:00","key":"HOMEBREW_REPOSITORY","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"cmxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxlFl","status":""},"var":{"created":"2024-03-11T16:42:52.999451-04:00","key":"KRAFTCLOUD_TOKEN","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"ExGxDxDxCxDxDxFxFxexEx","status":""},"var":{"created":"2024-03-11T16:42:52.999454-04:00","key":"LSCOLORS","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"0","status":""},"var":{"created":"2024-03-11T16:42:52.999456-04:00","key":"MallocNanoZone","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"/bin/zsh","status":""},"var":{"created":"2024-03-11T16:42:52.99946-04:00","key":"SHELL","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"xterm-256color","status":""},"var":{"created":"2024-03-11T16:42:52.999463-04:00","key":"TERM","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"/Applications/Visual Studio Code.app/Contents/MacOS/Electron","status":""},"var":{"created":"2024-03-11T16:42:52.999471-04:00","key":"_","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"1","status":""},"var":{"created":"2024-03-11T16:42:52.999472-04:00","key":"APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"/Users/sourishkrout/.begin","status":""},"var":{"created":"2024-03-11T16:42:52.999444-04:00","key":"BEGIN_INSTALL","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"less","status":""},"var":{"created":"2024-03-11T16:42:52.999458-04:00","key":"PAGER","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"/Users/sourishkrout/.terminfo","status":""},"var":{"created":"2024-03-11T16:42:52.999463-04:00","key":"TERMINFO","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"/","status":""},"var":{"created":"2024-03-11T16:42:52.999467-04:00","key":"VSCODE_CWD","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"/Users/sourishkrout/Library/Application Support/Code/1.87-main.sock","status":""},"var":{"created":"2024-03-11T16:42:52.999468-04:00","key":"VSCODE_IPC_HOOK","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"/Users/sourishkrout/Projects/stateful/2022Q4/wasi-sdk/dist/wasi-sdk-16.5ga0a342ac182c","status":""},"var":{"created":"2024-03-11T16:42:52.999469-04:00","key":"WASI_SDK_PATH","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"1","status":""},"var":{"created":"2024-03-11T16:42:52.999472-04:00","key":"ELECTRON_RUN_AS_NODE","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"/opt/homebrew/opt/asdf/libexec","status":""},"var":{"created":"2024-03-11T16:42:52.999443-04:00","key":"ASDF_DIR","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"/Users/sourishkrout","status":""},"var":{"created":"2024-03-11T16:42:52.999446-04:00","key":"HOME","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"/opt/homebrew/share/google-cloud-sdk/bin:/Users/sourishkrout/.wasmtime/bin:/opt/homebrew/opt/libpq/bin:/Users/sourishkrout/go/bin:/Users/sourishkrout/.asdf/shims:/opt/homebrew/opt/asdf/libexec/bin:/Users/sourishkrout/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Library/Apple/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/sourishkrout/.cache/zsh4humans/v5/fzf/bin:/Applications/Postgres.app/Contents/Versions/16/bin","status":""},"var":{"created":"2024-03-11T16:42:52.999459-04:00","key":"PATH","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"/var/folders/c3/5r0t1nzs7sbfpxjgbc6n3ss40000gn/T/","status":""},"var":{"created":"2024-03-11T16:42:52.999464-04:00","key":"TMPDIR","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"fi=00:mi=00:mh=00:ln=01;36:or=01;31:di=01;34:ow=01;34:st=34:tw=34:pi=01;33:so=01;33:do=01;33:bd=01;33:cd=01;33:su=01;35:sg=01;35:ca=01;35:ex=01;32","status":""},"var":{"created":"2024-03-11T16:42:52.999465-04:00","key":"TREE_COLORS","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"extensionHost","status":""},"var":{"created":"2024-03-11T16:42:52.999467-04:00","key":"VSCODE_CRASH_REPORTER_PROCESS_TYPE","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"true","status":""},"var":{"created":"2024-03-11T16:42:52.999467-04:00","key":"VSCODE_HANDLES_UNCAUGHT_ERRORS","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"application.com.microsoft.VSCode.251091548.251091554","status":""},"var":{"created":"2024-03-11T16:42:52.99947-04:00","key":"XPC_SERVICE_NAME","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"d8xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxe188","status":""},"var":{"created":"2024-03-11T16:42:52.999445-04:00","key":"BUF_TOKEN","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"unix2003","status":""},"var":{"created":"2024-03-11T16:42:52.999445-04:00","key":"COMMAND_MODE","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"/Users/sourishkrout/go","status":""},"var":{"created":"2024-03-11T16:42:52.999446-04:00","key":"GOPATH","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"/opt/homebrew/Cellar","status":""},"var":{"created":"2024-03-11T16:42:52.999447-04:00","key":"HOMEBREW_CELLAR","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"sourishkrout","status":""},"var":{"created":"2024-03-11T16:42:52.999454-04:00","key":"LOGNAME","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"org-tm5BAbynhBsExxxxxxxxxxxx","status":""},"var":{"created":"2024-03-11T16:42:52.999457-04:00","key":"OPENAI_ORG_ID","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"sourishkrout","status":""},"var":{"created":"2024-03-11T16:42:52.999465-04:00","key":"USER","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"/Users/sourishkrout/.wasmtime","status":""},"var":{"created":"2024-03-11T16:42:52.999469-04:00","key":"WASMTIME_HOME","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"/opt/homebrew/share/info:","status":""},"var":{"created":"2024-03-11T16:42:52.999451-04:00","key":"INFOPATH","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"achristian","status":""},"var":{"created":"2024-03-11T16:42:52.999452-04:00","key":"KRAFTCLOUD_USER","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"fi=00:mi=00:mh=00:ln=01;36:or=01;31:di=01;34:ow=04;01;34:st=34:tw=04;34:pi=01;33:so=01;33:do=01;33:bd=01;33:cd=01;33:su=01;35:sg=01;35:ca=01;35:ex=01;32","status":""},"var":{"created":"2024-03-11T16:42:52.999455-04:00","key":"LS_COLORS","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"/","status":""},"var":{"created":"2024-03-11T16:42:52.999457-04:00","key":"OLDPWD","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"0","status":""},"var":{"created":"2024-03-11T16:42:52.999462-04:00","key":"SHLVL","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"True","status":""},"var":{"created":"2024-03-11T16:42:52.999466-04:00","key":"USE_GKE_GCLOUD_AUTH_PLUGIN","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"vs/workbench/api/node/extensionHostProcess","status":""},"var":{"created":"2024-03-11T16:42:52.999466-04:00","key":"VSCODE_AMD_ENTRYPOINT","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"com.microsoft.VSCode","status":""},"var":{"created":"2024-03-11T16:42:52.999471-04:00","key":"__CFBundleIdentifier","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"0x1F5:0x0:0x0","status":""},"var":{"created":"2024-03-11T16:42:52.999471-04:00","key":"__CF_USER_TEXT_ENCODING","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx","status":""},"var":{"created":"2024-03-11T16:42:52.999451-04:00","key":"INSTRUMENTATION_KEY","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"undefined","status":""},"var":{"created":"2024-03-11T16:42:52.999458-04:00","key":"ORIGINAL_XDG_CURRENT_DESKTOP","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"0x0","status":""},"var":{"created":"2024-03-11T16:42:52.99947-04:00","key":"XPC_FLAGS","operation":{"order":0,"source":"[system]"}}}],"load_1":[{"spec":{"checked":false,"description":"Your OpenAI API key matching the org","name":"Secret","required":true},"var":{"created":"2024-03-11T16:42:52.999505-04:00","key":"OPENAI_API_KEY","operation":{"order":0,"source":".env.example"}}},{"spec":{"checked":false,"description":"Your OpenAI org identifier","name":"Plain","required":true},"var":{"created":"2024-03-11T16:42:52.999506-04:00","key":"OPENAI_ORG_ID","operation":{"order":0,"source":".env.example"}}},{"spec":{"checked":false,"description":"This is secret","name":"Password","required":true},"var":{"created":"2024-03-11T16:42:52.999506-04:00","key":"KRAFTCLOUD_TOKEN","operation":{"order":0,"source":".env.example"}}},{"spec":{"checked":false,"description":"","name":"Plain","required":true},"var":{"created":"2024-03-11T16:42:52.999507-04:00","key":"MSG","operation":{"order":0,"source":".env.example"}}},{"spec":{"checked":false,"description":"Some value","name":"Plain","required":false},"var":{"created":"2024-03-11T16:42:52.999508-04:00","key":"NAKED","operation":{"order":0,"source":".env.example"}}},{"spec":{"checked":false,"description":"Some name","name":"Plain","required":true},"var":{"created":"2024-03-11T16:42:52.999506-04:00","key":"NAME","operation":{"order":0,"source":".env.example"}}},{"spec":{"checked":false,"description":"","name":"Plain","required":true},"var":{"created":"2024-03-11T16:42:52.999508-04:00","key":"USER","operation":{"order":0,"source":".env.example"}}},{"spec":{"checked":false,"description":"No idea what mode this is","name":"Plain","required":true},"var":{"created":"2024-03-11T16:42:52.999508-04:00","key":"COMMAND_MODE","operation":{"order":0,"source":".env.example"}}},{"spec":{"checked":false,"description":"Working directory","name":"Plain","required":false},"var":{"created":"2024-03-11T16:42:52.999509-04:00","key":"PWD","operation":{"order":0,"source":".env.example"}}}],"load_2":[{"value":{"original":"Luna","status":""},"var":{"created":"2024-03-11T16:42:52.99951-04:00","key":"NAME","operation":{"order":0,"source":".env"}}}],"reconcile_12":[{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:43:00.194861-04:00","key":"__","operation":null}}],"reconcile_3":[{"value":{"status":"UNRESOLVED"},"var":{"created":"2024-03-11T16:42:52.999659-04:00","key":"MSG","operation":null}},{"value":{"status":"UNRESOLVED"},"var":{"created":"2024-03-11T16:42:52.999659-04:00","key":"NAKED","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999648-04:00","key":"INFOPATH","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.99964-04:00","key":"ELECTRON_RUN_AS_NODE","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999641-04:00","key":"TERMINFO","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999647-04:00","key":"HOMEBREW_CELLAR","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999644-04:00","key":"PATH","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999646-04:00","key":"GOPATH","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999651-04:00","key":"__CF_USER_TEXT_ENCODING","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999657-04:00","key":"APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.99964-04:00","key":"BEGIN_INSTALL","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999641-04:00","key":"VSCODE_CWD","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999643-04:00","key":"XPC_SERVICE_NAME","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999648-04:00","key":"VSCODE_AMD_ENTRYPOINT","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999649-04:00","key":"LS_COLORS","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999649-04:00","key":"OLDPWD","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999654-04:00","key":"SSH_AUTH_SOCK","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999654-04:00","key":"VSCODE_PID","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999642-04:00","key":"VSCODE_CRASH_REPORTER_PROCESS_TYPE","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999642-04:00","key":"VSCODE_HANDLES_UNCAUGHT_ERRORS","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999644-04:00","key":"TMPDIR","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999655-04:00","key":"VSCODE_NLS_CONFIG","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999657-04:00","key":"LSCOLORS","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999652-04:00","key":"INSTRUMENTATION_KEY","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999657-04:00","key":"HOMEBREW_REPOSITORY","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999644-04:00","key":"HOME","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999646-04:00","key":"WASMTIME_HOME","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999646-04:00","key":"BUF_TOKEN","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999645-04:00","key":"TREE_COLORS","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999647-04:00","key":"LOGNAME","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999655-04:00","key":"LC_ALL","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999652-04:00","key":"XPC_FLAGS","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999653-04:00","key":"MANPATH","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999655-04:00","key":"HOMEBREW_PREFIX","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999656-04:00","key":"_","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999658-04:00","key":"MallocNanoZone","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999647-04:00","key":"USE_GKE_GCLOUD_AUTH_PLUGIN","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999649-04:00","key":"KRAFTCLOUD_USER","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999651-04:00","key":"SHLVL","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999656-04:00","key":"TERM","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999658-04:00","key":"SHELL","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999641-04:00","key":"PAGER","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999643-04:00","key":"ASDF_DIR","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999652-04:00","key":"ORIGINAL_XDG_CURRENT_DESKTOP","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999656-04:00","key":"LESS","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999639-04:00","key":"WASI_SDK_PATH","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999642-04:00","key":"VSCODE_IPC_HOOK","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999648-04:00","key":"__CFBundleIdentifier","operation":null}}],"reconcile_6":[{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:59.978152-04:00","key":"RUNME_ID","operation":null}}],"reconcile_9":[{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:43:00.153761-04:00","key":"INNER","operation":null}}],"update_10":[{"value":{"original":"Hello world, Seb!\r\nsourishkrout\r\n","status":""},"var":{"created":"2024-03-11T16:43:00.194798-04:00","key":"__","operation":{"order":0,"source":"[execution]"}}}],"update_13":[{"value":{"original":"01HQ64XAYM289P5DF7CS0EJ54N","status":""},"var":{"created":"2024-03-11T16:43:04.956159-04:00","key":"RUNME_ID","operation":{"order":0,"source":"[execution]"}}},{"value":{"original":"xterm-256color","status":""},"var":{"created":"2024-03-11T16:43:04.956161-04:00","key":"TERM","operation":{"order":0,"source":"[execution]"}}}],"update_15":[{"value":{"original":"LPT","status":""},"var":{"created":"2024-03-11T16:43:05.155121-04:00","key":"NAME","operation":{"order":0,"source":"[execution]"}}}],"update_17":[{"value":{"original":"Hello world, LPT!\r\nsourishkrout\r\n","status":""},"var":{"created":"2024-03-11T16:43:05.209067-04:00","key":"__","operation":{"order":0,"source":"[execution]"}}}],"update_19":[{"value":{"original":"01HQ64XAYM289P5DF7CS0EJ54N","status":""},"var":{"created":"2024-03-11T16:43:10.231094-04:00","key":"RUNME_ID","operation":{"order":0,"source":"[execution]"}}},{"value":{"original":"xterm-256color","status":""},"var":{"created":"2024-03-11T16:43:10.231096-04:00","key":"TERM","operation":{"order":0,"source":"[execution]"}}}],"update_21":[{"value":{"original":"Loon","status":""},"var":{"created":"2024-03-11T16:43:10.459397-04:00","key":"NAME","operation":{"order":0,"source":"[execution]"}}}],"update_23":[{"value":{"original":"Hello world, Loon!\r\nsourishkrout\r\n","status":""},"var":{"created":"2024-03-11T16:43:10.525491-04:00","key":"__","operation":{"order":0,"source":"[execution]"}}}],"update_4":[{"value":{"original":"01HQ64XAYM289P5DF7CS0EJ54N","status":""},"var":{"created":"2024-03-11T16:42:59.978091-04:00","key":"RUNME_ID","operation":{"order":0,"source":"[execution]"}}},{"value":{"original":"xterm-256color","status":""},"var":{"created":"2024-03-11T16:42:59.978093-04:00","key":"TERM","operation":{"order":0,"source":"[execution]"}}}],"update_7":[{"value":{"original":"123","status":""},"var":{"created":"2024-03-11T16:43:00.153679-04:00","key":"NAKED","operation":{"order":0,"source":"[execution]"}}},{"value":{"original":"Seb","status":""},"var":{"created":"2024-03-11T16:43:00.153677-04:00","key":"NAME","operation":{"order":0,"source":"[execution]"}}},{"value":{"original":"nested","status":""},"var":{"created":"2024-03-11T16:43:00.153679-04:00","key":"INNER","operation":{"order":0,"source":"[execution]"}}},{"value":{"original":"Hello world","status":""},"var":{"created":"2024-03-11T16:43:00.153679-04:00","key":"MSG","operation":{"order":0,"source":"[execution]"}}}]}` + jsonVars := `{"insecure":true,"load_0":[{"value":{"original":"/opt/homebrew/share/man:/usr/share/man:/usr/local/share/man:/Users/sourishkrout/.cache/zsh4humans/v5/fzf/man:","status":""},"var":{"created":"2024-03-11T16:42:52.999456-04:00","key":"MANPATH","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"/private/tmp/com.apple.launchd.WJncT7ZrHW/Listeners","status":""},"var":{"created":"2024-03-11T16:42:52.999462-04:00","key":"SSH_AUTH_SOCK","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"89716","status":""},"var":{"created":"2024-03-11T16:42:52.999469-04:00","key":"VSCODE_PID","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"/opt/homebrew","status":""},"var":{"created":"2024-03-11T16:42:52.999447-04:00","key":"HOMEBREW_PREFIX","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"en_US.UTF-8","status":""},"var":{"created":"2024-03-11T16:42:52.999452-04:00","key":"LC_ALL","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"-iRFXMx4","status":""},"var":{"created":"2024-03-11T16:42:52.999453-04:00","key":"LESS","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","status":""},"var":{"created":"2024-03-11T16:42:52.999457-04:00","key":"OPENAI_API_KEY","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"/","status":""},"var":{"created":"2024-03-11T16:42:52.999459-04:00","key":"PWD","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"{\"locale\":\"en-us\",\"osLocale\":\"en-us\",\"availableLanguages\":{},\"_languagePackSupport\":true}","status":""},"var":{"created":"2024-03-11T16:42:52.999468-04:00","key":"VSCODE_NLS_CONFIG","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"/opt/homebrew","status":""},"var":{"created":"2024-03-11T16:42:52.999448-04:00","key":"HOMEBREW_REPOSITORY","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"cmxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxlFl","status":""},"var":{"created":"2024-03-11T16:42:52.999451-04:00","key":"KRAFTCLOUD_TOKEN","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"ExGxDxDxCxDxDxFxFxexEx","status":""},"var":{"created":"2024-03-11T16:42:52.999454-04:00","key":"LSCOLORS","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"0","status":""},"var":{"created":"2024-03-11T16:42:52.999456-04:00","key":"MallocNanoZone","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"/bin/zsh","status":""},"var":{"created":"2024-03-11T16:42:52.99946-04:00","key":"SHELL","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"xterm-256color","status":""},"var":{"created":"2024-03-11T16:42:52.999463-04:00","key":"TERM","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"/Applications/Visual Studio Code.app/Contents/MacOS/Electron","status":""},"var":{"created":"2024-03-11T16:42:52.999471-04:00","key":"_","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"1","status":""},"var":{"created":"2024-03-11T16:42:52.999472-04:00","key":"APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"/Users/sourishkrout/.begin","status":""},"var":{"created":"2024-03-11T16:42:52.999444-04:00","key":"BEGIN_INSTALL","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"less","status":""},"var":{"created":"2024-03-11T16:42:52.999458-04:00","key":"PAGER","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"/Users/sourishkrout/.terminfo","status":""},"var":{"created":"2024-03-11T16:42:52.999463-04:00","key":"TERMINFO","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"/","status":""},"var":{"created":"2024-03-11T16:42:52.999467-04:00","key":"VSCODE_CWD","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"/Users/sourishkrout/Library/Application Support/Code/1.87-main.sock","status":""},"var":{"created":"2024-03-11T16:42:52.999468-04:00","key":"VSCODE_IPC_HOOK","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"/Users/sourishkrout/Projects/stateful/2022Q4/wasi-sdk/dist/wasi-sdk-16.5ga0a342ac182c","status":""},"var":{"created":"2024-03-11T16:42:52.999469-04:00","key":"WASI_SDK_PATH","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"1","status":""},"var":{"created":"2024-03-11T16:42:52.999472-04:00","key":"ELECTRON_RUN_AS_NODE","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"/opt/homebrew/opt/asdf/libexec","status":""},"var":{"created":"2024-03-11T16:42:52.999443-04:00","key":"ASDF_DIR","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"/Users/sourishkrout","status":""},"var":{"created":"2024-03-11T16:42:52.999446-04:00","key":"HOME","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"/opt/homebrew/share/google-cloud-sdk/bin:/Users/sourishkrout/.wasmtime/bin:/opt/homebrew/opt/libpq/bin:/Users/sourishkrout/go/bin:/Users/sourishkrout/.asdf/shims:/opt/homebrew/opt/asdf/libexec/bin:/Users/sourishkrout/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Library/Apple/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/sourishkrout/.cache/zsh4humans/v5/fzf/bin:/Applications/Postgres.app/Contents/Versions/16/bin","status":""},"var":{"created":"2024-03-11T16:42:52.999459-04:00","key":"PATH","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"/var/folders/c3/5r0t1nzs7sbfpxjgbc6n3ss40000gn/T/","status":""},"var":{"created":"2024-03-11T16:42:52.999464-04:00","key":"TMPDIR","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"fi=00:mi=00:mh=00:ln=01;36:or=01;31:di=01;34:ow=01;34:st=34:tw=34:pi=01;33:so=01;33:do=01;33:bd=01;33:cd=01;33:su=01;35:sg=01;35:ca=01;35:ex=01;32","status":""},"var":{"created":"2024-03-11T16:42:52.999465-04:00","key":"TREE_COLORS","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"extensionHost","status":""},"var":{"created":"2024-03-11T16:42:52.999467-04:00","key":"VSCODE_CRASH_REPORTER_PROCESS_TYPE","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"true","status":""},"var":{"created":"2024-03-11T16:42:52.999467-04:00","key":"VSCODE_HANDLES_UNCAUGHT_ERRORS","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"application.com.microsoft.VSCode.251091548.251091554","status":""},"var":{"created":"2024-03-11T16:42:52.99947-04:00","key":"XPC_SERVICE_NAME","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"d8xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxe188","status":""},"var":{"created":"2024-03-11T16:42:52.999445-04:00","key":"BUF_TOKEN","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"unix2003","status":""},"var":{"created":"2024-03-11T16:42:52.999445-04:00","key":"COMMAND_MODE","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"/Users/sourishkrout/go","status":""},"var":{"created":"2024-03-11T16:42:52.999446-04:00","key":"GOPATH","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"/opt/homebrew/Cellar","status":""},"var":{"created":"2024-03-11T16:42:52.999447-04:00","key":"HOMEBREW_CELLAR","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"sourishkrout","status":""},"var":{"created":"2024-03-11T16:42:52.999454-04:00","key":"LOGNAME","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"org-tm5BAbynhBsExxxxxxxxxxxx","status":""},"var":{"created":"2024-03-11T16:42:52.999457-04:00","key":"OPENAI_ORG_ID","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"sourishkrout","status":""},"var":{"created":"2024-03-11T16:42:52.999465-04:00","key":"USER","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"/Users/sourishkrout/.wasmtime","status":""},"var":{"created":"2024-03-11T16:42:52.999469-04:00","key":"WASMTIME_HOME","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"/opt/homebrew/share/info:","status":""},"var":{"created":"2024-03-11T16:42:52.999451-04:00","key":"INFOPATH","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"achristian","status":""},"var":{"created":"2024-03-11T16:42:52.999452-04:00","key":"KRAFTCLOUD_USER","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"fi=00:mi=00:mh=00:ln=01;36:or=01;31:di=01;34:ow=04;01;34:st=34:tw=04;34:pi=01;33:so=01;33:do=01;33:bd=01;33:cd=01;33:su=01;35:sg=01;35:ca=01;35:ex=01;32","status":""},"var":{"created":"2024-03-11T16:42:52.999455-04:00","key":"LS_COLORS","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"/","status":""},"var":{"created":"2024-03-11T16:42:52.999457-04:00","key":"OLDPWD","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"0","status":""},"var":{"created":"2024-03-11T16:42:52.999462-04:00","key":"SHLVL","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"True","status":""},"var":{"created":"2024-03-11T16:42:52.999466-04:00","key":"USE_GKE_GCLOUD_AUTH_PLUGIN","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"vs/workbench/api/node/extensionHostProcess","status":""},"var":{"created":"2024-03-11T16:42:52.999466-04:00","key":"VSCODE_AMD_ENTRYPOINT","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"com.microsoft.VSCode","status":""},"var":{"created":"2024-03-11T16:42:52.999471-04:00","key":"__CFBundleIdentifier","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"0x1F5:0x0:0x0","status":""},"var":{"created":"2024-03-11T16:42:52.999471-04:00","key":"__CF_USER_TEXT_ENCODING","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx","status":""},"var":{"created":"2024-03-11T16:42:52.999451-04:00","key":"INSTRUMENTATION_KEY","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"undefined","status":""},"var":{"created":"2024-03-11T16:42:52.999458-04:00","key":"ORIGINAL_XDG_CURRENT_DESKTOP","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"0x0","status":""},"var":{"created":"2024-03-11T16:42:52.99947-04:00","key":"XPC_FLAGS","operation":{"order":0,"source":"[system]"}}}],"load_1":[{"spec":{"checked":false,"description":"Your OpenAI API key matching the org","name":"Secret","required":true},"var":{"created":"2024-03-11T16:42:52.999505-04:00","key":"OPENAI_API_KEY","operation":{"order":0,"source":".env.example"}}},{"spec":{"checked":false,"description":"Your OpenAI org identifier","name":"Plain","required":true},"var":{"created":"2024-03-11T16:42:52.999506-04:00","key":"OPENAI_ORG_ID","operation":{"order":0,"source":".env.example"}}},{"spec":{"checked":false,"description":"This is secret","name":"Password","required":true},"var":{"created":"2024-03-11T16:42:52.999506-04:00","key":"KRAFTCLOUD_TOKEN","operation":{"order":0,"source":".env.example"}}},{"spec":{"checked":false,"description":"","name":"Plain","required":true},"var":{"created":"2024-03-11T16:42:52.999507-04:00","key":"MSG","operation":{"order":0,"source":".env.example"}}},{"spec":{"checked":false,"description":"Some value","name":"Plain","required":false},"var":{"created":"2024-03-11T16:42:52.999508-04:00","key":"NAKED","operation":{"order":0,"source":".env.example"}}},{"spec":{"checked":false,"description":"Some name","name":"Plain","required":true},"var":{"created":"2024-03-11T16:42:52.999506-04:00","key":"NAME","operation":{"order":0,"source":".env.example"}}},{"spec":{"checked":false,"description":"","name":"Plain","required":true},"var":{"created":"2024-03-11T16:42:52.999508-04:00","key":"USER","operation":{"order":0,"source":".env.example"}}},{"spec":{"checked":false,"description":"No idea what mode this is","name":"Plain","required":true},"var":{"created":"2024-03-11T16:42:52.999508-04:00","key":"COMMAND_MODE","operation":{"order":0,"source":".env.example"}}},{"spec":{"checked":false,"description":"Working directory","name":"Plain","required":false},"var":{"created":"2024-03-11T16:42:52.999509-04:00","key":"PWD","operation":{"order":0,"source":".env.example"}}}],"load_2":[{"value":{"original":"Luna","status":""},"var":{"created":"2024-03-11T16:42:52.99951-04:00","key":"NAME","operation":{"order":0,"source":".env"}}}],"reconcile_12":[{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:43:00.194861-04:00","key":"__","operation":null}}],"reconcile_3":[{"value":{"status":"UNRESOLVED"},"var":{"created":"2024-03-11T16:42:52.999659-04:00","key":"MSG","operation":null}},{"value":{"status":"UNRESOLVED"},"var":{"created":"2024-03-11T16:42:52.999659-04:00","key":"NAKED","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999648-04:00","key":"INFOPATH","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.99964-04:00","key":"ELECTRON_RUN_AS_NODE","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999641-04:00","key":"TERMINFO","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999647-04:00","key":"HOMEBREW_CELLAR","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999644-04:00","key":"PATH","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999646-04:00","key":"GOPATH","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999651-04:00","key":"__CF_USER_TEXT_ENCODING","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999657-04:00","key":"APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.99964-04:00","key":"BEGIN_INSTALL","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999641-04:00","key":"VSCODE_CWD","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999643-04:00","key":"XPC_SERVICE_NAME","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999648-04:00","key":"VSCODE_AMD_ENTRYPOINT","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999649-04:00","key":"LS_COLORS","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999649-04:00","key":"OLDPWD","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999654-04:00","key":"SSH_AUTH_SOCK","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999654-04:00","key":"VSCODE_PID","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999642-04:00","key":"VSCODE_CRASH_REPORTER_PROCESS_TYPE","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999642-04:00","key":"VSCODE_HANDLES_UNCAUGHT_ERRORS","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999644-04:00","key":"TMPDIR","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999655-04:00","key":"VSCODE_NLS_CONFIG","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999657-04:00","key":"LSCOLORS","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999652-04:00","key":"INSTRUMENTATION_KEY","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999657-04:00","key":"HOMEBREW_REPOSITORY","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999644-04:00","key":"HOME","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999646-04:00","key":"WASMTIME_HOME","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999646-04:00","key":"BUF_TOKEN","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999645-04:00","key":"TREE_COLORS","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999647-04:00","key":"LOGNAME","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999655-04:00","key":"LC_ALL","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999652-04:00","key":"XPC_FLAGS","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999653-04:00","key":"MANPATH","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999655-04:00","key":"HOMEBREW_PREFIX","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999656-04:00","key":"_","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999658-04:00","key":"MallocNanoZone","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999647-04:00","key":"USE_GKE_GCLOUD_AUTH_PLUGIN","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999649-04:00","key":"KRAFTCLOUD_USER","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999651-04:00","key":"SHLVL","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999656-04:00","key":"TERM","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999658-04:00","key":"SHELL","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999641-04:00","key":"PAGER","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999643-04:00","key":"ASDF_DIR","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999652-04:00","key":"ORIGINAL_XDG_CURRENT_DESKTOP","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999656-04:00","key":"LESS","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999639-04:00","key":"WASI_SDK_PATH","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999642-04:00","key":"VSCODE_IPC_HOOK","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:52.999648-04:00","key":"__CFBundleIdentifier","operation":null}}],"reconcile_6":[{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:42:59.978152-04:00","key":"RUNME_ID","operation":null}}],"reconcile_9":[{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-11T16:43:00.153761-04:00","key":"INNER","operation":null}}],"update_10":[{"value":{"original":"Hello world, Seb!\r\nsourishkrout\r\n","status":""},"var":{"created":"2024-03-11T16:43:00.194798-04:00","key":"__","operation":{"order":0,"source":"[execution]"}}}],"update_13":[{"value":{"original":"01HQ64XAYM289P5DF7CS0EJ54N","status":""},"var":{"created":"2024-03-11T16:43:04.956159-04:00","key":"RUNME_ID","operation":{"order":0,"source":"[execution]"}}},{"value":{"original":"xterm-256color","status":""},"var":{"created":"2024-03-11T16:43:04.956161-04:00","key":"TERM","operation":{"order":0,"source":"[execution]"}}}],"update_15":[{"value":{"original":"LPT","status":""},"var":{"created":"2024-03-11T16:43:05.155121-04:00","key":"NAME","operation":{"order":0,"source":"[execution]"}}}],"update_17":[{"value":{"original":"Hello world, LPT!\r\nsourishkrout\r\n","status":""},"var":{"created":"2024-03-11T16:43:05.209067-04:00","key":"__","operation":{"order":0,"source":"[execution]"}}}],"update_19":[{"value":{"original":"01HQ64XAYM289P5DF7CS0EJ54N","status":""},"var":{"created":"2024-03-11T16:43:10.231094-04:00","key":"RUNME_ID","operation":{"order":0,"source":"[execution]"}}},{"value":{"original":"xterm-256color","status":""},"var":{"created":"2024-03-11T16:43:10.231096-04:00","key":"TERM","operation":{"order":0,"source":"[execution]"}}}],"update_21":[{"value":{"original":"Loon","status":""},"var":{"created":"2024-03-11T16:43:10.459397-04:00","key":"NAME","operation":{"order":0,"source":"[execution]"}}}],"update_23":[{"value":{"original":"Hello world, Loon!\r\nsourishkrout\r\n","status":""},"var":{"created":"2024-03-11T16:43:10.525491-04:00","key":"__","operation":{"order":0,"source":"[execution]"}}}],"update_4":[{"value":{"original":"01HQ64XAYM289P5DF7CS0EJ54N","status":""},"var":{"created":"2024-03-11T16:42:59.978091-04:00","key":"RUNME_ID","operation":{"order":0,"source":"[execution]"}}},{"value":{"original":"xterm-256color","status":""},"var":{"created":"2024-03-11T16:42:59.978093-04:00","key":"TERM","operation":{"order":0,"source":"[execution]"}}}],"update_7":[{"value":{"original":"123","status":""},"var":{"created":"2024-03-11T16:43:00.153679-04:00","key":"NAKED","operation":{"order":0,"source":"[execution]"}}},{"value":{"original":"Seb","status":""},"var":{"created":"2024-03-11T16:43:00.153677-04:00","key":"NAME","operation":{"order":0,"source":"[execution]"}}},{"value":{"original":"nested","status":""},"var":{"created":"2024-03-11T16:43:00.153679-04:00","key":"INNER","operation":{"order":0,"source":"[execution]"}}},{"value":{"original":"Hello world","status":""},"var":{"created":"2024-03-11T16:43:00.153679-04:00","key":"MSG","operation":{"order":0,"source":"[execution]"}}}]}` query := `query ResolveOwlSnapshot($insecure: Boolean = false, $load_0: [VariableInput]!, $load_1: [VariableInput]!, $load_2: [VariableInput]!, $reconcile_3: [VariableInput]!, $update_4: [VariableInput]!, $reconcile_6: [VariableInput]!, $update_7: [VariableInput]!, $reconcile_9: [VariableInput]!, $update_10: [VariableInput]!, $reconcile_12: [VariableInput]!, $update_13: [VariableInput]!, $update_15: [VariableInput]!, $update_17: [VariableInput]!, $update_19: [VariableInput]!, $update_21: [VariableInput]!, $update_23: [VariableInput]!) { environment { load(vars: $load_0, hasSpecs: false) { @@ -98,41 +105,43 @@ func Test_Graph(t *testing.T) { spec sensitive mask - errors Password(insecure: $insecure, keys: ["KRAFTCLOUD_TOKEN"]) { spec sensitive mask - errors Plain(insecure: $insecure, keys: ["MSG", "OPENAI_ORG_ID", "NAME", "USER", "PWD", "COMMAND_MODE", "NAKED"]) { spec sensitive mask - errors Secret(insecure: $insecure, keys: ["OPENAI_API_KEY"]) { spec sensitive mask - errors done { - snapshot(insecure: $insecure) { - var { - key - origin - created - updated - operation { - source + render { + snapshot(insecure: $insecure) { + var { + key + origin + created + updated + operation { + source + } + } + value { + original + resolved + status + } + spec { + name + required + } + errors { + code + message } - } - value { - original - resolved - status - } - spec { - name - required } } } @@ -192,9 +201,13 @@ func Test_Graph(t *testing.T) { require.EqualValues(t, "LITERAL", v.Value.Status) require.EqualValues(t, "Plain", v.Spec.Name) } + b, err := yaml.Marshal(snapshot) + require.NoError(t, err) + fmt.Println(string(b)) + require.NotNil(t, b) }) - t.Run("query specs list", func(t *testing.T) { + t.Run("query list of specs", func(t *testing.T) { result := graphql.Do(graphql.Params{ Schema: Schema, RequestString: `query { specs { list { name } } }`, @@ -208,9 +221,9 @@ func Test_Graph(t *testing.T) { require.NotNil(t, b) }) - t.Run("query specs for real", func(t *testing.T) { + t.Run("query envs without specs", func(t *testing.T) { var vars map[string]interface{} - err := json.Unmarshal([]byte(`{"load_0":[{"var":{"key":"GOPATH","created":"2024-03-02T13:25:01.270468-05:00","operation":{"source":"[system]"}},"spec":{"checked":false,"name":"Opaque","required":false},"value":{"resolved":"/Users/sourishkrout/go","status":""}},{"var":{"created":"2024-03-02T13:25:01.270469-05:00","key":"HOME","operation":{"source":"[system]"}},"spec":{"checked":false,"name":"Secret","required":true},"value":{"resolved":"/Users/sourishkrout","status":""}},{"var":{"created":"2024-03-02T13:25:01.270471-05:00","key":"HOMEBREW_REPOSITORY","operation":{"source":"[system]"}},"spec":{"checked":false,"name":"Plain","required":false},"value":{"resolved":"/opt/homebrew","status":""}}]}`), &vars) + err := json.Unmarshal([]byte(`{"insecure":false,"load_0":[{"var":{"key":"GOPATH","created":"2024-03-02T13:25:01.270468-05:00","operation":{"source":"[system]"}},"spec":{"checked":false,"name":"Opaque","required":false},"value":{"resolved":"/Users/sourishkrout/go","status":""}},{"var":{"created":"2024-03-02T13:25:01.270469-05:00","key":"HOME","operation":{"source":"[system]"}},"spec":{"checked":false,"name":"Secret","required":true},"value":{"resolved":"/Users/sourishkrout","status":""}},{"var":{"created":"2024-03-02T13:25:01.270471-05:00","key":"HOMEBREW_REPOSITORY","operation":{"source":"[system]"}},"spec":{"checked":false,"name":"Plain","required":false},"value":{"resolved":"/opt/homebrew","status":""}}]}`), &vars) require.NoError(t, err) result := graphql.Do(graphql.Params{ @@ -226,35 +239,38 @@ func Test_Graph(t *testing.T) { spec sensitive mask - errors Secret(keys: ["HOME"]) { spec sensitive mask - errors Plain(keys: ["HOMEBREW_REPOSITORY"]) { spec sensitive mask - errors done { - snapshot(insecure: $insecure) { - var { - key - created - updated - operation { - source + render { + snapshot(insecure: $insecure) { + var { + key + created + updated + operation { + source + } + } + value { + original + resolved + status + } + spec { + name + required + } + errors { + code + message } - } - value { - original - resolved - status - } - spec { - name - required } } } @@ -270,16 +286,21 @@ func Test_Graph(t *testing.T) { require.False(t, result.HasErrors()) fmt.Println(result.Errors) - b, err := json.MarshalIndent(result, "", " ") + render, err := extractDataKey(result.Data, "render") + require.NoError(t, err) + require.NotNil(t, render) + + b, err := yaml.Marshal(render) + // b, err := json.MarshalIndent(result, "", " ") require.NoError(t, err) fmt.Println(string(b)) require.NotNil(t, b) }) } -func Test_Store_Update(t *testing.T) { +func Test_Graph_Update(t *testing.T) { var vars map[string]interface{} - err := json.Unmarshal([]byte(`{"insecure":false,"load_0":[{"value":{"original":"fi=00:mi=00:mh=00:ln=01;36:or=01;31:di=01;34:ow=04;01;34:st=34:tw=04;34:pi=01;33:so=01;33:do=01;33:bd=01;33:cd=01;33:su=01;35:sg=01;35:ca=01;35:ex=01;32","status":""},"var":{"created":"2024-03-10T20:48:58.072091-04:00","key":"LS_COLORS","operation":null}},{"value":{"original":"0","status":""},"var":{"created":"2024-03-10T20:48:58.072092-04:00","key":"MallocNanoZone","operation":null}},{"value":{"original":"0","status":""},"var":{"created":"2024-03-10T20:48:58.072102-04:00","key":"SHLVL","operation":null}},{"value":{"original":"/var/folders/c3/5r0t1nzs7sbfpxjgbc6n3ss40000gn/T/","status":""},"var":{"created":"2024-03-10T20:48:58.072104-04:00","key":"TMPDIR","operation":null}},{"value":{"original":"/Users/sourishkrout/.wasmtime","status":""},"var":{"created":"2024-03-10T20:48:58.072111-04:00","key":"WASMTIME_HOME","operation":null}},{"value":{"original":"1","status":""},"var":{"created":"2024-03-10T20:48:58.072115-04:00","key":"APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL","operation":null}},{"value":{"original":"/Users/sourishkrout/go","status":""},"var":{"created":"2024-03-10T20:48:58.072081-04:00","key":"GOPATH","operation":null}},{"value":{"original":"achristian","status":""},"var":{"created":"2024-03-10T20:48:58.072087-04:00","key":"KRAFTCLOUD_USER","operation":null}},{"value":{"original":"/private/tmp/com.apple.launchd.WJncT7ZrHW/Listeners","status":""},"var":{"created":"2024-03-10T20:48:58.072103-04:00","key":"SSH_AUTH_SOCK","operation":null}},{"value":{"original":"sourishkrout","status":""},"var":{"created":"2024-03-10T20:48:58.072107-04:00","key":"USER","operation":null}},{"value":{"original":"True","status":""},"var":{"created":"2024-03-10T20:48:58.072107-04:00","key":"USE_GKE_GCLOUD_AUTH_PLUGIN","operation":null}},{"value":{"original":"/","status":""},"var":{"created":"2024-03-10T20:48:58.072109-04:00","key":"VSCODE_CWD","operation":null}},{"value":{"original":"less","status":""},"var":{"created":"2024-03-10T20:48:58.072095-04:00","key":"PAGER","operation":null}},{"value":{"original":"/Users/sourishkrout/Library/Application Support/Code/1.87-main.sock","status":""},"var":{"created":"2024-03-10T20:48:58.07211-04:00","key":"VSCODE_IPC_HOOK","operation":null}},{"value":{"original":"{\"locale\":\"en-us\",\"osLocale\":\"en-us\",\"availableLanguages\":{},\"_languagePackSupport\":true}","status":""},"var":{"created":"2024-03-10T20:48:58.07211-04:00","key":"VSCODE_NLS_CONFIG","operation":null}},{"value":{"original":"com.microsoft.VSCode","status":""},"var":{"created":"2024-03-10T20:48:58.072113-04:00","key":"__CFBundleIdentifier","operation":null}},{"value":{"original":"0x1F5:0x0:0x0","status":""},"var":{"created":"2024-03-10T20:48:58.072114-04:00","key":"__CF_USER_TEXT_ENCODING","operation":null}},{"value":{"original":"/opt/homebrew","status":""},"var":{"created":"2024-03-10T20:48:58.072082-04:00","key":"HOMEBREW_PREFIX","operation":null}},{"value":{"original":"/opt/homebrew/share/info:","status":""},"var":{"created":"2024-03-10T20:48:58.072085-04:00","key":"INFOPATH","operation":null}},{"value":{"original":"sourishkrout","status":""},"var":{"created":"2024-03-10T20:48:58.072089-04:00","key":"LOGNAME","operation":null}},{"value":{"original":"0x0","status":""},"var":{"created":"2024-03-10T20:48:58.072112-04:00","key":"XPC_FLAGS","operation":null}},{"value":{"original":"/opt/homebrew/opt/asdf/libexec","status":""},"var":{"created":"2024-03-10T20:48:58.072076-04:00","key":"ASDF_DIR","operation":null}},{"value":{"original":"/Users/sourishkrout","status":""},"var":{"created":"2024-03-10T20:48:58.072081-04:00","key":"HOME","operation":null}},{"value":{"original":"ExGxDxDxCxDxDxFxFxexEx","status":""},"var":{"created":"2024-03-10T20:48:58.072089-04:00","key":"LSCOLORS","operation":null}},{"value":{"original":"/","status":""},"var":{"created":"2024-03-10T20:48:58.072096-04:00","key":"PWD","operation":null}},{"value":{"original":"extensionHost","status":""},"var":{"created":"2024-03-10T20:48:58.072108-04:00","key":"VSCODE_CRASH_REPORTER_PROCESS_TYPE","operation":null}},{"value":{"original":"true","status":""},"var":{"created":"2024-03-10T20:48:58.072109-04:00","key":"VSCODE_HANDLES_UNCAUGHT_ERRORS","operation":null}},{"value":{"original":"89716","status":""},"var":{"created":"2024-03-10T20:48:58.072111-04:00","key":"VSCODE_PID","operation":null}},{"value":{"original":"/Applications/Visual Studio Code.app/Contents/MacOS/Electron","status":""},"var":{"created":"2024-03-10T20:48:58.072113-04:00","key":"_","operation":null}},{"value":{"original":"unix2003","status":""},"var":{"created":"2024-03-10T20:48:58.07208-04:00","key":"COMMAND_MODE","operation":null}},{"value":{"original":"-iRFXMx4","status":""},"var":{"created":"2024-03-10T20:48:58.072088-04:00","key":"LESS","operation":null}},{"value":{"original":"1","status":""},"var":{"created":"2024-03-10T20:48:58.072115-04:00","key":"ELECTRON_RUN_AS_NODE","operation":null}},{"value":{"original":"/opt/homebrew/share/man:/usr/share/man:/usr/local/share/man:/Users/sourishkrout/.cache/zsh4humans/v5/fzf/man:","status":""},"var":{"created":"2024-03-10T20:48:58.072092-04:00","key":"MANPATH","operation":null}},{"value":{"original":"/","status":""},"var":{"created":"2024-03-10T20:48:58.072093-04:00","key":"OLDPWD","operation":null}},{"value":{"original":"/Users/sourishkrout/.terminfo","status":""},"var":{"created":"2024-03-10T20:48:58.072104-04:00","key":"TERMINFO","operation":null}},{"value":{"original":"application.com.microsoft.VSCode.251091548.251091554","status":""},"var":{"created":"2024-03-10T20:48:58.072112-04:00","key":"XPC_SERVICE_NAME","operation":null}},{"value":{"original":"undefined","status":""},"var":{"created":"2024-03-10T20:48:58.072094-04:00","key":"ORIGINAL_XDG_CURRENT_DESKTOP","operation":null}},{"value":{"original":"/bin/zsh","status":""},"var":{"created":"2024-03-10T20:48:58.072102-04:00","key":"SHELL","operation":null}},{"value":{"original":"xterm-256color","status":""},"var":{"created":"2024-03-10T20:48:58.072104-04:00","key":"TERM","operation":null}},{"value":{"original":"fi=00:mi=00:mh=00:ln=01;36:or=01;31:di=01;34:ow=01;34:st=34:tw=34:pi=01;33:so=01;33:do=01;33:bd=01;33:cd=01;33:su=01;35:sg=01;35:ca=01;35:ex=01;32","status":""},"var":{"created":"2024-03-10T20:48:58.072106-04:00","key":"TREE_COLORS","operation":null}},{"value":{"original":"/Users/sourishkrout/Projects/stateful/2022Q4/wasi-sdk/dist/wasi-sdk-16.5ga0a342ac182c","status":""},"var":{"created":"2024-03-10T20:48:58.072111-04:00","key":"WASI_SDK_PATH","operation":null}},{"value":{"original":"/Users/sourishkrout/.begin","status":""},"var":{"created":"2024-03-10T20:48:58.072079-04:00","key":"BEGIN_INSTALL","operation":null}},{"value":{"original":"/opt/homebrew/Cellar","status":""},"var":{"created":"2024-03-10T20:48:58.072082-04:00","key":"HOMEBREW_CELLAR","operation":null}},{"value":{"original":"/opt/homebrew/share/google-cloud-sdk/bin:/Users/sourishkrout/.wasmtime/bin:/opt/homebrew/opt/libpq/bin:/Users/sourishkrout/go/bin:/Users/sourishkrout/.asdf/shims:/opt/homebrew/opt/asdf/libexec/bin:/Users/sourishkrout/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Library/Apple/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/sourishkrout/.cache/zsh4humans/v5/fzf/bin:/Applications/Postgres.app/Contents/Versions/16/bin","status":""},"var":{"created":"2024-03-10T20:48:58.072095-04:00","key":"PATH","operation":null}},{"value":{"original":"vs/workbench/api/node/extensionHostProcess","status":""},"var":{"created":"2024-03-10T20:48:58.072108-04:00","key":"VSCODE_AMD_ENTRYPOINT","operation":null}},{"value":{"original":"/opt/homebrew","status":""},"var":{"created":"2024-03-10T20:48:58.072083-04:00","key":"HOMEBREW_REPOSITORY","operation":null}},{"value":{"original":"en_US.UTF-8","status":""},"var":{"created":"2024-03-10T20:48:58.072087-04:00","key":"LC_ALL","operation":null}}],"load_1":[{"spec":{"checked":false,"description":"Some name","name":"Plain","required":true},"var":{"created":"2024-03-10T20:48:58.072167-04:00","key":"NAME","operation":null}},{"spec":{"checked":false,"description":"No idea what mode this is","name":"Plain","required":true},"var":{"created":"2024-03-10T20:48:58.072165-04:00","key":"COMMAND_MODE","operation":null}},{"spec":{"checked":false,"description":"User","name":"Plain","required":false},"var":{"created":"2024-03-10T20:48:58.072166-04:00","key":"USER","operation":null}},{"spec":{"checked":false,"description":"The message","name":"Plain","required":true},"var":{"created":"2024-03-10T20:48:58.072168-04:00","key":"MSG","operation":null}},{"spec":{"checked":false,"description":"Working directory","name":"Plain","required":false},"var":{"created":"2024-03-10T20:48:58.072167-04:00","key":"PWD","operation":null}},{"spec":{"checked":false,"description":"Some value","name":"Plain","required":false},"var":{"created":"2024-03-10T20:48:58.072167-04:00","key":"NAKED","operation":null}}],"reconcile_12":[{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:49:29.262762-04:00","key":"__","operation":null}}],"reconcile_3":[{"value":{"status":"UNRESOLVED"},"var":{"created":"2024-03-10T20:48:58.072317-04:00","key":"NAME","operation":null}},{"value":{"status":"UNRESOLVED"},"var":{"created":"2024-03-10T20:48:58.072318-04:00","key":"NAKED","operation":null}},{"value":{"status":"UNRESOLVED"},"var":{"created":"2024-03-10T20:48:58.072318-04:00","key":"MSG","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.072307-04:00","key":"HOMEBREW_PREFIX","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.072315-04:00","key":"TERM","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.072316-04:00","key":"TREE_COLORS","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.072316-04:00","key":"WASI_SDK_PATH","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.072301-04:00","key":"TMPDIR","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.072303-04:00","key":"LS_COLORS","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.072304-04:00","key":"USE_GKE_GCLOUD_AUTH_PLUGIN","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.072303-04:00","key":"KRAFTCLOUD_USER","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.072308-04:00","key":"LOGNAME","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.072312-04:00","key":"VSCODE_PID","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.072313-04:00","key":"ELECTRON_RUN_AS_NODE","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.0723-04:00","key":"PATH","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.072301-04:00","key":"SHLVL","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.072301-04:00","key":"WASMTIME_HOME","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.072307-04:00","key":"__CF_USER_TEXT_ENCODING","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.072316-04:00","key":"HOMEBREW_CELLAR","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.072298-04:00","key":"VSCODE_AMD_ENTRYPOINT","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.072299-04:00","key":"HOMEBREW_REPOSITORY","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.072306-04:00","key":"SSH_AUTH_SOCK","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.07231-04:00","key":"VSCODE_CRASH_REPORTER_PROCESS_TYPE","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.072312-04:00","key":"_","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.072313-04:00","key":"LSCOLORS","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.072299-04:00","key":"LC_ALL","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.072302-04:00","key":"GOPATH","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.072308-04:00","key":"ASDF_DIR","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.072316-04:00","key":"BEGIN_INSTALL","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.072306-04:00","key":"VSCODE_NLS_CONFIG","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.072307-04:00","key":"VSCODE_IPC_HOOK","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.072309-04:00","key":"HOME","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.072311-04:00","key":"VSCODE_HANDLES_UNCAUGHT_ERRORS","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.072312-04:00","key":"LESS","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.072315-04:00","key":"MANPATH","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.072302-04:00","key":"APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.072304-04:00","key":"VSCODE_CWD","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.072305-04:00","key":"PAGER","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.072314-04:00","key":"XPC_SERVICE_NAME","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.072315-04:00","key":"SHELL","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.072306-04:00","key":"__CFBundleIdentifier","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.072308-04:00","key":"XPC_FLAGS","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.072314-04:00","key":"TERMINFO","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.072317-04:00","key":"ORIGINAL_XDG_CURRENT_DESKTOP","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.0723-04:00","key":"MallocNanoZone","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.072309-04:00","key":"INFOPATH","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.072313-04:00","key":"OLDPWD","operation":null}}],"reconcile_6":[{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:49:29.040802-04:00","key":"RUNME_ID","operation":null}}],"reconcile_9":[{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:49:29.228105-04:00","key":"INNER","operation":null}}],"update_10":[{"value":{"original":"Hello world, LPT!\r\nsourishkrout\r\n","status":""},"var":{"created":"2024-03-10T20:49:29.262703-04:00","key":"__","operation":null}}],"update_13":[{"value":{"original":"01HRF7RKVNFZCZ9P8GH7CNHZSY","status":""},"var":{"created":"2024-03-10T20:49:36.136807-04:00","key":"RUNME_ID","operation":null}},{"value":{"original":"xterm-256color","status":""},"var":{"created":"2024-03-10T20:49:36.136809-04:00","key":"TERM","operation":null}}],"update_17":[{"value":{"original":"Hello world\r\n123\r\nsourishkrout\r\nLPT\r\n/Users/sourishkrout/Projects/stateful/oss/vscode-runme/examples\r\nnested\r\n","status":""},"var":{"created":"2024-03-10T20:49:36.414365-04:00","key":"__","operation":null}}],"update_4":[{"value":{"original":"01HQ64XAYM289P5DF7CS0EJ54N","status":""},"var":{"created":"2024-03-10T20:49:29.040753-04:00","key":"RUNME_ID","operation":null}},{"value":{"original":"xterm-256color","status":""},"var":{"created":"2024-03-10T20:49:29.040755-04:00","key":"TERM","operation":null}}],"update_7":[{"value":{"original":"Hello world","status":""},"var":{"created":"2024-03-10T20:49:29.228017-04:00","key":"MSG","operation":null}},{"value":{"original":"nested","status":""},"var":{"created":"2024-03-10T20:49:29.228019-04:00","key":"INNER","operation":null}},{"value":{"original":"LPT","status":""},"var":{"created":"2024-03-10T20:49:29.228019-04:00","key":"NAME","operation":null}},{"value":{"original":"123","status":""},"var":{"created":"2024-03-10T20:49:29.22802-04:00","key":"NAKED","operation":null}}]}`), &vars) + err := json.Unmarshal([]byte(`{"insecure":true,"load_0":[{"value":{"original":"fi=00:mi=00:mh=00:ln=01;36:or=01;31:di=01;34:ow=04;01;34:st=34:tw=04;34:pi=01;33:so=01;33:do=01;33:bd=01;33:cd=01;33:su=01;35:sg=01;35:ca=01;35:ex=01;32","status":""},"var":{"created":"2024-03-10T20:48:58.072091-04:00","key":"LS_COLORS","operation":null}},{"value":{"original":"0","status":""},"var":{"created":"2024-03-10T20:48:58.072092-04:00","key":"MallocNanoZone","operation":null}},{"value":{"original":"0","status":""},"var":{"created":"2024-03-10T20:48:58.072102-04:00","key":"SHLVL","operation":null}},{"value":{"original":"/var/folders/c3/5r0t1nzs7sbfpxjgbc6n3ss40000gn/T/","status":""},"var":{"created":"2024-03-10T20:48:58.072104-04:00","key":"TMPDIR","operation":null}},{"value":{"original":"/Users/sourishkrout/.wasmtime","status":""},"var":{"created":"2024-03-10T20:48:58.072111-04:00","key":"WASMTIME_HOME","operation":null}},{"value":{"original":"1","status":""},"var":{"created":"2024-03-10T20:48:58.072115-04:00","key":"APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL","operation":null}},{"value":{"original":"/Users/sourishkrout/go","status":""},"var":{"created":"2024-03-10T20:48:58.072081-04:00","key":"GOPATH","operation":null}},{"value":{"original":"achristian","status":""},"var":{"created":"2024-03-10T20:48:58.072087-04:00","key":"KRAFTCLOUD_USER","operation":null}},{"value":{"original":"/private/tmp/com.apple.launchd.WJncT7ZrHW/Listeners","status":""},"var":{"created":"2024-03-10T20:48:58.072103-04:00","key":"SSH_AUTH_SOCK","operation":null}},{"value":{"original":"sourishkrout","status":""},"var":{"created":"2024-03-10T20:48:58.072107-04:00","key":"USER","operation":null}},{"value":{"original":"True","status":""},"var":{"created":"2024-03-10T20:48:58.072107-04:00","key":"USE_GKE_GCLOUD_AUTH_PLUGIN","operation":null}},{"value":{"original":"/","status":""},"var":{"created":"2024-03-10T20:48:58.072109-04:00","key":"VSCODE_CWD","operation":null}},{"value":{"original":"less","status":""},"var":{"created":"2024-03-10T20:48:58.072095-04:00","key":"PAGER","operation":null}},{"value":{"original":"/Users/sourishkrout/Library/Application Support/Code/1.87-main.sock","status":""},"var":{"created":"2024-03-10T20:48:58.07211-04:00","key":"VSCODE_IPC_HOOK","operation":null}},{"value":{"original":"{\"locale\":\"en-us\",\"osLocale\":\"en-us\",\"availableLanguages\":{},\"_languagePackSupport\":true}","status":""},"var":{"created":"2024-03-10T20:48:58.07211-04:00","key":"VSCODE_NLS_CONFIG","operation":null}},{"value":{"original":"com.microsoft.VSCode","status":""},"var":{"created":"2024-03-10T20:48:58.072113-04:00","key":"__CFBundleIdentifier","operation":null}},{"value":{"original":"0x1F5:0x0:0x0","status":""},"var":{"created":"2024-03-10T20:48:58.072114-04:00","key":"__CF_USER_TEXT_ENCODING","operation":null}},{"value":{"original":"/opt/homebrew","status":""},"var":{"created":"2024-03-10T20:48:58.072082-04:00","key":"HOMEBREW_PREFIX","operation":null}},{"value":{"original":"/opt/homebrew/share/info:","status":""},"var":{"created":"2024-03-10T20:48:58.072085-04:00","key":"INFOPATH","operation":null}},{"value":{"original":"sourishkrout","status":""},"var":{"created":"2024-03-10T20:48:58.072089-04:00","key":"LOGNAME","operation":null}},{"value":{"original":"0x0","status":""},"var":{"created":"2024-03-10T20:48:58.072112-04:00","key":"XPC_FLAGS","operation":null}},{"value":{"original":"/opt/homebrew/opt/asdf/libexec","status":""},"var":{"created":"2024-03-10T20:48:58.072076-04:00","key":"ASDF_DIR","operation":null}},{"value":{"original":"/Users/sourishkrout","status":""},"var":{"created":"2024-03-10T20:48:58.072081-04:00","key":"HOME","operation":null}},{"value":{"original":"ExGxDxDxCxDxDxFxFxexEx","status":""},"var":{"created":"2024-03-10T20:48:58.072089-04:00","key":"LSCOLORS","operation":null}},{"value":{"original":"/","status":""},"var":{"created":"2024-03-10T20:48:58.072096-04:00","key":"PWD","operation":null}},{"value":{"original":"extensionHost","status":""},"var":{"created":"2024-03-10T20:48:58.072108-04:00","key":"VSCODE_CRASH_REPORTER_PROCESS_TYPE","operation":null}},{"value":{"original":"true","status":""},"var":{"created":"2024-03-10T20:48:58.072109-04:00","key":"VSCODE_HANDLES_UNCAUGHT_ERRORS","operation":null}},{"value":{"original":"89716","status":""},"var":{"created":"2024-03-10T20:48:58.072111-04:00","key":"VSCODE_PID","operation":null}},{"value":{"original":"/Applications/Visual Studio Code.app/Contents/MacOS/Electron","status":""},"var":{"created":"2024-03-10T20:48:58.072113-04:00","key":"_","operation":null}},{"value":{"original":"unix2003","status":""},"var":{"created":"2024-03-10T20:48:58.07208-04:00","key":"COMMAND_MODE","operation":null}},{"value":{"original":"-iRFXMx4","status":""},"var":{"created":"2024-03-10T20:48:58.072088-04:00","key":"LESS","operation":null}},{"value":{"original":"1","status":""},"var":{"created":"2024-03-10T20:48:58.072115-04:00","key":"ELECTRON_RUN_AS_NODE","operation":null}},{"value":{"original":"/opt/homebrew/share/man:/usr/share/man:/usr/local/share/man:/Users/sourishkrout/.cache/zsh4humans/v5/fzf/man:","status":""},"var":{"created":"2024-03-10T20:48:58.072092-04:00","key":"MANPATH","operation":null}},{"value":{"original":"/","status":""},"var":{"created":"2024-03-10T20:48:58.072093-04:00","key":"OLDPWD","operation":null}},{"value":{"original":"/Users/sourishkrout/.terminfo","status":""},"var":{"created":"2024-03-10T20:48:58.072104-04:00","key":"TERMINFO","operation":null}},{"value":{"original":"application.com.microsoft.VSCode.251091548.251091554","status":""},"var":{"created":"2024-03-10T20:48:58.072112-04:00","key":"XPC_SERVICE_NAME","operation":null}},{"value":{"original":"undefined","status":""},"var":{"created":"2024-03-10T20:48:58.072094-04:00","key":"ORIGINAL_XDG_CURRENT_DESKTOP","operation":null}},{"value":{"original":"/bin/zsh","status":""},"var":{"created":"2024-03-10T20:48:58.072102-04:00","key":"SHELL","operation":null}},{"value":{"original":"xterm-256color","status":""},"var":{"created":"2024-03-10T20:48:58.072104-04:00","key":"TERM","operation":null}},{"value":{"original":"fi=00:mi=00:mh=00:ln=01;36:or=01;31:di=01;34:ow=01;34:st=34:tw=34:pi=01;33:so=01;33:do=01;33:bd=01;33:cd=01;33:su=01;35:sg=01;35:ca=01;35:ex=01;32","status":""},"var":{"created":"2024-03-10T20:48:58.072106-04:00","key":"TREE_COLORS","operation":null}},{"value":{"original":"/Users/sourishkrout/Projects/stateful/2022Q4/wasi-sdk/dist/wasi-sdk-16.5ga0a342ac182c","status":""},"var":{"created":"2024-03-10T20:48:58.072111-04:00","key":"WASI_SDK_PATH","operation":null}},{"value":{"original":"/Users/sourishkrout/.begin","status":""},"var":{"created":"2024-03-10T20:48:58.072079-04:00","key":"BEGIN_INSTALL","operation":null}},{"value":{"original":"/opt/homebrew/Cellar","status":""},"var":{"created":"2024-03-10T20:48:58.072082-04:00","key":"HOMEBREW_CELLAR","operation":null}},{"value":{"original":"/opt/homebrew/share/google-cloud-sdk/bin:/Users/sourishkrout/.wasmtime/bin:/opt/homebrew/opt/libpq/bin:/Users/sourishkrout/go/bin:/Users/sourishkrout/.asdf/shims:/opt/homebrew/opt/asdf/libexec/bin:/Users/sourishkrout/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Library/Apple/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/sourishkrout/.cache/zsh4humans/v5/fzf/bin:/Applications/Postgres.app/Contents/Versions/16/bin","status":""},"var":{"created":"2024-03-10T20:48:58.072095-04:00","key":"PATH","operation":null}},{"value":{"original":"vs/workbench/api/node/extensionHostProcess","status":""},"var":{"created":"2024-03-10T20:48:58.072108-04:00","key":"VSCODE_AMD_ENTRYPOINT","operation":null}},{"value":{"original":"/opt/homebrew","status":""},"var":{"created":"2024-03-10T20:48:58.072083-04:00","key":"HOMEBREW_REPOSITORY","operation":null}},{"value":{"original":"en_US.UTF-8","status":""},"var":{"created":"2024-03-10T20:48:58.072087-04:00","key":"LC_ALL","operation":null}}],"load_1":[{"spec":{"checked":false,"description":"Some name","name":"Plain","required":true},"var":{"created":"2024-03-10T20:48:58.072167-04:00","key":"NAME","operation":null}},{"spec":{"checked":false,"description":"No idea what mode this is","name":"Plain","required":true},"var":{"created":"2024-03-10T20:48:58.072165-04:00","key":"COMMAND_MODE","operation":null}},{"spec":{"checked":false,"description":"User","name":"Plain","required":false},"var":{"created":"2024-03-10T20:48:58.072166-04:00","key":"USER","operation":null}},{"spec":{"checked":false,"description":"The message","name":"Plain","required":true},"var":{"created":"2024-03-10T20:48:58.072168-04:00","key":"MSG","operation":null}},{"spec":{"checked":false,"description":"Working directory","name":"Plain","required":false},"var":{"created":"2024-03-10T20:48:58.072167-04:00","key":"PWD","operation":null}},{"spec":{"checked":false,"description":"Some value","name":"Plain","required":false},"var":{"created":"2024-03-10T20:48:58.072167-04:00","key":"NAKED","operation":null}}],"reconcile_12":[{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:49:29.262762-04:00","key":"__","operation":null}}],"reconcile_3":[{"value":{"status":"UNRESOLVED"},"var":{"created":"2024-03-10T20:48:58.072317-04:00","key":"NAME","operation":null}},{"value":{"status":"UNRESOLVED"},"var":{"created":"2024-03-10T20:48:58.072318-04:00","key":"NAKED","operation":null}},{"value":{"status":"UNRESOLVED"},"var":{"created":"2024-03-10T20:48:58.072318-04:00","key":"MSG","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.072307-04:00","key":"HOMEBREW_PREFIX","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.072315-04:00","key":"TERM","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.072316-04:00","key":"TREE_COLORS","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.072316-04:00","key":"WASI_SDK_PATH","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.072301-04:00","key":"TMPDIR","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.072303-04:00","key":"LS_COLORS","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.072304-04:00","key":"USE_GKE_GCLOUD_AUTH_PLUGIN","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.072303-04:00","key":"KRAFTCLOUD_USER","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.072308-04:00","key":"LOGNAME","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.072312-04:00","key":"VSCODE_PID","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.072313-04:00","key":"ELECTRON_RUN_AS_NODE","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.0723-04:00","key":"PATH","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.072301-04:00","key":"SHLVL","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.072301-04:00","key":"WASMTIME_HOME","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.072307-04:00","key":"__CF_USER_TEXT_ENCODING","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.072316-04:00","key":"HOMEBREW_CELLAR","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.072298-04:00","key":"VSCODE_AMD_ENTRYPOINT","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.072299-04:00","key":"HOMEBREW_REPOSITORY","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.072306-04:00","key":"SSH_AUTH_SOCK","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.07231-04:00","key":"VSCODE_CRASH_REPORTER_PROCESS_TYPE","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.072312-04:00","key":"_","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.072313-04:00","key":"LSCOLORS","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.072299-04:00","key":"LC_ALL","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.072302-04:00","key":"GOPATH","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.072308-04:00","key":"ASDF_DIR","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.072316-04:00","key":"BEGIN_INSTALL","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.072306-04:00","key":"VSCODE_NLS_CONFIG","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.072307-04:00","key":"VSCODE_IPC_HOOK","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.072309-04:00","key":"HOME","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.072311-04:00","key":"VSCODE_HANDLES_UNCAUGHT_ERRORS","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.072312-04:00","key":"LESS","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.072315-04:00","key":"MANPATH","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.072302-04:00","key":"APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.072304-04:00","key":"VSCODE_CWD","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.072305-04:00","key":"PAGER","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.072314-04:00","key":"XPC_SERVICE_NAME","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.072315-04:00","key":"SHELL","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.072306-04:00","key":"__CFBundleIdentifier","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.072308-04:00","key":"XPC_FLAGS","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.072314-04:00","key":"TERMINFO","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.072317-04:00","key":"ORIGINAL_XDG_CURRENT_DESKTOP","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.0723-04:00","key":"MallocNanoZone","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.072309-04:00","key":"INFOPATH","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:48:58.072313-04:00","key":"OLDPWD","operation":null}}],"reconcile_6":[{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:49:29.040802-04:00","key":"RUNME_ID","operation":null}}],"reconcile_9":[{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-10T20:49:29.228105-04:00","key":"INNER","operation":null}}],"update_10":[{"value":{"original":"Hello world, LPT!\r\nsourishkrout\r\n","status":""},"var":{"created":"2024-03-10T20:49:29.262703-04:00","key":"__","operation":null}}],"update_13":[{"value":{"original":"01HRF7RKVNFZCZ9P8GH7CNHZSY","status":""},"var":{"created":"2024-03-10T20:49:36.136807-04:00","key":"RUNME_ID","operation":null}},{"value":{"original":"xterm-256color","status":""},"var":{"created":"2024-03-10T20:49:36.136809-04:00","key":"TERM","operation":null}}],"update_17":[{"value":{"original":"Hello world\r\n123\r\nsourishkrout\r\nLPT\r\n/Users/sourishkrout/Projects/stateful/oss/vscode-runme/examples\r\nnested\r\n","status":""},"var":{"created":"2024-03-10T20:49:36.414365-04:00","key":"__","operation":null}}],"update_4":[{"value":{"original":"01HQ64XAYM289P5DF7CS0EJ54N","status":""},"var":{"created":"2024-03-10T20:49:29.040753-04:00","key":"RUNME_ID","operation":null}},{"value":{"original":"xterm-256color","status":""},"var":{"created":"2024-03-10T20:49:29.040755-04:00","key":"TERM","operation":null}}],"update_7":[{"value":{"original":"Hello world","status":""},"var":{"created":"2024-03-10T20:49:29.228017-04:00","key":"MSG","operation":null}},{"value":{"original":"nested","status":""},"var":{"created":"2024-03-10T20:49:29.228019-04:00","key":"INNER","operation":null}},{"value":{"original":"LPT","status":""},"var":{"created":"2024-03-10T20:49:29.228019-04:00","key":"NAME","operation":null}},{"value":{"original":"123","status":""},"var":{"created":"2024-03-10T20:49:29.22802-04:00","key":"NAKED","operation":null}}]}`), &vars) require.NoError(t, err) fakeQuery := `query ResolveOwlSnapshot($insecure: Boolean = false, $load_0: [VariableInput]!, $load_1: [VariableInput]!, $reconcile_3: [VariableInput]!, $update_4: [VariableInput]!, $reconcile_6: [VariableInput]!, $update_7: [VariableInput]!, $reconcile_9: [VariableInput]!, $update_10: [VariableInput]!, $reconcile_12: [VariableInput]!, $update_13: [VariableInput]!, $update_17: [VariableInput]!) { @@ -300,35 +321,36 @@ func Test_Store_Update(t *testing.T) { spec sensitive mask - errors Plain(insecure: $insecure, keys: ["MSG", "PWD", "NAKED", "NAME", "USER", "COMMAND_MODE", "OPENAI_ORG_ID"]) { spec sensitive mask - errors Secret(insecure: $insecure, keys: ["OPENAI_API_KEY", "KRAFTCLOUD_TOKEN"]) { spec sensitive mask - errors done { - snapshot(insecure: $insecure) { - var { - key - created - updated - operation { - source + render { + snapshot(insecure: $insecure) { + var { + key + created + updated + } + value { + original + resolved + status + } + spec { + name + required + checked + } + errors { + code + message } - } - value { - original - resolved - status - } - spec { - name - required } } } @@ -357,8 +379,173 @@ func Test_Store_Update(t *testing.T) { }) require.False(t, result.HasErrors()) + + render, err := extractDataKey(result.Data, "render") + require.NoError(t, err) + require.NotNil(t, render) + + // b, err := yaml.Marshal(render) // b, err := json.MarshalIndent(result, "", " ") // require.NoError(t, err) // fmt.Println(string(b)) // require.NotNil(t, b) } + +func Test_Graph_Required(t *testing.T) { + t.Run("validate simple environment", func(t *testing.T) { + var vars map[string]interface{} + err := json.Unmarshal([]byte(`{"load_0":[{"var":{"key":"GOPATH","created":"2024-03-02T13:25:01.270468-05:00","operation":{"order":0,"source":".env.example"}},"spec":{"checked":false,"name":"Opaque","required":true},"value":{"status":"UNRESOLVED"}},{"var":{"key":"HOME","created":"2024-03-02T13:25:01.270469-05:00","operation":{"order":0,"source":".env.example"}},"spec":{"checked":false,"name":"Opaque","required":false},"value":{"original":"/Users/sourishkrout","status":""}},{"var":{"key":"HOMEBREW_REPOSITORY","created":"2024-03-02T13:25:01.270471-05:00","operation":{"order":0,"source":".env.example"}},"spec":{"checked":false,"name":"Opaque","required":false},"value":{"original":"/opt/homebrew","status":""}}]}`), &vars) + require.NoError(t, err) + + result := graphql.Do(graphql.Params{ + Schema: Schema, + RequestString: `query ResolveOwlSnapshot($insecure: Boolean = false, $load_0: [VariableInput]!) { + environment { + load(vars: $load_0, hasSpecs: true) { + validate { + Opaque(insecure: $insecure, keys: ["GOPATH", "HOME", "HOMEBREW_REPOSITORY"]) { + spec + sensitive + mask + errors { + code + message + } + done { + render { + snapshot(insecure: $insecure) { + var { + key + origin + created + updated + } + value { + original + resolved + status + } + spec { + name + required + } + errors { + code + message + } + } + } + } + } + } + } + } +}`, + VariableValues: vars, + }) + fmt.Println(result.Errors) + require.False(t, result.HasErrors()) + + validate, err := extractDataKey(result.Data, "validate") + require.NoError(t, err) + require.NotNil(t, validate) + + b, err := yaml.Marshal(validate) + // b, err := json.MarshalIndent(result, "", " ") + require.NoError(t, err) + fmt.Println(string(b)) + require.NotNil(t, b) + }) +} + +func Test_Graph_LackOfOperation(t *testing.T) { + // todo(sebastian): prevent panic; needs more work + t.Run("MSG does not have operation associate", func(t *testing.T) { + var vars map[string]interface{} + err := json.Unmarshal([]byte(`{"insecure":false,"load_0":[{"value":{"original":"/opt/homebrew/share/man:/usr/share/man:/usr/local/share/man:/Users/sourishkrout/.cache/zsh4humans/v5/fzf/man:","status":""},"var":{"created":"2024-03-12T20:45:00.077665-04:00","key":"MANPATH","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"less","status":""},"var":{"created":"2024-03-12T20:45:00.077668-04:00","key":"PAGER","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"application.com.microsoft.VSCode.251091548.251091554","status":""},"var":{"created":"2024-03-12T20:45:00.07768-04:00","key":"XPC_SERVICE_NAME","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"/Users/sourishkrout/.begin","status":""},"var":{"created":"2024-03-12T20:45:00.077653-04:00","key":"BEGIN_INSTALL","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"/Users/sourishkrout/go","status":""},"var":{"created":"2024-03-12T20:45:00.077655-04:00","key":"GOPATH","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"fi=00:mi=00:mh=00:ln=01;36:or=01;31:di=01;34:ow=01;34:st=34:tw=34:pi=01;33:so=01;33:do=01;33:bd=01;33:cd=01;33:su=01;35:sg=01;35:ca=01;35:ex=01;32","status":""},"var":{"created":"2024-03-12T20:45:00.077675-04:00","key":"TREE_COLORS","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"sourishkrout","status":""},"var":{"created":"2024-03-12T20:45:00.077675-04:00","key":"USER","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"true","status":""},"var":{"created":"2024-03-12T20:45:00.077678-04:00","key":"VSCODE_HANDLES_UNCAUGHT_ERRORS","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"unix2003","status":""},"var":{"created":"2024-03-12T20:45:00.077654-04:00","key":"COMMAND_MODE","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"0","status":""},"var":{"created":"2024-03-12T20:45:00.077666-04:00","key":"MallocNanoZone","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"/opt/homebrew/share/info:","status":""},"var":{"created":"2024-03-12T20:45:00.077659-04:00","key":"INFOPATH","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"vs/workbench/api/node/extensionHostProcess","status":""},"var":{"created":"2024-03-12T20:45:00.077676-04:00","key":"VSCODE_AMD_ENTRYPOINT","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"extensionHost","status":""},"var":{"created":"2024-03-12T20:45:00.077677-04:00","key":"VSCODE_CRASH_REPORTER_PROCESS_TYPE","operation":{"order":0,"source":"[system]"}}},{"value":{"status":""},"var":{"created":"2024-03-12T20:45:00.077683-04:00","key":"VSCODE_L10N_BUNDLE_LOCATION","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"cmxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxlFl","status":""},"var":{"created":"2024-03-12T20:45:00.07766-04:00","key":"KRAFTCLOUD_TOKEN","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"/Users/sourishkrout/.wasmtime","status":""},"var":{"created":"2024-03-12T20:45:00.07768-04:00","key":"WASMTIME_HOME","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"0x0","status":""},"var":{"created":"2024-03-12T20:45:00.07768-04:00","key":"XPC_FLAGS","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"d8xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx188","status":""},"var":{"created":"2024-03-12T20:45:00.077654-04:00","key":"BUF_TOKEN","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"fi=00:mi=00:mh=00:ln=01;36:or=01;31:di=01;34:ow=04;01;34:st=34:tw=04;34:pi=01;33:so=01;33:do=01;33:bd=01;33:cd=01;33:su=01;35:sg=01;35:ca=01;35:ex=01;32","status":""},"var":{"created":"2024-03-12T20:45:00.077664-04:00","key":"LS_COLORS","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"/","status":""},"var":{"created":"2024-03-12T20:45:00.077677-04:00","key":"VSCODE_CWD","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"/Users/sourishkrout/Projects/stateful/2022Q4/wasi-sdk/dist/wasi-sdk-16.5ga0a342ac182c","status":""},"var":{"created":"2024-03-12T20:45:00.077679-04:00","key":"WASI_SDK_PATH","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"93046","status":""},"var":{"created":"2024-03-12T20:45:00.077679-04:00","key":"VSCODE_PID","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"/Applications/Visual Studio Code.app/Contents/MacOS/Electron","status":""},"var":{"created":"2024-03-12T20:45:00.077681-04:00","key":"_","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"/opt/homebrew/opt/asdf/libexec","status":""},"var":{"created":"2024-03-12T20:45:00.077651-04:00","key":"ASDF_DIR","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"sourishkrout","status":""},"var":{"created":"2024-03-12T20:45:00.077662-04:00","key":"LOGNAME","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"/opt/homebrew/share/google-cloud-sdk/bin:/Users/sourishkrout/.wasmtime/bin:/opt/homebrew/opt/libpq/bin:/Users/sourishkrout/go/bin:/Users/sourishkrout/.asdf/shims:/opt/homebrew/opt/asdf/libexec/bin:/Users/sourishkrout/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Library/Apple/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/sourishkrout/.cache/zsh4humans/v5/fzf/bin:/Applications/Postgres.app/Contents/Versions/16/bin","status":""},"var":{"created":"2024-03-12T20:45:00.077668-04:00","key":"PATH","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"1","status":""},"var":{"created":"2024-03-12T20:45:00.077682-04:00","key":"ELECTRON_RUN_AS_NODE","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"en_US.UTF-8","status":""},"var":{"created":"2024-03-12T20:45:00.077661-04:00","key":"LC_ALL","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"undefined","status":""},"var":{"created":"2024-03-12T20:45:00.077667-04:00","key":"ORIGINAL_XDG_CURRENT_DESKTOP","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"/var/folders/c3/5r0t1nzs7sbfpxjgbc6n3ss40000gn/T/","status":""},"var":{"created":"2024-03-12T20:45:00.077674-04:00","key":"TMPDIR","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"/Users/sourishkrout","status":""},"var":{"created":"2024-03-12T20:45:00.077655-04:00","key":"HOME","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"xxxxxxxx-a41e-xxxx-xxxx-xxxxxxxxxxxx","status":""},"var":{"created":"2024-03-12T20:45:00.07766-04:00","key":"INSTRUMENTATION_KEY","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"achristian","status":""},"var":{"created":"2024-03-12T20:45:00.077661-04:00","key":"KRAFTCLOUD_USER","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"0x1F5:0x0:0x0","status":""},"var":{"created":"2024-03-12T20:45:00.077682-04:00","key":"__CF_USER_TEXT_ENCODING","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"sk-Kxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxq","status":""},"var":{"created":"2024-03-12T20:45:00.077666-04:00","key":"OPENAI_API_KEY","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"/opt/homebrew","status":""},"var":{"created":"2024-03-12T20:45:00.077657-04:00","key":"HOMEBREW_REPOSITORY","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"/Users/sourishkrout/.terminfo","status":""},"var":{"created":"2024-03-12T20:45:00.077673-04:00","key":"TERMINFO","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"/opt/homebrew/Cellar","status":""},"var":{"created":"2024-03-12T20:45:00.077656-04:00","key":"HOMEBREW_CELLAR","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"org-tmxxxxxxxxxxxxxxxxxxxxk0","status":""},"var":{"created":"2024-03-12T20:45:00.077667-04:00","key":"OPENAI_ORG_ID","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"com.microsoft.VSCode","status":""},"var":{"created":"2024-03-12T20:45:00.077681-04:00","key":"__CFBundleIdentifier","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"/opt/homebrew","status":""},"var":{"created":"2024-03-12T20:45:00.077656-04:00","key":"HOMEBREW_PREFIX","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"ExGxDxDxCxDxDxFxFxexEx","status":""},"var":{"created":"2024-03-12T20:45:00.077663-04:00","key":"LSCOLORS","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"/bin/zsh","status":""},"var":{"created":"2024-03-12T20:45:00.077671-04:00","key":"SHELL","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"0","status":""},"var":{"created":"2024-03-12T20:45:00.077672-04:00","key":"SHLVL","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"/private/tmp/com.apple.launchd.WJncT7ZrHW/Listeners","status":""},"var":{"created":"2024-03-12T20:45:00.077672-04:00","key":"SSH_AUTH_SOCK","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"1","status":""},"var":{"created":"2024-03-12T20:45:00.077682-04:00","key":"APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"-iRFXMx4","status":""},"var":{"created":"2024-03-12T20:45:00.077662-04:00","key":"LESS","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"/","status":""},"var":{"created":"2024-03-12T20:45:00.077666-04:00","key":"OLDPWD","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"xterm-256color","status":""},"var":{"created":"2024-03-12T20:45:00.077673-04:00","key":"TERM","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"{\"locale\":\"en-us\",\"osLocale\":\"en-us\",\"availableLanguages\":{},\"_languagePackSupport\":true}","status":""},"var":{"created":"2024-03-12T20:45:00.077678-04:00","key":"VSCODE_NLS_CONFIG","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"/","status":""},"var":{"created":"2024-03-12T20:45:00.077669-04:00","key":"PWD","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"True","status":""},"var":{"created":"2024-03-12T20:45:00.077676-04:00","key":"USE_GKE_GCLOUD_AUTH_PLUGIN","operation":{"order":0,"source":"[system]"}}},{"value":{"original":"/Users/sourishkrout/Library/Application Support/Code/1.87-main.sock","status":""},"var":{"created":"2024-03-12T20:45:00.077678-04:00","key":"VSCODE_IPC_HOOK","operation":{"order":0,"source":"[system]"}}}],"load_1":[{"spec":{"checked":false,"description":"Some value","name":"Plain","required":false},"var":{"created":"2024-03-12T20:45:00.077717-04:00","key":"NAKED","operation":{"order":0,"source":".env.example"}}},{"spec":{"checked":false,"description":"Some name","name":"Plain","required":true},"var":{"created":"2024-03-12T20:45:00.077718-04:00","key":"NAME","operation":{"order":0,"source":".env.example"}}},{"spec":{"checked":false,"description":"No idea what mode this is","name":"Plain","required":true},"var":{"created":"2024-03-12T20:45:00.07772-04:00","key":"COMMAND_MODE","operation":{"order":0,"source":".env.example"}}},{"spec":{"checked":false,"description":"","name":"Plain","required":true},"var":{"created":"2024-03-12T20:45:00.07772-04:00","key":"MSG","operation":{"order":0,"source":".env.example"}}},{"spec":{"checked":false,"description":"Working directory","name":"Plain","required":false},"var":{"created":"2024-03-12T20:45:00.077718-04:00","key":"PWD","operation":{"order":0,"source":".env.example"}}},{"spec":{"checked":false,"description":"Your OpenAI API key matching the org","name":"Secret","required":true},"var":{"created":"2024-03-12T20:45:00.077719-04:00","key":"OPENAI_API_KEY","operation":{"order":0,"source":".env.example"}}},{"spec":{"checked":false,"description":"This is secret","name":"Password","required":true},"var":{"created":"2024-03-12T20:45:00.077719-04:00","key":"KRAFTCLOUD_TOKEN","operation":{"order":0,"source":".env.example"}}},{"spec":{"checked":false,"description":"","name":"Plain","required":true},"var":{"created":"2024-03-12T20:45:00.077719-04:00","key":"USER","operation":{"order":0,"source":".env.example"}}},{"spec":{"checked":false,"description":"Your OpenAI org identifier","name":"Plain","required":true},"var":{"created":"2024-03-12T20:45:00.07772-04:00","key":"OPENAI_ORG_ID","operation":{"order":0,"source":".env.example"}}}],"load_2":[{"value":{"original":"Luna","status":""},"var":{"created":"2024-03-12T20:45:00.077722-04:00","key":"NAME","operation":{"order":0,"source":".env"}}}],"reconcile_3":[{"value":{"status":"UNRESOLVED"},"var":{"created":"2024-03-12T20:45:00.077916-04:00","key":"MSG","operation":null}},{"value":{"status":"UNRESOLVED"},"var":{"created":"2024-03-12T20:45:00.077916-04:00","key":"NAKED","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-12T20:45:00.077911-04:00","key":"__CFBundleIdentifier","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-12T20:45:00.077911-04:00","key":"LSCOLORS","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-12T20:45:00.077912-04:00","key":"SHLVL","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-12T20:45:00.077913-04:00","key":"LESS","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-12T20:45:00.077903-04:00","key":"WASMTIME_HOME","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-12T20:45:00.077902-04:00","key":"LS_COLORS","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-12T20:45:00.077906-04:00","key":"ORIGINAL_XDG_CURRENT_DESKTOP","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-12T20:45:00.077908-04:00","key":"KRAFTCLOUD_USER","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-12T20:45:00.077913-04:00","key":"SSH_AUTH_SOCK","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-12T20:45:00.077895-04:00","key":"GOPATH","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-12T20:45:00.077898-04:00","key":"INFOPATH","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-12T20:45:00.0779-04:00","key":"XPC_FLAGS","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-12T20:45:00.077902-04:00","key":"VSCODE_CWD","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-12T20:45:00.077903-04:00","key":"_","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-12T20:45:00.077903-04:00","key":"ASDF_DIR","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-12T20:45:00.077908-04:00","key":"INSTRUMENTATION_KEY","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-12T20:45:00.077915-04:00","key":"USE_GKE_GCLOUD_AUTH_PLUGIN","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-12T20:45:00.077897-04:00","key":"MallocNanoZone","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-12T20:45:00.077906-04:00","key":"TMPDIR","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-12T20:45:00.077907-04:00","key":"HOME","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-12T20:45:00.077912-04:00","key":"SHELL","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-12T20:45:00.077914-04:00","key":"OLDPWD","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-12T20:45:00.077914-04:00","key":"TERM","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-12T20:45:00.077915-04:00","key":"VSCODE_IPC_HOOK","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-12T20:45:00.077899-04:00","key":"VSCODE_AMD_ENTRYPOINT","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-12T20:45:00.077915-04:00","key":"VSCODE_NLS_CONFIG","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-12T20:45:00.077895-04:00","key":"TREE_COLORS","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-12T20:45:00.077899-04:00","key":"VSCODE_CRASH_REPORTER_PROCESS_TYPE","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-12T20:45:00.077904-04:00","key":"LOGNAME","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-12T20:45:00.077905-04:00","key":"VSCODE_PID","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-12T20:45:00.077905-04:00","key":"ELECTRON_RUN_AS_NODE","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-12T20:45:00.077905-04:00","key":"LC_ALL","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-12T20:45:00.07791-04:00","key":"HOMEBREW_CELLAR","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-12T20:45:00.077896-04:00","key":"XPC_SERVICE_NAME","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-12T20:45:00.077901-04:00","key":"BUF_TOKEN","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-12T20:45:00.07791-04:00","key":"HOMEBREW_REPOSITORY","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-12T20:45:00.077913-04:00","key":"APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-12T20:45:00.0779-04:00","key":"VSCODE_L10N_BUNDLE_LOCATION","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-12T20:45:00.077894-04:00","key":"PAGER","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-12T20:45:00.077895-04:00","key":"BEGIN_INSTALL","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-12T20:45:00.077896-04:00","key":"VSCODE_HANDLES_UNCAUGHT_ERRORS","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-12T20:45:00.077902-04:00","key":"WASI_SDK_PATH","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-12T20:45:00.077904-04:00","key":"PATH","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-12T20:45:00.077909-04:00","key":"__CF_USER_TEXT_ENCODING","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-12T20:45:00.07791-04:00","key":"TERMINFO","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-12T20:45:00.077894-04:00","key":"MANPATH","operation":null}},{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-12T20:45:00.077911-04:00","key":"HOMEBREW_PREFIX","operation":null}}],"reconcile_6":[{"spec":{"checked":false,"description":"","name":"Opaque","required":false},"var":{"created":"2024-03-12T20:45:05.291937-04:00","key":"RUNME_ID","operation":null}}],"update_4":[{"value":{"original":"01HRAZTSXWC0NX5Y3DAK9ZVG64","status":""},"var":{"created":"2024-03-12T20:45:05.291876-04:00","key":"RUNME_ID","operation":{"order":0,"source":"[execution]"}}},{"value":{"original":"xterm-256color","status":""},"var":{"created":"2024-03-12T20:45:05.291877-04:00","key":"TERM","operation":{"order":0,"source":"[execution]"}}}]}`), &vars) + require.NoError(t, err) + + result := graphql.Do(graphql.Params{ + Schema: Schema, + RequestString: `query ResolveOwlSnapshot($insecure: Boolean = false, $load_0: [VariableInput]!, $load_1: [VariableInput]!, $load_2: [VariableInput]!, $reconcile_3: [VariableInput]!, $update_4: [VariableInput]!, $reconcile_6: [VariableInput]!) { + environment { + load(vars: $load_0, hasSpecs: false) { + load(vars: $load_1, hasSpecs: true) { + load(vars: $load_2, hasSpecs: false) { + reconcile(vars: $reconcile_3, hasSpecs: true) { + update(vars: $update_4, hasSpecs: false) { + reconcile(vars: $reconcile_6, hasSpecs: true) { + validate { + Opaque(insecure: $insecure, keys: ["VSCODE_NLS_CONFIG", "VSCODE_CRASH_REPORTER_PROCESS_TYPE", "WASI_SDK_PATH", "VSCODE_CWD", "OLDPWD", "INSTRUMENTATION_KEY", "SHELL", "PATH", "LS_COLORS", "MallocNanoZone", "LOGNAME", "_", "VSCODE_PID", "APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL", "VSCODE_HANDLES_UNCAUGHT_ERRORS", "GOPATH", "XPC_FLAGS", "VSCODE_IPC_HOOK", "TMPDIR", "LC_ALL", "LESS", "PAGER", "BUF_TOKEN", "HOMEBREW_REPOSITORY", "TERM", "MANPATH", "WASMTIME_HOME", "LSCOLORS", "USE_GKE_GCLOUD_AUTH_PLUGIN", "__CF_USER_TEXT_ENCODING", "BEGIN_INSTALL", "ORIGINAL_XDG_CURRENT_DESKTOP", "RUNME_ID", "KRAFTCLOUD_USER", "ASDF_DIR", "INFOPATH", "TERMINFO", "SSH_AUTH_SOCK", "VSCODE_AMD_ENTRYPOINT", "HOMEBREW_CELLAR", "VSCODE_L10N_BUNDLE_LOCATION", "HOMEBREW_PREFIX", "__CFBundleIdentifier", "HOME", "SHLVL", "XPC_SERVICE_NAME", "TREE_COLORS", "ELECTRON_RUN_AS_NODE"]) { + spec + sensitive + mask + Password(insecure: $insecure, keys: ["KRAFTCLOUD_TOKEN"]) { + spec + sensitive + mask + Plain(insecure: $insecure, keys: ["NAME", "MSG", "PWD", "USER", "NAKED", "COMMAND_MODE", "OPENAI_ORG_ID"]) { + spec + sensitive + mask + Secret(insecure: $insecure, keys: ["OPENAI_API_KEY"]) { + spec + sensitive + mask + done { + render { + snapshot(insecure: $insecure) { + var { + key + origin + created + updated + operation { + source + } + } + value { + original + resolved + status + } + spec { + name + required + } + errors { + code + message + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } +}`, + VariableValues: vars, + }) + fmt.Println(result.Errors) + require.False(t, result.HasErrors()) + + validate, err := extractDataKey(result.Data, "validate") + require.NoError(t, err) + require.NotNil(t, validate) + + b, err := yaml.Marshal(validate) + // b, err := json.MarshalIndent(result, "", " ") + require.NoError(t, err) + fmt.Println(string(b)) + require.NotNil(t, b) + }) +} diff --git a/internal/owl/query.go b/internal/owl/query.go index 395102c7e..25cb2f8d9 100644 --- a/internal/owl/query.go +++ b/internal/owl/query.go @@ -74,6 +74,50 @@ func (s *Store) snapshotQuery(query, vars io.StringWriter) error { return nil } +func (s *Store) validateQuery(query, vars io.StringWriter) error { + varDefs := []*ast.VariableDefinition{ + ast.NewVariableDefinition(&ast.VariableDefinition{ + Variable: ast.NewVariable(&ast.Variable{ + Name: ast.NewName(&ast.Name{ + Value: "insecure", + }), + }), + Type: ast.NewNamed(&ast.Named{ + Name: ast.NewName(&ast.Name{ + Value: "Boolean", + }), + }), + DefaultValue: ast.NewBooleanValue(&ast.BooleanValue{ + Value: false, + }), + }), + } + + q, err := NewQuery("Validate", varDefs, + []QueryNodeReducer{ + reconcileAsymmetry(s), + reduceSetOperations(s, vars), + reduceSepcs(s), + reduceSnapshot(), + }, + ) + if err != nil { + return err + } + + text, err := q.Print() + if err != nil { + return err + } + + _, err = query.WriteString(text) + if err != nil { + return err + } + + return nil +} + func reduceSetOperations(store *Store, vars io.StringWriter) QueryNodeReducer { return func(opDef *ast.OperationDefinition, selSet *ast.SelectionSet) (*ast.SelectionSet, error) { opSetData := make(map[string]SetVarItems, len(store.opSets)) @@ -277,29 +321,58 @@ func reduceSnapshot() QueryNodeReducer { }, }), }), + ast.NewField(&ast.Field{ + Name: ast.NewName(&ast.Name{ + Value: "errors", + }), + SelectionSet: ast.NewSelectionSet(&ast.SelectionSet{ + Selections: []ast.Selection{ + ast.NewField(&ast.Field{ + Name: ast.NewName(&ast.Name{ + Value: "code", + }), + }), + ast.NewField(&ast.Field{ + Name: ast.NewName(&ast.Name{ + Value: "message", + }), + }), + }, + }), + }), }, }) selSet.Selections = append(selSet.Selections, ast.NewField(&ast.Field{ Name: ast.NewName(&ast.Name{ - Value: "snapshot", + Value: "render", }), - Arguments: []*ast.Argument{ - ast.NewArgument(&ast.Argument{ - Name: ast.NewName(&ast.Name{ - Value: "insecure", - }), - Value: ast.NewVariable(&ast.Variable{ + SelectionSet: ast.NewSelectionSet(&ast.SelectionSet{ + Selections: []ast.Selection{ + ast.NewField(&ast.Field{ Name: ast.NewName(&ast.Name{ - Value: "insecure", + Value: "snapshot", }), + Arguments: []*ast.Argument{ + ast.NewArgument(&ast.Argument{ + Name: ast.NewName(&ast.Name{ + Value: "insecure", + }), + Value: ast.NewVariable(&ast.Variable{ + Name: ast.NewName(&ast.Name{ + Value: "insecure", + }), + }), + }), + }, + SelectionSet: nextSelSet, }), - }), - }, - SelectionSet: nextSelSet, + }, + }), }), ) + return nextSelSet, nil } } @@ -419,11 +492,11 @@ func reduceSepcs(store *Store) QueryNodeReducer { Value: "mask", }), }), - ast.NewField(&ast.Field{ - Name: ast.NewName(&ast.Name{ - Value: "errors", - }), - }), + // ast.NewField(&ast.Field{ + // Name: ast.NewName(&ast.Name{ + // Value: "errors", + // }), + // }), }, }) diff --git a/internal/owl/store.go b/internal/owl/store.go index 6e1d69ac2..4aeaf370e 100644 --- a/internal/owl/store.go +++ b/internal/owl/store.go @@ -5,14 +5,12 @@ import ( "encoding/json" "errors" "fmt" - "io" "slices" "strings" "sync" "time" "github.com/graphql-go/graphql" - "github.com/graphql-go/graphql/language/ast" "github.com/stateful/godotenv" "go.uber.org/zap" ) @@ -52,10 +50,11 @@ type varValue struct { } type varSpec struct { - Name string `json:"name"` - Required bool `json:"required"` - Description string `json:"description"` - Checked bool `json:"checked"` + Name string `json:"name"` + Required bool `json:"required"` + Description string `json:"description"` + Error ValidationError `json:"-"` + Checked bool `json:"checked"` } type SetVar struct { @@ -76,10 +75,16 @@ type SetVarValue struct { Value *varValue `json:"value,omitempty"` } +type SetVarError struct { + Code int `json:"code,omitempty"` + Message string `json:"message,omitempty"` +} + type SetVarItem struct { - Var *SetVar `json:"var,omitempty"` - Value *varValue `json:"value,omitempty"` - Spec *varSpec `json:"spec,omitempty"` + Var *SetVar `json:"var,omitempty"` + Value *varValue `json:"value,omitempty"` + Spec *varSpec `json:"spec,omitempty"` + Errors []*SetVarError `json:"errors,omitempty"` } type SetVarItems []*SetVarItem @@ -348,50 +353,6 @@ func (s *Store) Update(newOrUpdated, deleted []string) error { return nil } -func (s *Store) validateQuery(query, vars io.StringWriter) error { - varDefs := []*ast.VariableDefinition{ - ast.NewVariableDefinition(&ast.VariableDefinition{ - Variable: ast.NewVariable(&ast.Variable{ - Name: ast.NewName(&ast.Name{ - Value: "insecure", - }), - }), - Type: ast.NewNamed(&ast.Named{ - Name: ast.NewName(&ast.Name{ - Value: "Boolean", - }), - }), - DefaultValue: ast.NewBooleanValue(&ast.BooleanValue{ - Value: false, - }), - }), - } - - q, err := NewQuery("Validate", varDefs, - []QueryNodeReducer{ - reconcileAsymmetry(s), - reduceSetOperations(s, vars), - reduceSepcs(s), - reduceSnapshot(), - }, - ) - if err != nil { - return err - } - - text, err := q.Print() - if err != nil { - return err - } - - _, err = query.WriteString(text) - if err != nil { - return err - } - - return nil -} - func (s *Store) snapshot(insecure bool) (SetVarItems, error) { var query, vars bytes.Buffer err := s.snapshotQuery(&query, &vars) diff --git a/internal/owl/store_test.go b/internal/owl/store_test.go index 0f32f0554..ea1186b22 100644 --- a/internal/owl/store_test.go +++ b/internal/owl/store_test.go @@ -370,3 +370,62 @@ func Test_Store_FixtureWithoutSpecs(t *testing.T) { require.EqualValues(t, "LITERAL", snapshot[3].Value.Status) }) } + +func Test_Store_Validation(t *testing.T) { + t.Parallel() + + fakeErrs := []byte(`GOPATH= +INSTRUMENTATION_KEY=Instrumentation key for env # Secret! +PGPASS=Your database password # Password! +HOMEBREW_REPOSITORY= # Plain`) + store, err := NewStore(WithSpecFile(".env.example", fakeErrs)) + require.NoError(t, err) + require.NotNil(t, store) + + t.Run("Insecure is false", func(t *testing.T) { + snapshot, err := store.snapshot(false) + require.NoError(t, err) + require.NotNil(t, snapshot) + + snapshot.sortbyKey() + + snapshot0 := snapshot[0] + require.EqualValues(t, "GOPATH", snapshot0.Var.Key) + require.EqualValues(t, "Opaque", snapshot0.Spec.Name) + require.EqualValues(t, false, snapshot0.Spec.Required) + require.EqualValues(t, "", snapshot0.Value.Resolved) + require.EqualValues(t, "", snapshot0.Value.Original) + require.EqualValues(t, "HIDDEN", snapshot0.Value.Status) + require.LessOrEqual(t, len(snapshot0.Errors), 0) + + snapshot1 := snapshot[1] + require.EqualValues(t, "HOMEBREW_REPOSITORY", snapshot1.Var.Key) + require.EqualValues(t, "Plain", snapshot1.Spec.Name) + require.EqualValues(t, false, snapshot1.Spec.Required) + require.EqualValues(t, "", snapshot1.Value.Resolved) + require.EqualValues(t, "", snapshot1.Value.Original) + require.EqualValues(t, "LITERAL", snapshot1.Value.Status) + require.LessOrEqual(t, len(snapshot1.Errors), 0) + + snapshot2 := snapshot[2] + require.EqualValues(t, "INSTRUMENTATION_KEY", snapshot2.Var.Key) + require.EqualValues(t, "Secret", snapshot2.Spec.Name) + require.EqualValues(t, true, snapshot2.Spec.Required) + require.EqualValues(t, "", snapshot2.Value.Resolved) + require.EqualValues(t, "", snapshot2.Value.Original) + require.EqualValues(t, "UNRESOLVED", snapshot2.Value.Status) + require.Greater(t, len(snapshot2.Errors), 0) + require.EqualValues(t, snapshot2.Errors[0].Code, 0) + require.EqualValues(t, snapshot2.Errors[0], &SetVarError{Code: 0, Message: "Error 0: Variable \"INSTRUMENTATION_KEY\" is unresolved but defined as required by \"Secret!\" in \"-\""}) + + snapshot3 := snapshot[3] + require.EqualValues(t, "PGPASS", snapshot3.Var.Key) + require.EqualValues(t, "Password", snapshot3.Spec.Name) + require.EqualValues(t, true, snapshot3.Spec.Required) + require.EqualValues(t, "", snapshot3.Value.Resolved) + require.EqualValues(t, "", snapshot3.Value.Original) + require.EqualValues(t, "UNRESOLVED", snapshot3.Value.Status) + require.Greater(t, len(snapshot3.Errors), 0) + require.EqualValues(t, snapshot3.Errors[0], &SetVarError{Code: 0, Message: "Error 0: Variable \"PGPASS\" is unresolved but defined as required by \"Password!\" in \"-\""}) + }) +} diff --git a/internal/owl/validate.go b/internal/owl/validate.go new file mode 100644 index 000000000..feadb0fc0 --- /dev/null +++ b/internal/owl/validate.go @@ -0,0 +1,79 @@ +package owl + +import "fmt" + +type ValidationError interface { + fmt.Stringer + VarItem() *SetVarItem + Error() string + Message() string + Key() string + SpecName() string + Source() string + Code() ValidateErrorType +} + +type ValidationErrors []ValidationError + +type ValidateErrorType int + +const ( + ValidateErrorVarRequired ValidateErrorType = iota +) + +type RequiredError struct { + varItem *SetVarItem + code ValidateErrorType +} + +func NewRequiredError(varItem *SetVarItem) *RequiredError { + return &RequiredError{ + varItem: varItem, + code: ValidateErrorVarRequired, + } +} + +func (e RequiredError) VarItem() *SetVarItem { + return e.varItem +} + +func (e RequiredError) Error() string { + return fmt.Sprintf("Error %v: Variable \"%s\" is unresolved but defined as required by \"%s!\" in \"%s\"", + e.Code(), + e.Key(), + e.SpecName(), + e.Source()) +} + +func (e RequiredError) Message() string { + return e.Error() +} + +func (e RequiredError) String() string { + return e.Error() +} + +func (e RequiredError) Code() ValidateErrorType { + return e.code +} + +func (e RequiredError) Key() string { + return e.varItem.Var.Key +} + +func (e RequiredError) SpecName() string { + return e.varItem.Spec.Name +} + +func (e RequiredError) Source() string { + if e.varItem.Var.Operation == nil { + return "-" + } + return e.varItem.Var.Operation.Source +} + +// make sure interfaces are satisfied +var ( + _ ValidationError = new(RequiredError) + _ error = new(RequiredError) +) diff --git a/internal/runner/service.go b/internal/runner/service.go index ca1b73153..2a79fa796 100644 --- a/internal/runner/service.go +++ b/internal/runner/service.go @@ -788,7 +788,7 @@ func convertToMonitorEnvStoreResponse(msg *runnerv1.MonitorEnvStoreResponse, sna default: // noop } - envsSnapshot = append(envsSnapshot, &runnerv1.MonitorEnvStoreResponseSnapshot_SnapshotEnv{ + es := &runnerv1.MonitorEnvStoreResponseSnapshot_SnapshotEnv{ Name: item.Var.Key, Spec: item.Spec.Name, Origin: item.Var.Origin, @@ -797,7 +797,18 @@ func convertToMonitorEnvStoreResponse(msg *runnerv1.MonitorEnvStoreResponse, sna Status: status, CreateTime: item.Var.Created.String(), UpdateTime: item.Var.Updated.String(), - }) + Errors: []*runnerv1.MonitorEnvStoreResponseSnapshot_Error{}, + } + for _, verr := range item.Errors { + if verr.Code < 0 { + return fmt.Errorf("negative error code: %d", verr.Code) + } + es.Errors = append(es.Errors, &runnerv1.MonitorEnvStoreResponseSnapshot_Error{ + Code: uint32(verr.Code), + Message: verr.Message, + }) + } + envsSnapshot = append(envsSnapshot, es) } msg.Data = &runnerv1.MonitorEnvStoreResponse_Snapshot{