Skip to content

Add Roslyn analyzer for workflow/activity input/output type validation#1774

Merged
WhitWaldo merged 3 commits intodapr:masterfrom
mtaghavi2005:workflow-analyzer-input-output-type-safety
Apr 12, 2026
Merged

Add Roslyn analyzer for workflow/activity input/output type validation#1774
WhitWaldo merged 3 commits intodapr:masterfrom
mtaghavi2005:workflow-analyzer-input-output-type-safety

Conversation

@mtaghavi2005
Copy link
Copy Markdown
Contributor

Description

This PR adds a Roslyn analyzer that validates workflow and workflow activity input/output type compatibility.

The analyzer checks:

  • workflow input types passed to ScheduleNewWorkflowAsync
  • child workflow input/output types used with CallChildWorkflowAsync
  • workflow activity input/output types used with CallActivityAsync

This PR introduces:

  • DAPR1303 for input type mismatches
  • DAPR1304 for output type mismatches

Issue reference

This PR belongs to #1426.
This PR is related to #1399.

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

  • Code compiles correctly
  • Created/updated tests
  • Extended the documentation

@mtaghavi2005 mtaghavi2005 requested review from a team as code owners April 9, 2026 22:35
Signed-off-by: Mohammad Taghavi <mtaghavi2005@gmail.com>
Signed-off-by: Mohammad Taghavi <mtaghavi2005@gmail.com>
Signed-off-by: Mohammad Taghavi <mtaghavi2005@gmail.com>
@mtaghavi2005 mtaghavi2005 force-pushed the workflow-analyzer-input-output-type-safety branch from 8f28863 to c24a72a Compare April 9, 2026 22:45
WhitWaldo added a commit to WhitWaldo/dapr-docs that referenced this pull request Apr 12, 2026
…1774

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
Copy link
Copy Markdown
Contributor

@WhitWaldo WhitWaldo left a comment

Choose a reason for hiding this comment

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

Looks great - thank you for your contribution!

There appears to be some sort of bug with the 1.16.13 RC integration tests. Once that runtime patch is merged, I'll re-run testing and get this merged in the next SDK patch.

@WhitWaldo
Copy link
Copy Markdown
Contributor

@copilot The integration tests for net8-1.16.13-rc.1-Workflow, net9-1.16.13-rc.1-Workflow, and net10-1.16.13-rc.1-Workflow are failing because of an issue that's not represented for any of the other runtime versions tested (against either same .NET versions or non-RC releases). Can you please verify that there's not a bug in the GitHub workflow pipeline that's preventing these versions from testing correctly and open a separate PR with any applicable fix for me to review?

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