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

Support read-only mode for V1 #1689

Closed
tcompa opened this issue Jul 25, 2024 · 2 comments · Fixed by #1701
Closed

Support read-only mode for V1 #1689

tcompa opened this issue Jul 25, 2024 · 2 comments · Fixed by #1701
Assignees
Labels

Comments

@tcompa
Copy link
Collaborator

tcompa commented Jul 25, 2024

Re-thinking about #1655: does it make sense to move from FRACTAL_API_V1_MODE="include_without_submission" to FRACTAL_API_V1_MODE="include_read_only"? (cc @jluethi)

That is: when the user cannot submit jobs, is it still necessary that they can create/modify/delete projects/workflows/tasks/... ? I'd say we should simply disable any /api/v1/ endpoint apart from the GET ones.

@jluethi
Copy link
Collaborator

jluethi commented Jul 25, 2024

Totally agreed! A read-only Fractal V1 mode seams reasonable to me and fulfills the core requirement of: V1 is turned off, but I can still see what I processed in V1.

The fine parts that could make this somewhat tricky:

  1. Would we then start triggering lots of weird errors when a user e.g. clicks add-task? Or would we have to do a lot of Fractal web work to disable all the buttons?
  2. Is all the downloading also in get endpoints? e.g. so users can download V1 workflows if they wanted to? That should remain possible

@tcompa
Copy link
Collaborator Author

tcompa commented Jul 25, 2024

Would we then start triggering lots of weird errors when a user e.g. clicks add-task? Or would we have to do a lot of Fractal web work to disable all the buttons?

The naive approach is that each one of those operations would trigger a 422 error saying "Legacy API is in read-only mode.".
More in detail: we would not remove the /api/v1 endpoints (which would lead e.g. to 404), but rather introduce an if check in each one of them. If FRACTAL_API_V1_MODE="include_read_only", then they would return this 422 error, which I think fractal-web already displays in a clear manner.

Note the difference with FRACTAL_API_V1_MODE="exclude", where no v1 endpoint is included, which should lead to 404..

Is all the downloading also in get endpoints? e.g. so users can download V1 workflows if they wanted to? That should remain possible

This is a GET call

@ychiucco ychiucco linked a pull request Jul 31, 2024 that will close this issue
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

Successfully merging a pull request may close this issue.

3 participants