-
Notifications
You must be signed in to change notification settings - Fork 18
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 origin tracking to files #193
Conversation
d5a502b
to
a46dad2
Compare
LGTM - I like the enum for origin type. |
@@ -394,4 +394,4 @@ def packfile(self, cont_name, **kwargs): | |||
else: | |||
raise Exception('Not authorized') | |||
|
|||
return upload.process_upload(self.request, upload.Strategy.packfile) | |||
return upload.process_upload(self.request, upload.Strategy.packfile, None, None, self.origin) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to avoid this None, None,
you can do origin=self.origin
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a great point. I don't like doing stuff like this because the params inevitably change and I mess up :) Changing now.
LGTM - just a couple of comments. |
Comments addressed and rebased.
Any thoughts on this @rentzso? I'll be out for a decent chunk of today, so if you have ideas feel free to throw them on this branch. |
@kofalt I will check. It is related to the new validation endpoint for serving schemas. |
New commit 6b5a42a has fixed the problem as far as I can tell. Merging. |
All files now have an
origin
map, with atype
string (device, user, job, or unknown) and anid
field pointing to the corresponding document. If a file was stored before this change, the type returns unknown.In addition, routes that return an object, or objects, with a
files
array, can now take an optionaljoin=origin
request parameter. This will add ajoin-origin
key to each object, containing a context map of the various origin documents. Use this to prevent N calls to various other endpoints.Example:
Example of a
join-origin
:Along the way, the job generator had to gain additional insight to throw job IDs onto upload URLs, the Placer gained an origin field for placing files, not-Placer uploads had origin hacked into them, and the base request init now knows a bit more about the requester.
Closes #163.