-
Notifications
You must be signed in to change notification settings - Fork 61
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
Investigation: update experiments as part of the REST API (TSP) #608
Comments
PUT commands require to be idempotent, multiple requests have to have the same outcome. For a PUT to be idempotent, it is required to provide all parameters that makes up an experiment to be sent in the PUT command, e.g. name and traces. PATCH commands don't have that requirement of having to be idempotent. They can be idempotent, but don't have to. It can be used to update part of the experiment resource. For both PUT and PATCH, the experiment UUID must not change. The Trace Server implementation needs to be able to provide that. RenameFor renaming of the experiment I think PATCH would be more suitable because only the to be modified Add/Remove TracesAdding and removing of traces in an experiment will affect the start/end time, available views and other capabilities. The front-end will need to be fully refreshed and any invalid views need to be removed. I would argue to close the experiment before doing this action. Other updates (e.g. offsetting of traces)Generally, other updates, e.g. change of experiment type, can be done using a PATCH command. Offsetting traces in an experiment is useful to align the time from different traces. NotesThe trace server implementation have to be able to handle the modification of the experiment concurrently with other clients sending requests towards the same experiment instances (same UUID). Implementation approachImplement each feature incrementally to be able to focus on one feature at a time (full-stack implementation). For each feature update API specification, server implementation, tsp-typescript-client/tsp-python-client and then front-end.
|
I think it would be worth it to benefit from the recently introduced
|
I can add an ADR for this. Will give me a chance to try it out myself. Thanks for the suggestion. |
Contributes to eclipse-cdt-cloud#608 Signed-off-by: Bernd Hufmann <[email protected]>
Contributes to eclipse-cdt-cloud#608 Signed-off-by: Bernd Hufmann <[email protected]>
Contributes to eclipse-cdt-cloud#608 Signed-off-by: Bernd Hufmann <[email protected]>
Contributes to eclipse-cdt-cloud#608 Signed-off-by: Bernd Hufmann <[email protected]>
Contributes to eclipse-cdt-cloud#608 Signed-off-by: Bernd Hufmann <[email protected]>
#688 adds an ADR for renaming of an experiment and add/remove of traces in an experiment. Other updates, e.g. offsetting of traces, are not part of the ADR. I'll create a separate tracker for offsetting of traces. |
Contributes to eclipse-cdt-cloud#608 Signed-off-by: Bernd Hufmann <[email protected]>
Contributes to #608 Signed-off-by: Bernd Hufmann <[email protected]>
I have another suggestion that is not reflected in the ADR as of today, yet. I think we could use custom command suffixes to define endpoints to do different behaviours, like rename experiment, add/remove traces from experiments. Use POST, PUT or PATCH depending on action. POST makes sense for rename because it moves one resource to a new one:
|
Triggered by the server update proposal [1] and the TSP specification for that [2] some design thinking needs to decide the way forward. Updates in TSP, server and front-end will triggered based on the decision made for this.
Background:
The TSP specification [2] proposes a PUT command on the
tsp/experiments/{expUUID}
endpoint for the following use cases:The implementation of a PUT command requires to be idempotent, which means calling it once or several times successively has the same effect. This means the UUID cannot change for the experiment.
The current Trace Compass server implementation, however, creates the UUID based on the experiment name and persists the experimented as folder resource in the server workspace. Renaming an experiment will require to change the UUID. However, this would break the idempotent requirement.
Moreover, it is not clear if adding or removing of traces should be seen as the same experiment. If yes, then UUID cannot change and a PUT command can be used. If it cannot be seen as a same experiment, then a POST command would be more appropriate.
This ticket is to discuss the way forward for updating of experiments. Based on the outcome, issue trackers and updates will be triggered in relevant components.
[1] https://git.eclipse.org/r/c/tracecompass.incubator/org.eclipse.tracecompass.incubator/+/187742
[2] https://github.com/theia-ide/trace-server-protocol/blob/34d244cc35e652681b2f003d3bd69100da6541d6/API.yaml#L216
The text was updated successfully, but these errors were encountered: