Skip to content

Conversation

phn-ms
Copy link
Contributor

@phn-ms phn-ms commented Jun 26, 2025

Adopt C# 12 collection expressions for array and list initialization, update async test methods to return Task, add braces to single-line if statements, and apply minor style improvements (e.g., var usage, u8 string literals, concise record/class definitions). No changes to business logic or test coverage.

Copy link

codecov bot commented Jun 26, 2025

Codecov Report

Attention: Patch coverage is 66.04938% with 110 lines in your changes missing coverage. Please review.

Project coverage is 65.8%. Comparing base (cc6e766) to head (af99700).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
...Stanley.ComposeUI.DesktopAgent/Fdc3DesktopAgent.cs 66.6% 19 Missing and 11 partials ⚠️
...gAdapter.Abstractions/MessagingAdapterException.cs 0.0% 20 Missing ⚠️
...ingAdapter.MessageRouter/MessageRouterMessaging.cs 83.8% 9 Missing and 1 partial ⚠️
...ng/dotnet/src/Client/Client/MessageRouterClient.cs 68.1% 6 Missing and 1 partial ⚠️
...ssaging/dotnet/src/Core/MessageRouterExtensions.cs 36.3% 7 Missing ⚠️
...cture/Internal/Fdc3DesktopAgentMessagingService.cs 85.7% 4 Missing and 1 partial ⚠️
.../Infrastructure/Internal/ResolverUICommunicator.cs 63.6% 4 Missing ⚠️
...nt/Infrastructure/Internal/UserChannelSetReader.cs 20.0% 4 Missing ⚠️
...ions/MessagingAdapterDuplicateEndpointException.cs 0.0% 4 Missing ⚠️
...anStanley.ComposeUI.Utilities/CommandLineParser.cs 20.0% 2 Missing and 2 partials ⚠️
... and 8 more

❌ Your patch status has failed because the patch coverage (66.0%) is below the target coverage (100.0%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##            main   #1041     +/-   ##
=======================================
- Coverage   65.9%   65.8%   -0.1%     
=======================================
  Files        333     343     +10     
  Lines       9956   10061    +105     
  Branches    1201    1158     -43     
=======================================
+ Hits        6567    6627     +60     
- Misses      3128    3169     +41     
- Partials     261     265      +4     
Files with missing lines Coverage Δ
...nley.ComposeUI.DesktopAgent/Channels/AppChannel.cs 50.0% <ø> (ø)
...ley.ComposeUI.DesktopAgent/Channels/UserChannel.cs 100.0% <ø> (ø)
...encyInjection/Fdc3DesktopAgentBuilderExtensions.cs 60.0% <100.0%> (ø)
...anley.ComposeUI.DesktopAgent/Fdc3ShutdownAction.cs 68.0% <ø> (ø)
...anley.ComposeUI.DesktopAgent/Protocol/AppIntent.cs 50.0% <ø> (ø)
src/messaging/dotnet/src/Core/MessageBuffer.cs 75.5% <ø> (ø)
...et/src/Core/Protocol/Json/JsonMessageSerializer.cs 75.6% <ø> (ø)
...oseUI.MessagingAdapter.Abstractions/JsonFactory.cs 100.0% <100.0%> (ø)
...agingAdapter.Abstractions/MessageAdapterContext.cs 100.0% <100.0%> (ø)
...dapter.Abstractions/MessageBufferJsonExtensions.cs 100.0% <100.0%> (ø)
... and 22 more

... and 2 files with indirect coverage changes

🚀 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.

@phn-ms phn-ms force-pushed the messagerouter_decoupling branch 2 times, most recently from aa2c89e to 996ca23 Compare July 4, 2025 10:51
@phn-ms phn-ms changed the title chores: Modernize codebase with C# 12 features and cleanup Refactor ComposeUI Desktop Agent project to be independent of the IMessagingService implementation Jul 4, 2025
@phn-ms phn-ms marked this pull request as ready for review July 4, 2025 14:13
@phn-ms phn-ms requested a review from a team as a code owner July 4, 2025 14:13
@phn-ms phn-ms force-pushed the messagerouter_decoupling branch from 2be7409 to 55b7276 Compare July 7, 2025 12:21
phn-ms added 2 commits July 11, 2025 12:21
Refactor code for readability and consistency: add braces to all control blocks, use collection initializers, modernize byte array creation, and standardize variable declarations. Update formatting, comments, and remove unnecessary IAsyncDisposable from IMessageRouter. No functional changes.
Refactor the FDC3 DesktopAgent and related test projects to use the new MorganStanley.ComposeUI.MessagingAdapter.Abstractions interfaces (IComposeUIMessaging, MessageAdapterContext, etc.) in place of the legacy messaging abstractions. Update all message handling to use string payloads instead of MessageBuffer, and replace exception and utility types with their MessagingAdapter equivalents. Refactor logging to use structured templates, modernize test method signatures and collection initializations, and update all mocks and verifications to match the new API. Add new projects for the messaging adapter abstraction and implementation, update solution and project references, and introduce DI registration via AddComposeUIMessagingAdapter. These changes improve modularity, testability, and future extensibility of the messaging infrastructure.
Copy link
Contributor

@lilla28 lilla28 left a comment

Choose a reason for hiding this comment

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

Tests are missing. but I am okay to go forward without that.

- Replaced IComposeUIMessaging with IMessaging across solution, updating all references and DI registrations to use MessageRouterMessagingAdapter.
- Added new messaging adapter abstractions and MessageRouter implementation projects targeting .NET Standard 2.0 and .NET 8.0.
- Updated solution and project files to reference new source locations and include solution items for build/package props.
- Modernized code: adopted C# 12 collection expressions, standardized ValueTask usage, improved async/await patterns, and made methods static where appropriate.
- Refactored channel and messaging service classes for improved disposal logic, logging, and error handling.
- Updated tests to use new messaging abstractions and renamed test classes for consistency.
- Removed obsolete MessagingAdapter.Abstractions project and related files; added new abstractions and polyfills for .NET Standard compatibility.
- Improved documentation, code style, and null-handling throughout.
- Added new Fdc3DesktopAgentMessagingService and ResolverUICommunicator classes for FDC3-compliant messaging and intent resolution.
- Updated dependencies: added Microsoft.Bcl.AsyncInterfaces, System.Collections.Immutable, and System.ComponentModel.Annotations.
- Improved cross-platform compatibility by targeting .NET Standard 2.0 in key projects and adding IsExternalInit polyfill.
@phn-ms phn-ms force-pushed the messagerouter_decoupling branch from dfbb18d to af99700 Compare July 14, 2025 12:41
@phn-ms phn-ms merged commit ae83a75 into morganstanley:main Jul 14, 2025
3 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants