Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 10, 2025

Adds Info-level diagnostic DURABLE0009 that suggests using input parameter binding instead of ctx.GetInput<T>() in orchestrator methods.

Changes

  • GetInputOrchestrationAnalyzer: Detects GetInput<T>() calls in orchestration methods (Azure Functions, TaskOrchestrator classes, OrchestratorFunc lambdas)
  • Diagnostic messages: Added to Resources.resx with Info severity
  • Release tracking: Registered DURABLE0009 in AnalyzerReleases.Unshipped.md
  • Tests: 10 test cases covering all orchestration patterns

Example

Triggers diagnostic:

[Function("FibOrchestration")]
public static async Task<int> FibOrchestration([OrchestrationTrigger] TaskOrchestrationContext context)
{
    int input = context.GetInput<int>()!;  // DURABLE0009
    return input * 2;
}

Suggested pattern:

[Function("FibOrchestration")]
public static async Task<int> FibOrchestration([OrchestrationTrigger] TaskOrchestrationContext context, int input)
{
    return input * 2;
}
Original prompt

This section details on the original issue you should resolve

<issue_title>Roslyn Analyzer could suggest input parameter binding instead of ctx.GetInput()</issue_title>
<issue_description>We could have an Info level diagnostic informing users that an input parameter binding can be used instead of ctx.GetInput<T>()</issue_description>

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


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 3 commits December 10, 2025 18:51
Co-authored-by: YunchuWang <12449837+YunchuWang@users.noreply.github.com>
Co-authored-by: YunchuWang <12449837+YunchuWang@users.noreply.github.com>
Co-authored-by: YunchuWang <12449837+YunchuWang@users.noreply.github.com>
Copilot AI changed the title [WIP] Add diagnostic for input parameter binding suggestion Add analyzer to suggest input parameter binding over GetInput<T>() Dec 10, 2025
Copilot AI requested a review from YunchuWang December 10, 2025 19:08
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.

Roslyn Analyzer could suggest input parameter binding instead of ctx.GetInput<T>()

2 participants