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

Add forking API #382

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

davidbrochart
Copy link
Collaborator

@davidbrochart davidbrochart commented Oct 23, 2024

The forking API consists of the following endpoints:

  • PUT /api/collaboration/fork/{root_roomid}: creates a fork of a root document (optionally synchronizing with the root document).
  • DELETE /api/collaboration/fork/{fork_roomid}: deletes a fork of a root document (optionally merging back in the root document).
  • GET /api/collaboration/fork/{root_roomid}: returns the fork IDs of a root document given by its ID.

Jupyter events are emitted when creating and deleting forks.

Copy link
Contributor

Binder 👈 Launch a Binder on branch davidbrochart/jupyter_collaboration/suggestion-api

@davidbrochart davidbrochart added the enhancement New feature or request label Oct 23, 2024
@davidbrochart davidbrochart marked this pull request as draft October 23, 2024 15:27
@davidbrochart davidbrochart force-pushed the suggestion-api branch 3 times, most recently from 6cb8740 to 9185cd1 Compare October 24, 2024 14:18
@davidbrochart davidbrochart marked this pull request as ready for review October 24, 2024 14:33
@davidbrochart davidbrochart force-pushed the suggestion-api branch 5 times, most recently from 78f3867 to 49f3ef1 Compare October 25, 2024 07:29
@trungleduc
Copy link
Member

Downstream users need to interact with the REST API and the Event handlers directly or will you introduce the JS APIs later?

@davidbrochart
Copy link
Collaborator Author

Downstream users need to interact with the REST API and the Event handlers directly or will you introduce the JS APIs later?

Yes we can add higher-level JavaScript functions, maybe in another PR?

On a different note, I'm not sure if a fork's room ID should just be uuid, or format:type:uuid. Currently it's the former, because if it were the latter it would be interpreted as a stored document, but we don't want forks to be stored, do we?

@trungleduc
Copy link
Member

Yes we can add higher-level JavaScript functions, maybe in another PR?

Yes, let's merge this one then I can work on this

@davidbrochart
Copy link
Collaborator Author

On a different note, I'm not sure if a fork's room ID should just be uuid, or format:type:uuid. Currently it's the former, because if it were the latter it would be interpreted as a stored document, but we don't want forks to be stored, do we?

We need to answer this question before merging.

@trungleduc
Copy link
Member

if it's only about changing the ID format, Isn't it safer to store the forks and we can remove them later if we don't have to?

@davidbrochart
Copy link
Collaborator Author

But a stored document currently means that it goes through the Jupyter file ID service and that it is a file-backed document. So that would mean adding logic to manage (temporary) files for these forks.

@trungleduc
Copy link
Member

ah, I thought that the fork data is saved into the .jupyter_ystore.db file

@davidbrochart
Copy link
Collaborator Author

If it's a stored document yes, but it's not at the moment.

@trungleduc
Copy link
Member

creating a file-less document where all data is stored in the .jupyter_ystore.db file could also be useful for the chat application?

@davidbrochart
Copy link
Collaborator Author

Yes. But does it make sense to store suggestions?

@trungleduc
Copy link
Member

Yes. But does it make sense to store suggestions?

Google Docs keeps the suggestions till we explicitly delete them so I say yes.

@davidbrochart
Copy link
Collaborator Author

I'm thinking that we should maybe create a new branch to work on forking/suggestions, instead of taking the risk to block main or release completely WIP code.

@davidbrochart
Copy link
Collaborator Author

But then it won't help you if you want to use the new features in JupyterCAD?

@trungleduc
Copy link
Member

But then it won't help you if you want to use the new features in JupyterCAD?

there is no problem, I can link my work with your PR

@jtpio
Copy link
Member

jtpio commented Oct 28, 2024

Wouldn't the forks need be saved also in the case of server restarts? Users would probably expect their suggestions to be there if they resume their work later?

But then it won't help you if you want to use the new features in JupyterCAD?

Maybe there could be some pre-releases made from the new branch? Or one could download the artifacts built by the releaser to use the latest version.

@trungleduc
Copy link
Member

trungleduc commented Oct 30, 2024

@davidbrochart could you rebase this PR to bump its version to 3.0.0? I trying to install it locally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants