From 0d97d7c38f9e76f3321f5ebb51717572ac358e2a Mon Sep 17 00:00:00 2001 From: lemaitre-aneo Date: Fri, 19 Jul 2024 12:17:53 +0200 Subject: [PATCH] Expose PayloadID --- Common/src/gRPC/Convertors/TaskDataHolderExt.cs | 2 ++ Common/src/gRPC/EnumFieldExt.cs | 1 + Common/src/gRPC/Services/GrpcTasksService.cs | 4 +++- .../gRPC/Validators/EventSubscriptionRequestValidator.cs | 1 + Common/tests/ListTasksRequestExt/ToTaskDataFieldTest.cs | 2 ++ Common/tests/ListTasksRequestExt/ToTaskDataFilterTest.cs | 7 +++++++ Common/tests/TestBase/TaskTableTestBase.cs | 7 +++++++ .../Validators/EventSubscriptionRequestValidatorTest.cs | 3 +++ 8 files changed, 26 insertions(+), 1 deletion(-) diff --git a/Common/src/gRPC/Convertors/TaskDataHolderExt.cs b/Common/src/gRPC/Convertors/TaskDataHolderExt.cs index b6dafb7ee..d38a1d655 100644 --- a/Common/src/gRPC/Convertors/TaskDataHolderExt.cs +++ b/Common/src/gRPC/Convertors/TaskDataHolderExt.cs @@ -37,6 +37,7 @@ public static TaskDetailed ToTaskDetailed(this TaskDataHolder taskData) => new() { SessionId = taskData.SessionId, + PayloadId = taskData.PayloadId, Status = taskData.Status.ToGrpcStatus(), Output = taskData.Output is not null ? new TaskDetailed.Types.Output @@ -117,6 +118,7 @@ public static TaskSummary ToTaskSummary(this TaskDataHolder taskDataSummary) => new() { SessionId = taskDataSummary.SessionId, + PayloadId = taskDataSummary.PayloadId, Status = taskDataSummary.Status.ToGrpcStatus(), OwnerPodId = taskDataSummary.OwnerPodId, Options = taskDataSummary.Options?.ToGrpcTaskOptions(), diff --git a/Common/src/gRPC/EnumFieldExt.cs b/Common/src/gRPC/EnumFieldExt.cs index 54d1d98aa..2e0906f83 100644 --- a/Common/src/gRPC/EnumFieldExt.cs +++ b/Common/src/gRPC/EnumFieldExt.cs @@ -58,6 +58,7 @@ public static class EnumFieldExt { TaskSummaryEnumField.TaskId => data => data.TaskId, TaskSummaryEnumField.SessionId => data => data.SessionId, + TaskSummaryEnumField.PayloadId => data => data.PayloadId, TaskSummaryEnumField.OwnerPodId => data => data.OwnerPodId, TaskSummaryEnumField.InitialTaskId => data => data.InitialTaskId, TaskSummaryEnumField.Status => data => data.Status, diff --git a/Common/src/gRPC/Services/GrpcTasksService.cs b/Common/src/gRPC/Services/GrpcTasksService.cs index 43494878e..8fd76ac7d 100644 --- a/Common/src/gRPC/Services/GrpcTasksService.cs +++ b/Common/src/gRPC/Services/GrpcTasksService.cs @@ -106,6 +106,7 @@ public GrpcTasksService(ITaskTable taskTable, { TaskDataFields.SessionId, TaskDataFields.TaskId, + TaskDataFields.PayloadId, TaskDataFields.Status, TaskDataFields.InitialTaskId, TaskDataFields.Output, @@ -481,7 +482,8 @@ await TaskLifeCycleHelper.FinalizeTaskCreation(taskTable_, { creationRequest.ExpectedOutputKeys, }, - TaskId = creationRequest.TaskId, + TaskId = creationRequest.TaskId, + PayloadId = creationRequest.PayloadId, }), }, }; diff --git a/Common/src/gRPC/Validators/EventSubscriptionRequestValidator.cs b/Common/src/gRPC/Validators/EventSubscriptionRequestValidator.cs index 2f90463d7..2d2aba475 100644 --- a/Common/src/gRPC/Validators/EventSubscriptionRequestValidator.cs +++ b/Common/src/gRPC/Validators/EventSubscriptionRequestValidator.cs @@ -93,6 +93,7 @@ public override ValidationResult Validate(ValidationContext