Skip to content

Suppress ReSharper nullability errors in Mocha#9545

Merged
glen-84 merged 3 commits intomainfrom
gai/suppress-nullability-errors
Apr 16, 2026
Merged

Suppress ReSharper nullability errors in Mocha#9545
glen-84 merged 3 commits intomainfrom
gai/suppress-nullability-errors

Conversation

@glen-84
Copy link
Copy Markdown
Member

@glen-84 glen-84 commented Apr 13, 2026

Summary of the changes (Less than 80 chars)

  • Suppress ReSharper nullability errors in Mocha.

Copilot AI review requested due to automatic review settings April 13, 2026 17:46
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR suppresses ReSharper nullable-contract inspections in Mocha where the code performs null checks on members that are declared non-nullable, reducing IDE noise during development.

Changes:

  • Added ReSharper ConditionIsAlwaysTrueOrFalseAccordingToNullableAPIContract suppressions around null checks in transport description building.
  • Added the same suppressions around outbound route lifecycle checks (Endpoint is null) during initialization/discovery.
  • Added suppressions in routing/indexing logic when checking endpoint addresses for null.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 8 comments.

File Description
src/Mocha/src/Mocha/Transport/MessagingTransport.cs Suppresses ReSharper warnings around null checks for receive/dispatch endpoint resources in Describe().
src/Mocha/src/Mocha/Transport/MessagingTransport.Lifecyle.cs Suppresses ReSharper warnings around outbound route endpoint-null checks during setup/discovery.
src/Mocha/src/Mocha/MessageTypes/OutboundRoute.cs Suppresses ReSharper warning around Endpoint null check in Describe().
src/Mocha/src/Mocha/Endpoints/EndpointRouter.cs Suppresses ReSharper warnings around address-null checks while updating the endpoint address index.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/Mocha/src/Mocha/Transport/MessagingTransport.Lifecyle.cs
Comment thread src/Mocha/src/Mocha/Transport/MessagingTransport.Lifecyle.cs
Comment thread src/Mocha/src/Mocha/Transport/MessagingTransport.Lifecyle.cs
Comment thread src/Mocha/src/Mocha/MessageTypes/OutboundRoute.cs
Comment thread src/Mocha/src/Mocha/Endpoints/EndpointRouter.cs
Comment thread src/Mocha/src/Mocha/Endpoints/EndpointRouter.cs
Comment thread src/Mocha/src/Mocha/Transport/MessagingTransport.cs
Comment thread src/Mocha/src/Mocha/Transport/MessagingTransport.cs
@glen-84 glen-84 marked this pull request as draft April 13, 2026 17:52
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 0.00%. Comparing base (71cedc3) to head (d52d852).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@     Coverage Diff      @@
##   main   #9545   +/-   ##
============================
============================

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@glen-84
Copy link
Copy Markdown
Member Author

glen-84 commented Apr 13, 2026

@Copilot What do you think about your own review here?

I think the review was directionally thoughtful, but not well calibrated for this PR.

The core idea in the comments on ReceiveEndpoint.Source and DispatchEndpoint.Destination was reasonable: if something is genuinely nullable in supported use, the type system should say so. But in this case it pushed too hard toward “make the API nullable” and didn’t weigh the cost of widening a public contract just to silence a ReSharper warning. For a PR titled “Suppress ReSharper nullability errors in Mocha,” that’s too big a design leap.

What I’d say now is:

The review found a real tension between lifecycle state and nullability annotations.
It overstated the best fix. Targeted suppression was a better answer than changing public nullability.
I’d downgrade it from a design concern to a tooling/lifecycle note: “the analyzer can’t model this lifecycle cleanly; localized suppression is acceptable here.”
So my take is: useful instinct, wrong recommendation.

@glen-84 glen-84 marked this pull request as ready for review April 16, 2026 08:27
@glen-84 glen-84 merged commit 08ddc88 into main Apr 16, 2026
134 checks passed
@glen-84 glen-84 deleted the gai/suppress-nullability-errors branch April 16, 2026 08:42
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