Skip to content

Add every benchmark and example to All.slnx and fix their builds - #10848

Merged
glen-84 merged 1 commit into
mainfrom
gai/build-all-benchmarks-and-examples
Nov 10, 2026
Merged

glen-84 merged 1 commit into
mainfrom
gai/build-all-benchmarks-and-examples

Conversation

@glen-84

@glen-84 glen-84 commented Nov 10, 2026

Copy link
Copy Markdown
Member

Summary

  • src/All.slnx now lists every project under src/, including the 42 benchmark and example projects it was missing, so dotnet build src/All.slnx and solution-wide dotnet format runs cover them. The CI test matrix takes only the *.Tests.csproj entries, so CI builds the same projects as before.
  • The added projects now build. Most fixes are code style errors (unused usings, braces, var, s_ prefixes). Beyond those, PostgresBenchmark references the Mocha projects at their actual paths, the ExceptionPolicies example calls AddResilience, and handler parameters that a framework requires but the benchmark doesn't use are named _ and __.
  • Mocha.Mediator.Benchmarks no longer pins Microsoft.Extensions.DependencyInjection, ObjectPool, and Hosting to 10.0.0. On net11.0 the pins conflicted with the 11.0 versions Mocha.Mediator depends on (MSB3277), and the benchmarks failed at runtime because Microsoft.Extensions.ObjectPool 11.0 was missing. The NU1605 and NU1608 suppressions go with them.
  • The two committed files under MediatorShowcase/Generated/ are removed, because src/Mocha/src/.gitignore already ignores that folder and every build rewrote them. Mocha.Analyzers also drops an unnecessary ! from code that only Release builds compile.

Running the BenchmarkDotNet benchmarks on net11.0 needs a BenchmarkDotNet change and is left for a follow-up.

Test plan

  • dotnet build src/All.slnx passes with no warnings.
  • A Release build of src/All.slnx that reuses a restore made without a configuration passes, so the analyzer config also covers code that only Release builds compile.
  • The Mocha.Mediator.Benchmarks command, Wolverine, and Immediate.Handlers benchmarks ran under a dry job with BenchmarkDotNet 0.16.0-preview.2 swapped in for the run, because 0.15.8 cannot run net11.0 jobs. Wolverine compiled its handlers at runtime, so the real libraries ran.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues are identified, and the listed project, dependency, build, analyzer, and formatting fixes address the reported integration problems.

No open issues 🎉

What changed in this PR

This PR expands src/All.slnx to include all benchmark and example projects under src/ and fixes the associated build, dependency, analyzer, and formatting issues.

Changes:

  • Adds all previously missing benchmark and example projects to src/All.slnx.
  • Corrects project references, API usage, package-version conflicts, and source-level build issues.
  • Removes stale generated files and applies naming, formatting, and unused-code cleanup across Mocha and Hot Chocolate projects.
