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

Separate project-system-tools into a frontend and backend structure #346

Closed
wants to merge 48 commits into from

Conversation

eric62369
Copy link
Contributor

Description:
In preparation of getting project-system-tools on Codespaces, I need to insert an API that the client can use to communicate between the server and client.
Currently, BuildTableDataSource.cs is used as a bridge between the UI and the loggers and data that collect the binlogs from VS.
The Build.cs type in ProjectSystemTools/BuildLogging/Model is also involved in retrieving log files from the loggers and giving access to them to the UI, so a new BuildSummary.cs (and UIBuildSummary.cs) type is introduced to be exchanged between the client and server sides instead of Build.
In order to insert the Codespaces API in between the client and server side, BuildTableDataSource.cs is being split into a side that lives on the client and the other side on the server.

The new structure for ProjectSystemTools:
There are new namespaces now:

  • BuildLogging/Model/BackEnd

  • BuildLogging/Model/RpcContracts

  • BuildLogging/Model/FrontEnd

  • BuildLogging/Model/BackEnd
    This is responsible for acting as a server for the frontend, where most server requests are handled in BackEndBuildTableDataSource.cs. BackEndBuildTableDataSource.cs also implements the ILoggingDataSource.cs and ILoggingController.cs interfaces.
    This namespace contains all the Logger classes needed to collect build logs.
    This namespace does not import the FrontEnd namespace.

  • BuildLogging/Model/RpcContracts
    This contains the IBuildLoggerService.cs interface, which connects the frontend to the backend.
    This interface is implemented by BuildLoggerService.cs in the BackEnd namespace.
    IBuildLoggerService.cs will eventually be the main service that is proffered by the IServiceBroker in a Codespaces scenario.

  • BuildLogging/Model/FrontEnd
    Contains FrontEndBuildTableDataSource.cs, which implements the IFrontEndBuildTableDataSource.cs
    FrontEndBuildTableDataSource.cs handles giving the UI the data about collected build logs. It uses the IBuildLoggerService.cs interface to send requests to the backend.
    This namespace does not import the BackEnd namespace.

The BuildSummary.cs class:

  • This class is designed to only store data that the frontend will need to know about the build logs.
  • BuildSummary has a unique Id so that the frontend can request for a specific build. The Id incrementor is implemented by Build.cs
  • There is also a wrapper class (UIBuildSummary.cs) that implements IComparable and TryGetValue for use on the UI.

The Build.cs class:

  • Now stored a BuildSummary as part of its data, and also stores data that the backend will need
  • This class will store any data related to filepaths that are contained on the server (log filepaths, file path of the project)

Note:
VS was updated to use an updated SDK, so this workaround was added to Directory.build.props: dotnet/project-system#6458

End goal of this PR:
Have project-system-tools be separated into a client and server side, splitting apart files that have a mix of UI related and data related logic.
Make sure that non-Codespaces project-system-tools works properly in this new frontend backend structure.

Linked Github Issues:
Build ID system uses int type as ID: #345
Continuation of #343

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