ki-tools / kitools-py

Tools for working with data in Ki analyses
Apache License 2.0
3 stars 0 forks source link

Handle duplicate remote files in resources #33

Open pcstout opened 5 years ago

pcstout commented 5 years ago

We can end up with a remote file or directory having duplicate resource entries. data_push/pull/remove/change will error if providing an identifier that matches more than one resource.

We need to decide how to handle these.

Example config showing duplicates (syn:syn18676190):

{
  "name": "syn:syn18676187",
  "version": null,
  "remote_uri": "syn:syn18676187",
  "id": "ba469348-59da-4d36-b4c2-a7112971be20",
  "rel_path": "data/core/data1/core/F1",
  "root_id": null,
  "data_type": "core"
},
{
  "name": "test_file_B.txt",
  "version": null,
  "remote_uri": "syn:syn18676190",
  "id": "a790ea4d-5866-4fc5-9a55-0e9c2040ef37",
  "rel_path": "data/core/data1/core/F1/F2/F3/test_file_B.txt",
  "root_id": "ba469348-59da-4d36-b4c2-a7112971be20",
  "data_type": "core"
},
{
  "name": "syn:syn18676190",
  "version": null,
  "remote_uri": "syn:syn18676190",
  "id": "9dabb5e2-8514-47a6-854f-ebaf57ab8c81",
  "rel_path": "results/data1/core/F1/F2/F3/test_file_B.txt",
  "root_id": null,
  "data_type": "results"
}
hafen commented 5 years ago

I may be missing something but I think it's fine to error if more than one entry of the same remote resource is attempted to be added to the project. The only case where I could see this being an issue is if someone wants to have two different versions of the same file in their project, but I would just say that we go ahead and say we don't support that.