Azure / Azure/durabletask

How can I get strong-typed history of a workflow execution?

Aperta
#665 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
enhancement
Lingua principale
C#
Stelle
1.7k
Fork
335
Merge medio
2g 23h
PR unite (30g)
6

Descrizione

I'm trying to build a UI to audit the status of in-progress and completed workflows. I'd like to display the full history of the workflow.

I see that `TaskHubClient` has a method `GetOrchestrationHistoryAsync` that is nearly what I want, except it returns a json string instead of a strong-typed list of history items:

https://github.com/Azure/durabletask/blob/657586bcfe9b0c68695ec6447ee9baca338c6cf7/src/DurableTask.Core/TaskHubClient.cs#L832-L849

Digging down through the call stack, `IOrchestrationServiceClient.GetOrchestrationHistoryAsync` also returns json:

https://github.com/Azure/durabletask/blob/657586bcfe9b0c68695ec6447ee9baca338c6cf7/src/DurableTask.AzureStorage/AzureStorageOrchestrationService.cs#L1749-L1762

The next level down (at least in the case of the Azure Storage backend) is `ITrackingStore`, which is unusable to me because it's not public.

https://github.com/Azure/durabletask/blob/657586bcfe9b0c68695ec6447ee9baca338c6cf7/src/DurableTask.AzureStorage/Tracking/ITrackingStore.cs#L26

I'm currently working around the issue by deserializing the returned json. It works, but the code needed to do so is nontrivial and brittle because `HistoryEvent` is an abstract class and requires custom type mapping to deserialize properly.

It seems like there should be a "Get Orchestration History" method that returns a list of `HistoryEvent` objects, or perhaps an `OrchestrationHistory` object. Am I missing something?

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Inizia con GetOrchestrationHistoryAsync in src/DurableTask.Core/TaskHubClient.cs e IOrchestrationServiceClient.GetOrchestrationHistoryAsync in src/DurableTask.AzureStorage/AzureStorageOrchestrationService.cs. Esamina ITrackingStore e la gerarchia di HistoryEvent per determinare come esporre un risultato della cronologia tipizzato e pubblico; il lavoro è completo quando i chiamanti possono recuperare la cronologia senza una deserializzazione JSON personalizzata e fragile.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
csharp
Ambito
api, backend
Tipo di issue
Funzionalità
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.