Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPIKE] Add Json Communication Protocol #11458

Draft
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

YuliiaKovalova
Copy link
Member

@YuliiaKovalova YuliiaKovalova commented Feb 19, 2025

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