-
Notifications
You must be signed in to change notification settings - Fork 20
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
StorageAdapter Versioning Implementation #932
Conversation
Co-authored-by: Anna Headley <[email protected]>
c07b4c1
to
97f979f
Compare
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.
Sorry this review took so long. It looks good to me, some requests for comments / organization.
|
||
def upload_version(id:, file:) | ||
version_timestamp = current_timestamp | ||
version_id = version_id(id) |
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.
might be nice to name the local variable different from the method
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.
Maybe comment why we're getting this? It seems like it's the version id of the file that, before this new file is uploaded, is the current version. And that it's used to get/create the correct file path for the file we're about to upload.
Co-authored-by: hackartisan <[email protected]>
Co-authored-by: hackartisan <[email protected]>
Co-authored-by: hackartisan <[email protected]>
end | ||
|
||
def current_timestamp | ||
Time.now.strftime("%s%N") |
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.
Would milliseconds (%L) be good enough here? It would save 6 characters in every filename.
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.
Apparently not, one of the tests fails. Computer's too fast. 😎
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.
I could re-call if the file already exists, probably a good safety measure.
b7a73e8
to
54b5dad
Compare
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.
Way to make it happen!! Should we remove the unused keyword param mentioned inline.
|
||
# Delete the file on disk associated with the given identifier. | ||
# @param id [Valkyrie::ID] | ||
def delete(id:, purge_versions: false) |
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.
purge_versions no longer used
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.
Good catch, removed.
This adds a versioning implementation to Valkyrie StorageAdapters and implements it for a new versioned disk adapter and Fedora 4/5/6.
There's a follow-on ticket to do here: #934
As this doesn't change the API or outcomes of any of the adapters this is a minor release.