From a7f21acf2e591482ed0df2c86e5fa7e08e49a03b Mon Sep 17 00:00:00 2001 From: Maxwell Weru Date: Mon, 16 Sep 2024 09:03:02 +0200 Subject: [PATCH] Remove workaround for reading ContainerApp Job execution (#1344) The library has since been updated; we no longer need a workaround. See also, https://github.com/Azure/azure-sdk-for-net/issues/38385 --- server/Tingle.Dependabot/Workflow/UpdateRunner.cs | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/server/Tingle.Dependabot/Workflow/UpdateRunner.cs b/server/Tingle.Dependabot/Workflow/UpdateRunner.cs index 236f676b..0c41f804 100644 --- a/server/Tingle.Dependabot/Workflow/UpdateRunner.cs +++ b/server/Tingle.Dependabot/Workflow/UpdateRunner.cs @@ -175,13 +175,7 @@ public async Task DeleteAsync(UpdateJob job, CancellationToken cancellationToken var execution = executions.SingleOrDefault(); if (execution is null) return null; - // this is a temporary workaround - // TODO: remove this after https://github.com/Azure/azure-sdk-for-net/issues/38385 is fixed - var rr = await resource.GetContainerAppJobExecutionAsync(execution.Data.Name, cancellationToken); - var properties = JsonNode.Parse(rr.GetRawResponse().Content.ToString())!.AsObject()["properties"]!; - - //var status = execution.Data.Properties.Status.ToString() switch - var status = properties["status"]!.GetValue() switch + var status = execution.Data.Status.ToString() switch { "Succeeded" => UpdateJobStatus.Succeeded, "Running" => UpdateJobStatus.Running, @@ -200,8 +194,7 @@ public async Task DeleteAsync(UpdateJob job, CancellationToken cancellationToken } // get the period - //DateTimeOffset? start = execution.Data.Properties.StartTime, end = execution.Data.Properties.EndTime; - DateTimeOffset? start = properties["startTime"]?.GetValue(), end = properties["endTime"]?.GetValue(); + DateTimeOffset? start = execution.Data.StartOn, end = execution.Data.EndOn; // create and return state return new UpdateRunnerState(status, start, end);