-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Feature/version metadata #39126
Feature/version metadata #39126
Conversation
|
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.
Added some comments 👍
Some indentations seem to be off, make test-php-style-fix
should fix this.
💥 Acceptance tests pipeline webUISharingExt1-latest-chrome-mariadb10.2-php7.4 failed. The build has been cancelled. |
I'm not sure if we should add You could implement a dedicated interface for the
[1] https://github.com/owncloud/core/blob/feature/version-metadata/apps/dav/lib/Meta/MetaFile.php#L116 About the failing JS test: As the UI now shows the author in the versions tab, you have to adjust the expected result in the tests: https://github.com/owncloud/core/blob/feature/version-metadata/apps/files_versions/tests/js/versionstabviewSpec.js#L71 Feel free to ask if you need any help with that 🙂 On a side note: I tried it on my local instance, but I only see a |
@hodyroff @pushnov-i what about making it optional in admin settings ? Just not to release new feature and reduce blast radius in case of bugs? It touches core functionality of sync/share. I am bit worried what happens when one of that version “copy” commands fails in the middle. How consistent is the state? What about expiring old versions ? Is this also handled (if relevant)? What about acceptance tests here? Unit tests covering major classes ? Tested with encryption? |
@phil-davis thank you, corrected the changes in the version for the interface. @mrow4a not sure if this is related to the expiration, only |
There are 8 version-related unit-tests failing https://drone.owncloud.com/owncloud/core/31947/12/9 You can run them locally by running |
This comment has been minimized.
This comment has been minimized.
@@ -352,7 +352,7 @@ public function testDeleteVersionsOfFolder() { | |||
|
|||
// check if versions are in trashbin | |||
$results = $this->rootView->getDirectoryContent($this->user . '/files_trashbin/versions/' . $name . '/'); | |||
$this->assertCount(1, $results); | |||
$this->assertCount(2, $results); |
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.
Could you check additionally for an explicit expected result value in the second element of $result here? Only if you don't need to jump trough too much hoops.
@@ -352,7 +352,7 @@ public function testDeleteVersionsOfFolder() { | |||
|
|||
// check if versions are in trashbin | |||
$results = $this->rootView->getDirectoryContent($this->user . '/files_trashbin/versions/' . $name . '/'); | |||
$this->assertCount(1, $results); | |||
$this->assertCount(2, $results); |
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.
Could you check additionally for an explicit expected result value in the second element of $result here? Only if you don't need to jump trough too much hoops.
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.
Also in all following assertions.
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.
@IljaN I did a check yesterday with xdebug and just checked once again now - for this specific case the trashbin dir contains two files first one is the file version with the timestamp and the second is the JSON file with metadata:
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.
So if the second file was introduced trough your change we should maybe explicitly check for it. Maybe in a additional test.
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.
Do you imply a completely separate test for the trash bin, or just an additional test if the second file is a JSON, has a valid name, and contains metadata within testDeleteVersionsOfFolder
?
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.
just an additional test if the second file is a JSON, has a valid name, and contains metadata within testDeleteVersionsOfFolder?
This ^
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.
But the more the better ;)
@pushnov-i Looks good now, good work! 🕺 Just a few small nitpicks left. |
@pushnov-i is there a unit/integration test covering backwards compatibility? How code/ui is behaving if there is no metadata-file ? |
This is also a point we should take in to account as the feature will be used first in an ownCloud instance with encryption. |
@pushnov-i the CLA assistant still says that you have not "signed" the CLA. Please press the button to do that. |
@mrow4a @pushnov-i Just checked with @phil-davis. If we merge this all acceptance-tests will be run with encryption (master-key and user-key) as nightly-job. Results will be posted tomorrow by drone in #builds in chat. @pushnov-i Please use the squash-button in github when merging to clean-up the commit history. |
I don't see any changelog. Did I miss it? |
@phil-davis added changelog, fixed space. |
@pushnov-i please click the link to sign the CLA at #39126 (comment) Does it not work for you? Or? |
@phil-davis CLA requires me to change the author of one merge commit since it does not recognize it in github, working on it |
4247c57
to
a0f7f5a
Compare
Kudos, SonarCloud Quality Gate passed! |
The requirement is to see the user who created a version (or: the user who uploaded/saved this state of a file) as part of the version metadata. Basically this enhancement shall allow to "check the last version that Peter created" or "roll back to the state before Peter started working on it". Here's the original input https://github.com/owncloud/enterprise/issues/4518. |
Good - now I think that I understand the requirement, and it seems a perfectly reasonable item of metadata about a file (and versions of a file). The technical thing that I don't think has been implemented in this PR so far is that "the system" needs to know who "created" the current "version" of a file (i.e. the live current data in the file, that is not yet in the version history). That meta-data needs to be stored. For example, if Alice shares a folder with Brian, and Brian uploads "file.txt" into the shared folder, then "the system" needs to remember that the file "creator" is Brian. Then the rest of the logic is simple - When someone changes the file, the code that moves the "now old" data to the version history has to also move the meta-data also to the version history. Then the new file data is written along with new meta-data about who just "created" the now-latest live "version" of the file. |
AFAIR this requirement was removed in a subsequent call => Creator can be checked via activity app. Will clarify with @pmaier1 now. If we need to show the creator than this would mean that we will need to show the very first version of a file in the versions view which we don't do yet. |
We don't have to show the "creator" of the "current version" of a file (the "version" that is not shown in the version history, because it is not yet history!) But technically, IMO, we will have to remember it somewhere so that it is available if and when that data becomes an "old version". At the moment, if
At step (2) it is Brian who is authenticated. I don't think "the system" has any way to reliably know that the original file was created by Alice. At step (3) it is Carol who is authenticated. I don't think "the system" has any way to reliably know that the file before the edit was uploaded by Brian. |
Maybe we can create a specially-named metadata-file which is not returned by the webdav-api but is internally replaced as soon as a new version is available. |
After talk with @pmaier1 Will implement something like this |
I raised an issue to make some acceptance tests for this. We can do that in parallel in a branch on top of this. Note my comment #39504 (comment) Currently for this feature there is no way for end-users to find out who is the author of the data in the current file. If I was user "Alice" looking at a file, and seeing the author of each old version in the version history, an thinking about restoring some version, then probably I am doing it because the current data in the file is "wrong/corrupt" in some way. So I will immediately want to know "who is the author of the current data in the file?" As Alice I can already find out other meta-data about the current file - modified date, tags, comments. Should users be able to find out the "latest author"? |
Possible edge-case: As of now we don't write versions for empty files (filesize=0): So we also shouldn't write metadata for emtpy files. (?) |
And a combination edge-case. If we add some way for users to find out the "author" of the current file, then if there is version history of non-empty versions of the file, and "someone" has uploaded an empty file as the current file, then I think that user Alice will want to know who uploaded the "nothing" to the file. |
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.
Approving for now - Still in Beta Phase - Will be ready before RC
Approving for now - Still in Beta Phase - Will be ready before RC
@janackermann docs relevant 👋, pls file a docs issue. |
Co-authored-by: Ilia Pushnov <[email protected]>
Continued here: #39516 |
Co-authored-by: Ilia Pushnov <[email protected]>
Co-authored-by: Ilia Pushnov <[email protected]>
Co-authored-by: Ilia Pushnov <[email protected]>
Co-authored-by: Ilia Pushnov <[email protected]>
tested in 10.9.0 beta1
|
Note: I am quite sure that the version authors are off-by-one in 10.9.0 beta1. That is being fixed in #39516 |
The file version author is now being saved in an appropriate timestamp-prefixed JSON file and displayed in the version list on PROPFIND request. Rename, copy and deletion are take into account.
Enable with config-flag: 'file_storage.save_version_author' => true, in config.php