Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 7, 2025

  • Fix CI failures from merge conflict
  • Update generator to simplify type names in XML documentation
  • Update test expectations to match new XML doc format
  • All 38 tests passing

Changes Made

Fixed merge conflict that corrupted the Activities_ExplicitNaming test after merging PR #535 which added XML documentation to generated code.

Updated the generator to also simplify type references in XML <see cref=""/> attributes when generating code in the same namespace as the referenced type, maintaining consistency with the method signatures and return types.

All generator tests now pass successfully.

Original prompt

This section details on the original issue you should resolve

<issue_title>Generated extension methods should be placed in the namespace of the activity/orchestration</issue_title>
<issue_description>Currently, the GeneratedDurableTaskExtensions class is placed in the Microsoft.DurableTask namespace, which is cluttering all sorts of IDE features from suggestions to refactoring. It would be better if a separate extensions class was generated for each namespace where the activity and orchestrator classes are, so that only the types from the same or explicitly referenced namespaces are available. After all, we probably import that namespace anyway.

Example

Suppose we have two orchestrations in different namespaces, MyDurableTaskProject.Approvals.ApprovalOrchestration and MyDurableTaskProject.Registrations.RegistrationOrchestration.

Generated code before:

namespace Microsoft.DurableTask
{
    public static class GeneratedDurableTaskExtensions
    {
        /// <inheritdoc cref="IOrchestrationSubmitter.ScheduleNewOrchestrationInstanceAsync"/>
        public static Task<string> ScheduleNewApprovalOrchestrationInstanceAsync(
            this IOrchestrationSubmitter client, MyDurableTaskProject.Approvals.ApprovalOrchestrationParameters input, StartOrchestrationOptions? options = null)
        {
            return client.ScheduleNewOrchestrationInstanceAsync("MyDurableTaskProject.Approvals.ApprovalOrchestration", input, options);
        }

        /// <inheritdoc cref="IOrchestrationSubmitter.ScheduleNewOrchestrationInstanceAsync"/>
        public static Task<string> ScheduleNewRegistrationOrchestrationInstanceAsync(
            this IOrchestrationSubmitter client, MyDurableTaskProject.Registrations.RegistrationOrchestrationParameters input, StartOrchestrationOptions? options = null)
        {
            return client.ScheduleNewOrchestrationInstanceAsync("MyDurableTaskProject.Registrations.RegistrationOrchestration", input, options);
        }
}

After the change, it should be like this:

using Microsoft.DurableTask;

namespace MyDurableTaskProject.Approvals
{
    public static class GeneratedDurableTaskExtensions
    {
        /// <inheritdoc cref="IOrchestrationSubmitter.ScheduleNewOrchestrationInstanceAsync"/>
        public static Task<string> ScheduleNewApprovalOrchestrationInstanceAsync(
            this IOrchestrationSubmitter client, ApprovalOrchestrationParameters input, StartOrchestrationOptions? options = null)
        {
            return client.ScheduleNewOrchestrationInstanceAsync("MyDurableTaskProject.Approvals.ApprovalOrchestration", input, options);
        }
}

namespace MyDurableTaskProject.Registrations
{
    public static class GeneratedDurableTaskExtensions
    {
        /// <inheritdoc cref="IOrchestrationSubmitter.ScheduleNewOrchestrationInstanceAsync"/>
        public static Task<string> ScheduleNewRegistrationOrchestrationInstanceAsync(
            this IOrchestrationSubmitter client, RegistrationOrchestrationParameters input, StartOrchestrationOptions? options = null)
        {
            return client.ScheduleNewOrchestrationInstanceAsync("MyDurableTaskProject.Registrations.RegistrationOrchestration", input, options);
        }
}
```</issue_description>

## Comments on the Issue (you are @copilot in this section)

<comments>
</comments>

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Fix generated extension methods namespace placement Generate extension methods in task namespace instead of Microsoft.DurableTask Dec 7, 2025
Copilot AI requested a review from YunchuWang December 7, 2025 03:47
@YunchuWang
Copy link
Member

@copilot fix ci failures

Copy link
Contributor Author

Copilot AI commented Dec 9, 2025

@copilot fix ci failures

Fixed in f4c0c5e. The merge from main introduced a conflict with PR #535's XML documentation changes that wasn't resolved correctly. I've fixed the corrupted test code and updated the generator to simplify type references in XML <see cref=""/> attributes when in the same namespace. All 38 tests now pass.

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.

Generated extension methods should be placed in the namespace of the activity/orchestration

2 participants