microsoft / microsoft/durabletask-dotnet

Custom naming convention for generated code

Open
#429 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

P2
Dominant language
C#
Stars
193
Forks
60
Avg merge
3d 12h
Merged PRs (30d)
4

Description

As a developer, I'd like to customize the orchestrator/activity name that is generated for my classes annotated with DurableTaskAttribute.
The generator currently uses the target type's local name by default. This is not sufficient if there are many unrelated orchestrators and activities in the project in different namespaces, or if the Task Hub is shared between multiple services (for whatever reason).
The best would be a few properties that I can pass to the build from the project file, e.g.

<PropertyGroup>
    <!-- Configure the default for orchestrators, activities and events -->
    <DurableTaskDefaultNamingPolicy>FullName</DurableTaskDefaultNamingPolicy>

    <!-- Configure the default for orchestrators separately -->
    <DurableTaskOrchestratorDefaultNamingPolicy>FullName</DurableTaskOrchestratorDefaultNamingPolicy>
</PropertyGroup>

Possible values can be Name (current behavior), FullName, AssemblyQualifiedName - the names should be generated using the corresponding property of the target Type.

The current workaround is to always provide the name in the DurableTask annotation.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the source generator that handles DurableTaskAttribute and the build-property configuration path for generated names. Define how the requested default policies map to Type.Name, Type.FullName, and Type.AssemblyQualifiedName, while preserving explicit annotation names; done means project-file defaults work for the requested task types and existing behavior remains unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
build-system, devtools
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.