GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(codegen): suppress warnings in generated source by ReubenBond · Pull Request #10854 · dotnet/orleans

Conversation

@ReubenBond

@ReubenBond ReubenBond commented Aug 27, 2026 •
edited by dotnet-policy-service Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Generated Orleans source can reference obsolete members or trigger compiler and analyzer warnings that user projects promote to errors. Maintaining a fixed warning list leaves generated code vulnerable to new diagnostics.

This wraps each generated compilation unit in #pragma warning disable and #pragma warning restore, suppressing warning-severity diagnostics only within generated source while preserving compiler errors and diagnostics in user-authored code. Regression coverage promotes all warnings to errors and verifies that obsolete user calls remain errors.

Closes #10851

Microsoft Reviewers: Open in CodeFlow

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@ReubenBond
fix(codegen): suppress generated source warnings
671761b
Copilot AI lite review requested due to automatic review settings August 27, 2026 21:06
Copilot started reviewing on behalf of ReubenBond August 27, 2026 21:07
View session
Copilot AI reviewed Aug 27, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Copilot review overview

Review tier: Lite
Findings: None

What changed in this PR

Updates Orleans’ source generator output to suppress all warnings within generated compilation units (via #pragma warning disable/restore without a fixed ID list), preventing user projects with “warnings as errors” from failing due to newly introduced diagnostics (e.g., obsolete-member warnings) while keeping user-authored call sites diagnostic-active.

Changes:

  • Change generated source wrapping from a fixed diagnostic ID suppression list to blanket warning suppression within generated files.
  • Add/strengthen regression coverage to ensure obsolete warnings are suppressed in generated proxy code but still surface (as errors under strict settings) in user-authored call sites.
  • Update generator snapshot baselines to reflect the new pragma form.
File Description
src/​Orleans.CodeGenerator/​GeneratedSourceOutput.cs Switch generated file pragma directives to blanket warning disable/restore.
test/​Orleans.CodeGenerator.Tests/​GeneratedWarningSuppressionTests.cs Add obsolete-warning regression test and make “strict diagnostics” truly warnings-as-errors.
test/​Orleans.CodeGenerator.Tests/​OrleansSourceGeneratorTests.cs Update snapshot concatenation to match new pragma restore text.
test/​Orleans.CodeGenerator.Tests/​snapshots/​OrleansSourceGeneratorTests.TestAlias.verified.cs Snapshot update for blanket warning disable/restore.
test/​Orleans.CodeGenerator.Tests/​snapshots/​OrleansSourceGeneratorTests.TestBasicClass.verified.cs Snapshot update for blanket warning disable/restore.
test/​Orleans.CodeGenerator.Tests/​snapshots/​OrleansSourceGeneratorTests.TestBasicClassWithAnnotatedFields.verified.cs Snapshot update for blanket warning disable/restore.
test/​Orleans.CodeGenerator.Tests/​snapshots/​OrleansSourceGeneratorTests.TestBasicClassWithDifferentAccessModifiers.verified.cs Snapshot update for blanket warning disable/restore.
test/​Orleans.CodeGenerator.Tests/​snapshots/​OrleansSourceGeneratorTests.TestBasicClassWithFields.verified.cs Snapshot update for blanket warning disable/restore.
test/​Orleans.CodeGenerator.Tests/​snapshots/​OrleansSourceGeneratorTests.TestBasicClassWithInheritance.verified.cs Snapshot update for blanket warning disable/restore.
test/​Orleans.CodeGenerator.Tests/​snapshots/​OrleansSourceGeneratorTests.TestBasicClassWithInitOnlyProperty.verified.cs Snapshot update for blanket warning disable/restore.
test/​Orleans.CodeGenerator.Tests/​snapshots/​OrleansSourceGeneratorTests.TestBasicClassWithoutNamespace.verified.cs Snapshot update for blanket warning disable/restore.
test/​Orleans.CodeGenerator.Tests/​snapshots/​OrleansSourceGeneratorTests.TestBasicGrain.verified.cs Snapshot update for blanket warning disable/restore.
test/​Orleans.CodeGenerator.Tests/​snapshots/​OrleansSourceGeneratorTests.TestBasicStruct.verified.cs Snapshot update for blanket warning disable/restore.
test/​Orleans.CodeGenerator.Tests/​snapshots/​OrleansSourceGeneratorTests.TestClassNestedTypes.verified.cs Snapshot update for blanket warning disable/restore.
test/​Orleans.CodeGenerator.Tests/​snapshots/​OrleansSourceGeneratorTests.TestClassPrimitiveTypes.verified.cs Snapshot update for blanket warning disable/restore.
test/​Orleans.CodeGenerator.Tests/​snapshots/​OrleansSourceGeneratorTests.TestClassPrimitiveTypesUsingFullName.verified.cs Snapshot update for blanket warning disable/restore.
test/​Orleans.CodeGenerator.Tests/​snapshots/​OrleansSourceGeneratorTests.TestClassReferenceProperties.verified.cs Snapshot update for blanket warning disable/restore.
test/​Orleans.CodeGenerator.Tests/​snapshots/​OrleansSourceGeneratorTests.TestClassWithConstructorParameters.verified.cs Snapshot update for blanket warning disable/restore.
test/​Orleans.CodeGenerator.Tests/​snapshots/​OrleansSourceGeneratorTests.TestClassWithFieldAndNoSetters.verified.cs Snapshot update for blanket warning disable/restore.
test/​Orleans.CodeGenerator.Tests/​snapshots/​OrleansSourceGeneratorTests.TestClassWithGenerateMethodSerializersAnnotation.verified.cs Snapshot update for blanket warning disable/restore.
test/​Orleans.CodeGenerator.Tests/​snapshots/​OrleansSourceGeneratorTests.TestClassWithGenerateSerializerAnnotation.verified.cs Snapshot update for blanket warning disable/restore.
test/​Orleans.CodeGenerator.Tests/​snapshots/​OrleansSourceGeneratorTests.TestClassWithInterfaceConstructorParameter.verified.cs Snapshot update for blanket warning disable/restore.
test/​Orleans.CodeGenerator.Tests/​snapshots/​OrleansSourceGeneratorTests.TestClassWithNoPublicConstructors.verified.cs Snapshot update for blanket warning disable/restore.
test/​Orleans.CodeGenerator.Tests/​snapshots/​OrleansSourceGeneratorTests.TestClassWithOptionalConstructorParameters.verified.cs Snapshot update for blanket warning disable/restore.
test/​Orleans.CodeGenerator.Tests/​snapshots/​OrleansSourceGeneratorTests.TestClassWithParameterizedConstructor.verified.cs Snapshot update for blanket warning disable/restore.
test/​Orleans.CodeGenerator.Tests/​snapshots/​OrleansSourceGeneratorTests.TestClassesWithGeneratedActivatorConstructorAnnotation.verified.cs Snapshot update for blanket warning disable/restore.
test/​Orleans.CodeGenerator.Tests/​snapshots/​OrleansSourceGeneratorTests.TestCompoundTypeAlias.verified.cs Snapshot update for blanket warning disable/restore.
test/​Orleans.CodeGenerator.Tests/​snapshots/​OrleansSourceGeneratorTests.TestGenericClass.verified.cs Snapshot update for blanket warning disable/restore.
test/​Orleans.CodeGenerator.Tests/​snapshots/​OrleansSourceGeneratorTests.TestGenericClassWithConstructorParameters.verified.cs Snapshot update for blanket warning disable/restore.
test/​Orleans.CodeGenerator.Tests/​snapshots/​OrleansSourceGeneratorTests.TestGrainComplexGrain.verified.cs Snapshot update for blanket warning disable/restore.
test/​Orleans.CodeGenerator.Tests/​snapshots/​OrleansSourceGeneratorTests.TestGrainMethodAnnotatedWithInvokableBaseType.verified.cs Snapshot update for blanket warning disable/restore.
test/​Orleans.CodeGenerator.Tests/​snapshots/​OrleansSourceGeneratorTests.TestGrainMethodAnnotatedWithResponseTimeout.verified.cs Snapshot update for blanket warning disable/restore.
test/​Orleans.CodeGenerator.Tests/​snapshots/​OrleansSourceGeneratorTests.TestGrainWithDifferentKeyTypes.verified.cs Snapshot update for blanket warning disable/restore.
test/​Orleans.CodeGenerator.Tests/​snapshots/​OrleansSourceGeneratorTests.TestGrainWithMultipleInterfaces.verified.cs Snapshot update for blanket warning disable/restore.
test/​Orleans.CodeGenerator.Tests/​snapshots/​OrleansSourceGeneratorTests.TestRecords.verified.cs Snapshot update for blanket warning disable/restore.
test/​Orleans.CodeGenerator.Tests/​snapshots/​OrleansSourceGeneratorTests.TestRecordsWithParameterIdAttributes.verified.cs Snapshot update for blanket warning disable/restore.
test/​Orleans.CodeGenerator.Tests/​snapshots/​OrleansSourceGeneratorTests.TestWithOmitDefaultMemberValuesAnnotation.verified.cs Snapshot update for blanket warning disable/restore.
test/​Orleans.CodeGenerator.Tests/​snapshots/​OrleansSourceGeneratorTests.TestWithSerializerTransparentAnnotation.verified.cs Snapshot update for blanket warning disable/restore.
test/​Orleans.CodeGenerator.Tests/​snapshots/​OrleansSourceGeneratorTests.TestWithSuppressReferenceTrackingAttribute.verified.cs Snapshot update for blanket warning disable/restore.
test/​Orleans.CodeGenerator.Tests/​snapshots/​OrleansSourceGeneratorTests.TestWithUseActivatorAnnotation.verified.cs Snapshot update for blanket warning disable/restore.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@github-actions

github-actions Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Code coverage

78.54% line coverage - 99,056 / 126,115 lines

Coverage details
  • Source files: 1,662
  • Scope: every CI test matrix job, including providers, CodeGen, .NET 8/10, Linux, Windows, and macOS
  • Sources: maintained repository code under src/ loaded by the complete CI test scope
  • Commit: 671761b9f8
  • View the test run and merged coverage artifact
  • View the coverage reporting run
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ReubenBond
ReubenBond merged commit 00d1a22 into dotnet:main Aug 27, 2026
76 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@ReubenBond
ReubenBond deleted the rb-fix-generator-warning-suppressions branch August 27, 2026 21:45
@ReubenBond ReubenBond mentioned this pull request Aug 27, 2026
test(codegen): pass test cancellation token in GeneratedWarningSuppressionTests #10877
Closed
This was referenced Aug 29, 2026
Bump the orleans-packages group with 7 updates csrakowski/FeedManager#28
Merged
Bump the dotnet-dependencies group with 1 update dills122/sandtable#67
Merged
Bump the dotnet group with 2 updates Kuestenlogik/Surgewave.Connectors#20
Merged
chore(deps): Bump the nuget-patch-and-minor group with 13 updates petesramek/microservices-vs-virtual-actors#7
Closed
chore: Bump Microsoft.Orleans.Persistence.Memory and Microsoft.Orleans.Runtime managedcode/Communication#151
Closed
chore: Bump Microsoft.Orleans.Runtime from 10.2.2 to 10.3.1 managedcode/Communication#152
Closed
chore: Bump Microsoft.Orleans.Sdk from 10.2.2 to 10.3.1 managedcode/Communication#153
Closed
chore: Bump Microsoft.Orleans.Serialization.Abstractions from 10.2.2 to 10.3.1 managedcode/Communication#154
Merged
chore: Bump Microsoft.Orleans.Persistence.Memory and 3 others managedcode/Communication#155
Closed
chore: Bump Microsoft.Orleans.TestingHost from 10.2.2 to 10.3.1 managedcode/Communication#156
Merged
Bump the orleans group with 1 update vgmello/momentum#341
Closed
Bump Microsoft.Orleans.BroadcastChannel and 5 others intochat/intochat#77
Closed
This was referenced Sep 7, 2026
Bump the nuget-minor-patch group with 21 updates Systemorph/MeshWeaver#3519
Closed
chore(deps): Bump the nuget-patch-and-minor group with 13 updates petesramek/microservices-vs-virtual-actors#8
Closed
Bump the orleans group with 3 updates microsoft/aspire-samples#1931
Merged
Bump the orleans group with 10 updates bartul/agave#87
Merged
Bump the dotnet group with 5 updates dotnet/docs#55908
Merged
Bump the dotnet group with 4 updates dotnet/docs#55909
Merged
Bump the dotnet group with 4 updates dotnet/docs#55910
Merged
Bump the dotnet group with 5 updates dotnet/docs#55911
Merged
Bump the dotnet group with 4 updates IvanMarkitan/dotnet-docs#838
Closed
Bump the dotnet group with 6 updates IvanMarkitan/dotnet-docs#839
Closed
This was referenced Sep 9, 2026
Bump the dotnet group with 5 updates BillWagner/docs#9804
Closed
Bump the dotnet group with 4 updates BillWagner/docs#9805
Closed
Bump the dotnet group with 4 updates BillWagner/docs#9806
Closed
Bump the dotnet group with 5 updates BillWagner/docs#9807
Closed
Bump the dotnet group with 7 updates zbalkan/docs#2339
Closed
Bump the dotnet group with 5 updates zbalkan/docs#2340
Closed
Bump the dotnet group with 6 updates zbalkan/docs#2341
Closed
Bump the dotnet group with 10 updates zbalkan/docs#2347
Open
@ReubenBond ReubenBond mentioned this pull request Sep 12, 2026
Code generation for generic grain interfaces broken from 7.2.4 to 9.1.2 #9481
Closed
This was referenced Sep 14, 2026
chore(deps): Bump the nuget-patch-and-minor group with 25 updates petesramek/microservices-vs-virtual-actors#9
Closed
chore(deps): Bump Meziantou.Analyzer and 12 others petesramek/microservices-vs-virtual-actors#10
Closed
chore: Bump ManagedCode.Orleans.RateLimiting.Server and 4 others managedcode/Communication#160
Closed
Bump the dotnet group with 4 updates IvanMarkitan/dotnet-docs#869
Open
Bump the dotnet group with 6 updates IvanMarkitan/dotnet-docs#870
Open
Bump the dotnet group with 7 updates IvanMarkitan/dotnet-docs#877
Open
Bump the dotnet group with 7 updates zbalkan/docs#2373
Open
Bump the dotnet group with 5 updates zbalkan/docs#2377
Open
Bump the dotnet group with 6 updates zbalkan/docs#2393
Open
Bump Microsoft.Orleans.Reminders and Microsoft.Orleans.Sdk en-gen/Wayfinder#266
Open
Bump Microsoft.Orleans.Reminders from 10.2.2 to 10.3.1 en-gen/Wayfinder#267
Closed
Bump Microsoft.Orleans.Reminders and Microsoft.Orleans.Reminders.AzureStorage en-gen/Wayfinder#268
Open
chore: Bump the orleans group with 2 updates pathosDev/actor-ts#1607
Closed
chore: Bump the minor-and-patch group with 3 updates pathosDev/actor-ts#1608
Merged
chore(deps): Bump the nuget-patch-and-minor group with 26 updates petesramek/microservices-vs-virtual-actors#11
Merged
This was referenced Sep 21, 2026
chore(deps): Bump Meziantou.Analyzer and 24 others petesramek/microservices-vs-virtual-actors#12
Merged
Bump Microsoft.Orleans.Streaming from 10.2.0 to 10.3.1 Mystikweb/Orleans.Streams.Confluent#32
Merged
Bump the dotnet group with 7 updates IvanMarkitan/dotnet-docs#999
Closed
Bump the dotnet group with 10 updates zbalkan/docs#2533
Closed
Bump the nuget group with 10 updates dotnet/docs#56226
Merged
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 27, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Incremental source generator emits CS0618 for obsolete grain methods

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@ReubenBond
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.
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.