Skip to content

Mongo 2: Rollback API#1067

Merged
subdavis merged 2 commits into
develop-mongo-tracksfrom
mongo/rollback
Dec 28, 2021
Merged

Mongo 2: Rollback API#1067
subdavis merged 2 commits into
develop-mongo-tracksfrom
mongo/rollback

Conversation

@subdavis
Copy link
Copy Markdown
Contributor

@subdavis subdavis commented Nov 22, 2021

Reviewer notes

This could have been included in #1066 but it's a new feature, so I made it separate. It provides a read API for rolling back to earlier versions.

Important

This implementation is naive and I don't want to keep it forever. It's a true rollback such that it actually deletes rows from the DB. I would prefer a soft rollback like git revert which replays changes in reverse. But that sounded complicated and I didn't feel like writing it.

@subdavis subdavis added this to the Annotations in MongoDB milestone Nov 22, 2021
@subdavis subdavis force-pushed the mongo/server-side-implementation branch from 337d8c6 to 1578509 Compare December 8, 2021 20:13
@subdavis subdavis force-pushed the mongo/server-side-implementation branch from 1578509 to 477f794 Compare December 19, 2021 20:46
Base automatically changed from mongo/server-side-implementation to develop-mongo-tracks December 20, 2021 14:07
@subdavis subdavis force-pushed the develop-mongo-tracks branch from d677718 to acd9c94 Compare December 20, 2021 14:17
Copy link
Copy Markdown
Collaborator

@BryonLewis BryonLewis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much simpler with the re-base. I pulled and tested it and it seems to work properly removing the annotations after the revision number.

The only thing I would comment on is that it's a little unclear that when you give a DELETE with Revision = 5 - it really means DELETE all those revisions that are > 5 and not remove everything including 5. I think as long as it's clear in the documentation that should be okay though.

@waxlamp
Copy link
Copy Markdown
Member

waxlamp commented Dec 23, 2021

Much simpler with the re-base. I pulled and tested it and it seems to work properly removing the annotations after the revision number.

The only thing I would comment on is that it's a little unclear that when you give a DELETE with Revision = 5 - it really means DELETE all those revisions that are > 5 and not remove everything including 5. I think as long as it's clear in the documentation that should be okay though.

I'm uneasy with this being a DELETE operation at all, because it's not really (in the REST or CRUD sense). However, since this is a tentative implementation with a long-term aim of a replacement, non-destructive rollback mechanism, it's probably ok.

The main difficulty is that the clients will need to change out DELETE calls for a PATCH or POST call later. To the extent that performing a rollback is a state change from the user's POV, rather than a change in the model itself, a POST operation with a verb like rollback sounds like the right abstraction to me; that would also avoid the need for clients to change their calling sequences later. (There's a name for this supplementation of CRUD operations with arbitrary (English) verb-based actions, but I can't find it right now; it's related to DRF's use of the @action decorator in the same context.)

@subdavis subdavis merged commit 06cd9de into develop-mongo-tracks Dec 28, 2021
@subdavis subdavis deleted the mongo/rollback branch December 28, 2021 16:25
subdavis added a commit that referenced this pull request Dec 28, 2021
* Implement rollback

* Switch to POST /dive_annotation/rollback
subdavis added a commit that referenced this pull request Jan 3, 2022
* Implement rollback

* Switch to POST /dive_annotation/rollback
subdavis added a commit that referenced this pull request Jan 20, 2022
* Mongo 1: Server side implementation (#1066)

* Poetry fix (#1087)

* Poetry fix

* Add check for app root

* Desktop/sealion multicam (#1024)

* init

* Allowing multicam to write tracks

* inut name change

* lint fixes

* Updates to multicam

* fixing import loading

* removing multicamImageFiles change

* Fixing various issues

* mend

* mend

* switching to every

* Example without fetching metadata (#1088)

Co-authored-by: Brandon Davis <brandon.davis@kitware.com>

* Server-side implementation

* Include description and timestamp

* Respond to comments

* Switch to checking mongo results

* select sub-element

* Unmangle indices

Co-authored-by: BryonLewis <61746913+BryonLewis@users.noreply.github.com>

* Mongo 2: Rollback API (#1067)

* Implement rollback

* Switch to POST /dive_annotation/rollback

* Mongo 3: Utilize new endpoints in celery (#1068)

* Utilize new endpoints in celery

* Respond to comments

* Linting, formatting, and unit tests

* respond to comments

* Import shutil

* Client changes to support revisions (#1070)

* Remove broken summary and report generation (#1071)

* Add simple sharing test and new indices

* Migraction script updates

* Add loading state to clone button

* label fetch

Co-authored-by: BryonLewis <61746913+BryonLewis@users.noreply.github.com>
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.

3 participants