File Description
src/​Mocha/​src/​Mocha.Analyzers/​Utils/​CodeWriterExtensions.cs Removes an unnecessary null-forgiving operator.
src/​Mocha/​src/​Examples/​Sagas/​ParallelSaga/​ParallelSaga.cs Removes an unused namespace import.
src/​Mocha/​src/​Examples/​Middleware/​UnitOfWork/​UnitOfWork.cs Removes unused imports and names an unused middleware parameter.
src/​Mocha/​src/​Examples/​Middleware/​CustomMiddleware/​CustomMiddleware.cs Removes unused imports and names an unused middleware parameter.
src/​Mocha/​src/​Examples/​MediatorShowcase/​Handlers.cs Applies static-field naming conventions.
src/​Mocha/​src/​Examples/​MediatorShowcase/​Generated/​Mocha.Analyzers/​Mocha.Analyzers.MediatorGenerator/​MediatorShowcaseMediatorBuilderExtensions._5hYhW_IBO7W3L_MSoxCPw.g.cs Removes a committed generated mediator source file.
src/​Mocha/​src/​Examples/​MediatorShowcase/​Generated/​Microsoft.AspNetCore.App.SourceGenerators/​Microsoft.AspNetCore.SourceGenerators.PublicProgramSourceGenerator/​PublicTopLevelProgram.Generated.g.cs Removes a committed generated program source file.
src/​Mocha/​src/​Examples/​HandlersAndConsumers/​CustomConsumer/​CustomConsumer.cs Removes an unused namespace import.
src/​Mocha/​examples/​ExceptionPolicies/​Program.cs Updates the example to use AddResilience.
src/​Mocha/​examples/​ExceptionPolicies/​Handlers/​Handlers.cs Applies static-field naming conventions.
src/​Mocha/​examples/​AzureServiceBusTransport/​AzureServiceBusTransport.ShippingService/​Program.cs Removes unused namespace imports.
src/​Mocha/​examples/​AzureServiceBusTransport/​AzureServiceBusTransport.ShippingService/​Handlers/​PrepareShipmentRequestHandler.cs Applies static-field naming conventions.
src/​Mocha/​examples/​AzureServiceBusTransport/​AzureServiceBusTransport.ShippingService/​Handlers/​OrderPlacedEventHandler.cs Applies static-field naming conventions.
src/​Mocha/​examples/​AzureServiceBusTransport/​AzureServiceBusTransport.OrderService/​Program.cs Removes an unused namespace import.
src/​Mocha/​examples/​AzureServiceBusTransport/​AzureServiceBusTransport.OrderService/​OrderSimulatorWorker.cs Applies static-field naming conventions.
src/​Mocha/​examples/​AzureServiceBusTransport/​AzureServiceBusTransport.NotificationService/​Program.cs Removes an unused namespace import.
src/​Mocha/​examples/​AzureServiceBusTransport/​AzureServiceBusTransport.AppHost/​AppHost.cs Removes unused namespace imports.
src/​Mocha/​benchmarks/​PostgresBenchmark/​PostgresBenchmark.csproj Corrects project-reference paths to the Mocha projects.
src/​Mocha/​benchmarks/​PostgresBenchmark/​PostgresBenchmark.cs Simplifies asynchronous benchmark callbacks.
src/​Mocha/​benchmarks/​Mocha.Mediator.Benchmarks/​Mocha.Mediator.Benchmarks.csproj Removes conflicting Microsoft.Extensions package pins and warning suppressions.
src/​Mocha/​benchmarks/​Mocha.Mediator.Benchmarks/​Messaging/​WolverineMessages.cs Applies static-field and unused-parameter naming conventions.
src/​Mocha/​benchmarks/​Mocha.Mediator.Benchmarks/​Messaging/​SwitchMediatorMessages.cs Applies static-field naming conventions.
src/​Mocha/​benchmarks/​Mocha.Mediator.Benchmarks/​Messaging/​PipelineBenchmarks.cs Adds required braces around conditional returns.
src/​Mocha/​benchmarks/​Mocha.Mediator.Benchmarks/​Messaging/​NotificationBenchmarks.cs Adds required braces around conditional returns.
src/​Mocha/​benchmarks/​Mocha.Mediator.Benchmarks/​Messaging/​Messages.cs Applies static-field naming and formatting conventions.
src/​Mocha/​benchmarks/​Mocha.Mediator.Benchmarks/​Messaging/​MediatorSgMessages.cs Applies static-field naming and formatting conventions.
src/​Mocha/​benchmarks/​Mocha.Mediator.Benchmarks/​Messaging/​MassTransitMessages.cs Applies static-field naming conventions.
src/​Mocha/​benchmarks/​Mocha.Mediator.Benchmarks/​Messaging/​ImmediateHandlersMessages.cs Applies static-field and unused-parameter naming conventions.
src/​Mocha/​benchmarks/​Mocha.Mediator.Benchmarks/​Messaging/​FullPipelineMessages.cs Applies static-field and unused-parameter naming conventions.
src/​Mocha/​benchmarks/​Mocha.Mediator.Benchmarks/​Messaging/​FullPipelineBenchmarks.cs Adds required braces around conditional returns.
src/​Mocha/​benchmarks/​Mocha.Mediator.Benchmarks/​Messaging/​ConcurrentPipelineBenchmarks.cs Removes unused benchmark setup and applies formatting fixes.
src/​Mocha/​benchmarks/​Mocha.Mediator.Benchmarks/​Messaging/​CommandBenchmarks.cs Adds required braces around conditional returns.
src/​Mocha/​benchmarks/​Mocha.Mediator.Benchmarks/​Messaging/​BenchmarkSetup.cs Removes an unused namespace import.
src/​Mocha/​benchmarks/​Mocha.Mediator.Benchmarks/​Internal/​PoolingBenchmarks.cs Applies static-field naming conventions to the thread-static cache.
src/​Mocha/​benchmarks/​Mocha.Mediator.Benchmarks/​Internal/​PipelinePatternBenchmarks.cs Removes an unused import and applies naming conventions.
src/​Mocha/​benchmarks/​Mocha.Mediator.Benchmarks/​Internal/​LookupBenchmarks.cs Applies naming conventions and simplifies service-provider usage.
src/​Mocha/​benchmarks/​Mocha.Mediator.Benchmarks/​Internal/​DispatchPatternBenchmarks.cs Applies naming, brace, formatting, and dispatch-pattern changes.
src/​HotChocolate/​Language/​benchmarks/​Language.Benchmarks/​UnescapeBenchmarks.cs Removes an unused namespace import.
src/​HotChocolate/​Language/​benchmarks/​Language.Benchmarks/​ReaderBenchmarks.cs Removes an unused namespace import.
src/​HotChocolate/​Language/​benchmarks/​Language.Benchmarks/​ParserBenchmarks.cs Removes an unused namespace import.
src/​HotChocolate/​Core/​benchmarks/​Execution.Abstractions.Benchmarks/​NarrowConditionCachedExecutionBenchmark.cs Removes unused namespace imports.
src/​All.slnx Adds all previously omitted benchmark and example projects to the solution.

Review effort: Lite

@glen-84
glen-84 merged commit b39362c into main Nov 10, 2026
160 checks passed
@glen-84
glen-84 deleted the gai/build-all-benchmarks-and-examples branch November 10, 2026 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants