Skip to content

Activity tag support #426

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Activity tag support #426

wants to merge 7 commits into from

Conversation

YunchuWang
Copy link
Member

@YunchuWang YunchuWang commented May 10, 2025

This pull request introduces several enhancements and new features to improve the functionality and flexibility of the Durable Task framework. The most significant changes include the addition of tagging support for tasks, the creation of a new activity class for cache clearing, and updates to orchestrator logic to utilize the new activity. Below is a breakdown of the changes:

Related prs:
https://github.com/microsoft/durabletask-protobuf/pull/43/files
https://github.com/Azure/durabletask/pull/1211/files
https://msazure.visualstudio.com/One/_git/AAPT-DTMB/pullrequest/12388270

Task Tagging Support

  • Added a Tags property to the TaskOptions class, enabling tasks to have associated metadata tags. This includes a new constructor for initializing TaskOptions with tags. (src/Abstractions/TaskOptions.cs, src/Abstractions/TaskOptions.csR22-R42)
  • Introduced a CallActivityOptions class, inheriting from TaskOptions, specifically for configuring activity calls with tags. (src/Abstractions/TaskOptions.cs, src/Abstractions/TaskOptions.csR128-R153)
  • Updated ProtoUtils to handle tags during task scheduling and history event conversion, ensuring tags are serialized and deserialized properly. (src/Shared/Grpc/ProtoUtils.cs, [1] [2]
  • Modified TaskOrchestrationContextWrapper to pass tags when scheduling tasks, ensuring they are included in the orchestration execution. (src/Worker/Core/Shims/TaskOrchestrationContextWrapper.cs, src/Worker/Core/Shims/TaskOrchestrationContextWrapper.csR141-R170)

New Cache Clearing Activity

Integration with Sample Application

  • Registered the CacheClearingActivity and updated the Durable Task worker configuration in the sample application to include the new activity. (samples/ScheduleWebApp/Program.cs, samples/ScheduleWebApp/Program.csR23-L28)
  • Added necessary using directives for the new activity in the orchestrator and program files. (samples/ScheduleWebApp/Orchestrations/CacheClearingOrchestrator.cs, [1]; samples/ScheduleWebApp/Program.cs, [2]

Dependency Updates

  • Upgraded the Microsoft.Azure.DurableTask.Core package from version 3.1.0 to 3.1.1 to ensure compatibility with the new features. (Directory.Packages.props, Directory.Packages.propsL31-R31)

Code Cleanup

@YunchuWang YunchuWang marked this pull request as ready for review May 12, 2025 05:43
Copy link
Member

@cgillum cgillum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to revisit the public API change. In particular, I don't think we should limit tags to activity calls.

@YunchuWang YunchuWang requested a review from cgillum May 12, 2025 22:17
@YunchuWang YunchuWang requested a review from cgillum May 12, 2025 22:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants