-
Notifications
You must be signed in to change notification settings - Fork 10
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
we need to disambiguate UUIDs in the API #165
Comments
To make things worse, there is actually a fourth UUID: S3 generates a UUID called
I decided to label everything
That's a good point about the @yarikoptic How about renaming the upload flow UUID to |
Thank you @dchiquito for the explanation! Although I do appreciate (and even somewhat like a "smart reuse") the "multiple lives of a uuid" (as both
If not to be anyhow used by the client it IMHO either should not be returned to the client client (IMHO preferable), or made explicitly into smth like |
Re Re |
regarding asset uuid, i thought we changed it so that the uuid is added on the server side when returning metadata, but the metadata is not stored with that info. i suspect posting assets with uuids has not yet been taken care of. we should perhaps discuss that separately from the current migration plans. |
Yes, server wouldn't store it on metadata record in DB but IIRC would add it to the record when metadata is requested, and also we have it as uuid in AssetMeta |
I like the idea of using Yarik, I get where you're coming from w.r.t "id" vs. "key", but I think it's best to call everything an "id" and treat them opaquely. Then there's a kind of uniformity in engaging the API, and the names of the parameters can guide as in how to make use of them. *Ideally this would be |
I would strongly disagree on adding Also note
|
note (primarily to myself ;)): in DandiMeta schema we do not have
so under the premise of
+1 (edit -- -1 on that
+1 on that, i.e. making |
@dchiquito so what is your take on making |
I think that will work. I will work on that this morning. |
Great, hopefully it would also resolve dandi/dandi-cli#479 (comment) |
attn @jwodder the response from
and the response from
|
"Moving" discussion from dandi/dandi-cli#478 (comment)
In #150 we used
uploads:upload_id
,blobs:key
andassets:uuid
to spec out new upload API and things were clear. But after #156 (and possibly subsequent changes) all of those 3 became a UUID, and now manifest themselves as a "uuid" throughout API interface on swagger. It becomes a huge source of confusion (at least) to me.E.g. now looking at
PUT /dandisets/{versions__dandiset__pk}/versions/{versions__version}/assets/{uuid}/
in swagger which is documented to be for "Update the metadata of an asset.", I expect no need for any UUID since we are updating an existing asset with a known UUID (from endpoint), but parameters includeuuid* | string($uuid) title: Uuid
and it is not clear not only why we need a UUID there and what UUID is expected:of a blob? but I am just updating metadata...
and POST should be used to just create a new asset since we are no longer "tracking" some notion of an "identity" of an asset after #143edit: ok -- it might beblobs:uuid
if we want to replace an asset (in a path) with a new asset, butblobs:uuid
should be optional in such case -- from looks of it seems to be required (separate issue?); alternative - just removeuuid
from that PUT and thenPOST
just be used for that and API would handle removing prior asset with thatpath
.Moreover: I do not see any reason to have
upload_id
to be auuid
-- unlike forblobs:uuid
AKAblobs:key
(I would have even kept it calledkey
for disambiguation) which should be something of consistent length and randomly evenly spread out for blobs keystore, and assets should be a globally unique identifier,upload_id
as a simple auto-increment index would be just as fine IMHO.So I would suggest following changes
uploads
table:uuid
->upload_id
(and do not bother making it uuid at all, unless there is any benefit)blobs
table:uuid
->key
(which ATM indeed should be a uuidv4 in its value)and leave
uuid
to be used only withinassets
table.The text was updated successfully, but these errors were encountered: