reanahub / reana-client

REANA command-line client
http://reana-client.readthedocs.io/
MIT License
10 stars 44 forks source link

cli: implement `list --shared` argument #687

Open DaanRosendal opened 7 months ago

tiborsimko commented 7 months ago

(1) We have basically two options:

A. By default, we would show to Alice only her personal workflow runs, as previously. And, if Alice would like to access those workflow runs that somebody else shared with her, then she would activate a new CLI option such as --shared-by jane@example.org or a special value --shared-by anyuser.

B. By default, we would show to Alice all runs, mixing her personal work and anything else shared with her by somebody. And Alice would have to resort to using filters such as --filter shared_by=nobody to access her personal work.

Concerning that we are transitioning from a system without sharing, and considering that in typical usage scenarios the personal work of researchers "matters more", as it were, over what was shared, perhaps the first option makes more sense. We should consider also how this will be presented in the web UI, whether we shall show shared workflows by default, or in a dedicated tab.

(2) Note also that in any case, we should offer --filter shared_with=bob@example.org to search for those workflow runs that Alice herself shared with Bob. (And paying attention to special value shared_with=anybody.

(3) Whatever we choose, we should also design a nice new output columns such as:

$ reana-client list --shared-by=anyuser
NAME                                RUN_NUMBER   CREATED               STARTED               ENDED                 STATUS        SHARED_BY
worldpopulation-yadage-kubernetes   3            2023-11-05T18:42:00   2023-11-05T18:42:13   2023-11-05T18:43:12   finished      jane@example.org
root6-roofit-yadage-kubernetes      3            2023-11-05T18:41:57   2023-11-05T18:42:10   2023-11-05T18:43:26   finished      kevin@example.org
helloworld-yadage-kubernetes        3            2023-11-05T18:41:55   2023-11-05T18:42:07   2023-11-05T18:43:03   finished      laura@example.org

And, for the other sharing direction, from Alice to others, we could have:

$ reana-client list --shared-with=anyuser
NAME                                RUN_NUMBER   CREATED               STARTED               ENDED                 STATUS        SHARED_WITH
myanalysis                          3            2023-11-05T18:42:00   2023-11-05T18:42:13   2023-11-05T18:43:12   finished      bob@example.org,myresearchteam@cern.ch
myanalysis                          2            2023-11-04T18:42:00   2023-11-04T18:42:13   2023-11-04T18:43:12   finished      cecile@example.org

In the former scenario, "shared by" somebody with Alice, the output will have only one value. In the latter scenario, "shared with" can have many users, so we may need to delimit them by using commas.