GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||
GeezerVison is showing github.com — feat(analyzers): detect RPC contract changes by ReubenBond · Pull Request #10337 · dotnet/orleans Conversation
|
| File | Description |
|---|---|
| test/Orleans.Analyzers.Tests/GrainInterfaceVersionAnalyzerTest.cs | Adds coverage for new diagnostics and code fixes across aliases, versions, generics, and inheritance. |
| src/Orleans.Analyzers/Resources.resx | Adds localized strings for new diagnostics and code fix titles. |
| src/Orleans.Analyzers/Resources.Designer.cs | Updates strongly-typed resource accessors for the new strings. |
| src/Orleans.Analyzers/GrainInterfaceVersionCodeFix.cs | Implements code fixes which update/create GrainInterfaces.txt based on diagnostics. |
| src/Orleans.Analyzers/GrainInterfaceVersionAnalyzer.cs | Implements analyzer + manifest parser for interface/member/version tracking. |
| src/Orleans.Analyzers/Constants.cs | Adds constants for VersionAttribute FQN and GrainInterfaces.txt filename. |
| src/Orleans.Analyzers/AnalyzerReleases.Unshipped.md | Documents the newly introduced diagnostic IDs and severities. |
src/Orleans.Analyzers/GrainInterfaceVersionCodeFix.cs:366
StartsWith(interfaceName). This fails when the next interface name happens to share the same prefix (for example, IMyGrain followed by IMyGrainExtended), causing the new member to be inserted in the wrong section. // If next line is empty, a comment, or another interface, insert the member here
if (string.IsNullOrEmpty(nextLine) ||
nextLine.StartsWith("#", StringComparison.Ordinal) ||
(nextLine.Contains("[Version(") && !nextLine.StartsWith(interfaceName, StringComparison.Ordinal)))
{
src/Orleans.Analyzers/GrainInterfaceVersionCodeFix.cs:422
trimmedLine.Contains(interfaceName), which can retire the wrong interface when one interface name is a substring/prefix of another. It should ensure it matched the full interface-name token before adding the RETIRED prefix. // Check if this line contains the interface declaration
if (trimmedLine.Contains(interfaceName) && trimmedLine.Contains("[Version(") &&
!trimmedLine.StartsWith(GrainInterfaceVersionAnalyzer.RetiredPrefix, StringComparison.Ordinal))
{
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
df743cf to
2c62824
Compare
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
src/Orleans.Analyzers/GrainInterfaceVersionCodeFix.cs:263
className. If a grain class is renamed but keeps a stable [GrainType("...")] alias, the analyzer can still match by alias, but the code fix will append a new entry instead of updating the existing (possibly RETIRED) one. That can introduce duplicate alias declarations, which are treated as errors by the parser (see GrainInterfaceFileParser.Parse duplicate check in GrainInterfaceVersionAnalyzer.cs:1003-1005). Consider matching existing entries by alias (and updating/unretiring that line) before appending a new declaration. for (var i = 0; i < lines.Length; i++)
{
if (GrainInterfaceFileParser.TryGetGrainClassName(lines[i], out var declaredName)
&& string.Equals(declaredName, className, StringComparison.Ordinal))
{
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
src/Orleans.Runtime/OrleansContracts.txt:31
IGrainDirectoryPartition.GetSnapshotAsync drops the nullable annotation from the return type. The source interface returns ValueTask<GrainDirectoryPartitionSnapshot?>, so this signature should include ? to match the analyzer's contract type rendering (it preserves nullable reference modifiers, e.g., GrainAddress?). GetSnapshotAsync(Orleans.Runtime.MembershipVersion, Orleans.Runtime.MembershipVersion, RingRange, System.Threading.CancellationToken) -> ValueTask<GrainDirectoryPartitionSnapshot>
Sorry, something went wrong.
There was an error while loading. Please reload this page.
b1b3605 to
fbfbed6
Compare
Recover the grain interface version analyzer and its code fixes. Track grain interface signatures in GrainInterfaces.txt so incompatible changes are identified during development. Co-authored-by: Copilot App <[email protected]> Copilot-Session: 72583b82-973f-4897-939d-e29e6cedd2a0
Co-authored-by: Copilot App <[email protected]> Copilot-Session: 20a2d18d-fb94-43cc-8f92-67274910d221
Co-authored-by: Copilot App <[email protected]> Copilot-Session: 20a2d18d-fb94-43cc-8f92-67274910d221
Co-authored-by: Copilot App <[email protected]> Copilot-Session: 20a2d18d-fb94-43cc-8f92-67274910d221
13af6c7 to
475d4da
Compare
Co-authored-by: Copilot App <[email protected]> Copilot-Session: 20a2d18d-fb94-43cc-8f92-67274910d221
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Co-authored-by: Copilot App <[email protected]> Copilot-Session: 20a2d18d-fb94-43cc-8f92-67274910d221
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
src/Orleans.Analyzers/Resources.resx:198
<!-- Grain Interface Version Analyzer (ORLEANS0016-0021) -->
test/Orleans.Analyzers.Tests/GrainInterfaceVersionAnalyzerTest.cs:1087
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.