-
Notifications
You must be signed in to change notification settings - Fork 20
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
Align client classes with the TSP specification #4
Conversation
src/models/entry.ts
Outdated
/** | ||
* Indicate if the entry will have row data | ||
*/ | ||
hasRowModel?: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
update to generic name in TSP. I think it's hasData
It matches the master of the trace-server-protocol as of today. It will be a breaking change for the trace extension and will need a matching patch in the trace server. I'm working on it, once the builds are fixed there! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tahini, one question below. Also, we need to make sure that we will merge this when all related patches are ready.
const url = this.baseUrl + '/experiments/' + expUUID + '/outputs/timeGraph/' + outputID + '/tree'; | ||
return await RestClient.post<GenericResponse<EntryModel<M, H>>>(url, parameters); | ||
return await RestClient.post<GenericResponse<EntryModel<TimeGraphEntry>>>(url, parameters); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tahini You are removing the generic types here and below. I'm not sure about the implications. Does it mean that the server has to send a TimeGraphEntry in the response and can't send something like (MyEntry extends TimeGraphEntry)? It would be more strict, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed! It is my understanding from a protocol point of view that we should not send random fields that are not documented, but rather let the protocol provide a way to describe the potential arbitrary fields (like name, tooltip, datatype, description, etc), so that implementation can have one generic way to handle them. The consumers should not have to know about all the various entry types, so yeah, the server will have to send a TimeGraphEntry with extra fields described as labels. It would be more strict, but for a good cause I think.
That is the reason behind this issue here: eclipse-cdt-cloud/trace-server-protocol#35 Let me know what you think
Fixes eclipse-cdt-cloud#3 The rest methods should not use generic types, as it would imply that consumers of this client need to know about the details of each potential sub-class, which is one thing we should avoid. Rather the protocol should be self-descriptive to provide extra data in one specific way. Signed-off-by: Geneviève Bastien <[email protected]>
A few fields have been renamed. Signed-off-by: Geneviève Bastien <[email protected]>
The composite directive prevented yarn build from building in the lib directory. Signed-off-by: Geneviève Bastien <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Works with corresponding patches in trace server and theia-trace-extension
Thanks for the review, I'll merge when all the components are ready to merge (the theia-trace-extension one will need to be updated once this is in to link to the new next version of this packages) |
Fixes #3
Signed-off-by: Geneviève Bastien [email protected]