Skip to content

[BREAKING] Obsoleting ReflectingExecutor in favor of source gen - #3380

Merged
Ben Thomas (alliscode) merged 17 commits into
microsoft:mainfrom
alliscode:wf-obsolete-reflector
Feb 4, 2026
Merged

[BREAKING] Obsoleting ReflectingExecutor in favor of source gen#3380
Ben Thomas (alliscode) merged 17 commits into
microsoft:mainfrom
alliscode:wf-obsolete-reflector

Conversation

@alliscode

@alliscodeBen Thomas (alliscode) commented Jan 22, 2026

Copy link
Copy Markdown
Member

Motivation and Context

Description

Contribution Checklist

  • The code builds clean without any errors or warnings
  • The PR follows the Contribution Guidelines
  • All unit tests pass, and I have added new tests where possible
  • Is this a breaking change? If yes, add "[BREAKING]" prefix to the title of the PR.

alliscodeand others added 13 commits January 7, 2026 13:51
…d. Also updated Diagnostics Ids to format of MAFGENWF{NUM}
…branch.
This commit separates the generator core functionality from the
deprecation of ReflectingExecutor. The removed changes will be
re-added in a dependent branch (wf-obsolete-reflector).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit deprecates the reflection-based handler discovery approach
in favor of the new [MessageHandler] attribute with source generation.
Changes:
- Add [Obsolete] to ReflectingExecutor<T>, IMessageHandler<T>, IMessageHandler<T,R>
- Add #pragma to suppress warnings in internal reflection code
- Update Concurrent sample to use new [MessageHandler] pattern
- Add Directory.Build.props for samples to include generator
- Add documentation files explaining the migration
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…ce Generators and updating some samples to use new pattern.
This commit deprecates the reflection-based handler discovery approach
in favor of the new [MessageHandler] attribute with source generation.
Changes:
- Add [Obsolete] to ReflectingExecutor<T>, IMessageHandler<T>, IMessageHandler<T,R>
- Add #pragma to suppress warnings in internal reflection code
- Update Concurrent sample to use new [MessageHandler] pattern
- Add Directory.Build.props for samples to include generator
- Add documentation files explaining the migration
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@markwallace-microsoftMark Wallace (markwallace-microsoft) added .NET Usage: [Issues, PRs], Target: .Net workflows Usage: [Issues, PRs], Target: Workflows labels Jan 22, 2026
@github-actionsgithub-actionsBot changed the title Wf obsolete reflector.NET: Wf obsolete reflectorJan 22, 2026
@alliscodeBen Thomas (alliscode) changed the title .NET: Wf obsolete reflectorObsoleting ReflectingExecutor in favor of source genJan 22, 2026
@alliscode

Copy link
Copy Markdown
MemberAuthor

I will hold off on merging this until the docs are updated to clearly explain the new pattern.

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR obsoletes the reflection-based ReflectingExecutor<TExecutor> pattern in favor of a source generation approach using the [MessageHandler] attribute. The changes ensure backward compatibility while guiding developers to the new recommended pattern.

Changes:

  • Marked ReflectingExecutor<TExecutor> and IMessageHandler<T> interfaces as obsolete with clear migration guidance
  • Added pragma warnings to suppress obsolete warnings in internal code and tests that need backward compatibility
  • Updated one sample executor to demonstrate the new [MessageHandler] pattern
  • Added source generator project reference to the Workflows samples Directory.Build.props

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.

Show a summary per file
FileDescription
ReflectingExecutor.csAdded [Obsolete] attribute with migration guidance to use [MessageHandler] attribute
IMessageHandler.csMarked both IMessageHandler<TMessage> and IMessageHandler<TMessage, TResult> interfaces as obsolete
Executor.csAdded pragma to suppress obsolete warnings for internal backward compatibility
StatefulExecutor.csAdded pragma to suppress obsolete warnings for internal backward compatibility
RouteBuilderExtensions.csAdded pragma to suppress obsolete warnings for internal backward compatibility
MessageHandlerInfo.csAdded pragma to suppress obsolete warnings for internal backward compatibility
01_Simple_Workflow_Sequential.csAdded pragma to suppress obsolete warnings when testing legacy reflection-based pattern
02_Simple_Workflow_Condition.csAdded pragma to suppress obsolete warnings when testing legacy reflection-based pattern
03_Simple_Workflow_Loop.csAdded pragma to suppress obsolete warnings when testing legacy reflection-based pattern
ReflectionSmokeTest.csAdded pragma to suppress obsolete warnings when testing legacy reflection-based pattern
Directory.Build.propsAdded source generator project reference for samples using [MessageHandler] attribute
Concurrent/Program.csMigrated ConcurrentStartExecutor from Executor<string> to base Executor with [MessageHandler] attribute

@alliscodeBen Thomas (alliscode) changed the title Obsoleting ReflectingExecutor in favor of source gen[BREAKING] Obsoleting ReflectingExecutor in favor of source genJan 22, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentationUsage: [Issues, PRs], Target: documentation in the code base and learn docs.NETUsage: [Issues, PRs], Target: .NetworkflowsUsage: [Issues, PRs], Target: Workflows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants

@alliscode@lokitoth@stephentoub@TaoChenOSU@crickman@peibekwe@markwallace-microsoft