Skip to content

[SPIKE] Add Json Communication Protocol - #11458

Closed
YuliiaKovalova wants to merge 26 commits into
dotnet:mainfrom
YuliiaKovalova:dev/ykovalova/update_communication_protocol
Closed

YuliiaKovalova wants to merge 26 commits into
dotnet:mainfrom
YuliiaKovalova:dev/ykovalova/update_communication_protocol

Conversation

@YuliiaKovalova

@YuliiaKovalova YuliiaKovalova commented Feb 19, 2025

Copy link
Copy Markdown
Member

the changes are made on the top of #11393
many files were touched due to changes in internal static INodePacket FactoryForDeserialization(ITranslatorBase translator)
ITranslator -> ITranslatorBase

Summary

This PR introduces a new JSON-based protocol for communication with dotnet.exe in MSBuild, improving the extensibility and maintainability of our inter-process communication. The implementation includes new interfaces for JSON translation and packet handling, along with the necessary infrastructure to support this protocol.

Changes

  • Added new ITranslatable2 interface extending ITranslatable with JSON translation support
  • Introduced INodePacket2 interface implementing ITranslatable2 for packet handling
  • Implemented JSON protocol logic in new JsonTranslator class
  • Updated TaskHostConfiguration and NodeBuildComplete to implement INodePacket2 (these are registered by OutOfProcTaskHostNode)
  • Updated NodeEndpointOutOfProcBase to instantiate JsonTranslator for .NET host scenarios

Implementation Details

New Interfaces

public interface ITranslatable2 : ITranslatable
{
    void Translate(IJsonTranslator translator);
}

public interface INodePacket2 : ITranslatable2
{
}

Protocol Integration

The JSON protocol is instantiated in NodeEndpointOutOfProcBase when isNetHost is true, providing a clean separation between different communication protocols while maintaining backward compatibility.

Breaking Changes

None. This is a backward-compatible change that introduces new functionality without affecting existing behavior.

OPEN QUESTIONS

  1. Versioning of models
  2. Handshake adjustments- new field that indicates NET runtime OR hardcoded version?

@YuliiaKovalova
YuliiaKovalova force-pushed the dev/ykovalova/update_communication_protocol branch from 0ade4ae to 8dc4afb Compare February 19, 2025 12:08
@YuliiaKovalova

Copy link
Copy Markdown
Member Author

agreed to stick to the existing communication mechanism

@YuliiaKovalova YuliiaKovalova self-assigned this Mar 14, 2025
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.

1 participant