Repository navigation
feat(analyzers): validate grain contract serialization - #11576
Open
KSemenenko wants to merge 2 commits into
Open
KSemenenko wants to merge 2 commits into
KSemenenko wants to merge 2 commits into
Conversation
Contributor
Code coverage
Report-only conclusion: improved. The current-main baseline is commit Coverage combines every CI test matrix job, including providers, CodeGen, .NET 8/10, Linux, Windows, and macOS, using canonical physical source and branch identities. The comparison remains report-only while normal line and branch variance is calibrated. Coverage details |
KSemenenko
force-pushed
the
feat/grain-contract-serialization-analyzer
branch
from
October 23, 2026 07:47
2972e26 to
9adf47e
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
An unannotated DTO can enter a grain request, response, or state graph without a build diagnostic, leaving a missing codec to be discovered only when that path runs. Existing member-annotation checks do not catch this omission.
Add two independent opt-in warnings: ORLEANS0028 checks RPC contracts inherited from IGrain/IGrainObserver, and ORLEANS0029 checks state used by Orleans-serialized storage or live activation migration. Grain implementation classes are inspected through their contracts and state; they are not annotated as serialized data.
Follow actual constructed data schemas, including inherited and referenced contracts, asynchronous responses, arrays, built-in collections, model bases, explicit/implicit member IDs, and constructor-selected members on records and ordinary classes. Unused generic model arguments do not require serializers. Built-in codecs, registered custom codecs, and surrogate converters provide alternatives to GenerateSerializer. Traversal limits explicitly warn when a graph cannot be fully checked, including recursively expanding converter chains, so analysis stays bounded without silently skipping constructions.
State checks remain separate because JSON storage does not inherently require an Orleans codec, while live migration serializes persistent state through Orleans independently of the storage format. Documentation explains activation, remediation, migration, and limits involving runtime registrations, polymorphic values, and large or expanding graphs.
Regressions cover warning severity and independent activation, inherited/generic contracts, repeated closed constructions, constructor-selected external models, unused generic arguments, bounded converter/model graphs, and real serializer round trips for unused arguments and persistent-state migration payloads.
Closes #11575.
Microsoft Reviewers: Open in CodeFlow