Skip to content
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

[stable19] Fix share transfer of single files and on the transfered node #22804

Merged
merged 8 commits into from
Sep 28, 2020

Conversation

juliushaertl
Copy link
Member

@juliushaertl juliushaertl commented Sep 11, 2020

Combined backport of #22116 #22648 including the new integration tests from #22761 and #22948

juliushaertl and others added 5 commits September 17, 2020 19:03
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
The integration tests did not verify that the files were actually
transferred between the users, only that the files were downloadable.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
The integration tests did not verify that the shares were actually
transferred between the users (or that they were removed due to being
transferred to the sharee).

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Currently only transferring ownership of a reshare with a group to a
user in the group is possible.

When transferring ownership of a reshare with another user or with a
group to a user not in the group restoring the share fails (but the
command succeeds, it only fails for the specific files that are
reshares).

When transferring ownership of a path that is a reshare the command
fails (as when a specific path is provided the path tries to move the
file, it does not take into account reshares).

The added integration tests reflect the above behaviours.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
@juliushaertl juliushaertl force-pushed the backport/stable19/22116-22648-22761 branch from d12d7c9 to 1375a42 Compare September 17, 2020 17:03
@juliushaertl juliushaertl added 3. to review Waiting for reviews bug and removed 2. developing Work in progress labels Sep 17, 2020
@faily-bot
Copy link

faily-bot bot commented Sep 17, 2020

🤖 beep boop beep 🤖

Here are the logs for the failed build:

Status of 33180: failure

jsunit

Show full log
PhantomJS 2.1.1 (Linux 0.0.0) LOG: 'JQMIGRATE: Migrate is installed, version 1.4.1'
PhantomJS 2.1.1 (Linux 0.0.0) DEBUG: 'OCA.Files.Settings initialized'
PhantomJS 2.1.1 (Linux 0.0.0) DEBUG: 'OCA.Files.Sidebar initialized'
PhantomJS 2.1.1 (Linux 0.0.0) DEBUG: 'OCA.Sharing.ShareSearch initialized'
PhantomJS 2.1.1 (Linux 0.0.0) DEBUG: 'OCA.Sharing.ExternalLinkActions initialized'
PhantomJS 2.1.1 (Linux 0.0.0): Executed 851 of 855 (skipped 4) SUCCESS (12.617 secs / 12.138 secs)

mariadb10.1-php7.2

Show full log
There were 2 warnings:

1) Test\Files\ViewTest::testRenameFailDeleteTargetKeepSource
Trying to configure method "writeStream" which cannot be configured because it does not exist, has not been specified, is final, or is static

2) Test\Files\ViewTest::testCopyFailDeleteTargetKeepSource
Trying to configure method "writeStream" which cannot be configured because it does not exist, has not been specified, is final, or is static

--

There was 1 failure:

1) Test\Share20\DefaultShareProviderTest::testGetSharedWithUserWithNode with data set #0 ('home::shareOwner', 'files/test.txt', 'files/test2.txt')
Failed asserting that actual size 0 matches expected size 1.

/drone/src/tests/lib/Share20/DefaultShareProviderTest.php:1166

mariadb10.4-php7.3

Show full log
There were 2 warnings:

1) Test\Files\ViewTest::testRenameFailDeleteTargetKeepSource
Trying to configure method "writeStream" which cannot be configured because it does not exist, has not been specified, is final, or is static

2) Test\Files\ViewTest::testCopyFailDeleteTargetKeepSource
Trying to configure method "writeStream" which cannot be configured because it does not exist, has not been specified, is final, or is static

--

There was 1 failure:

1) Test\Files\Config\UserMountCacheTest::testGetMountsForFileIdSubFolder
Failed asserting that actual size 0 matches expected size 1.

/drone/src/tests/lib/Files/Config/UserMountCacheTest.php:379

mysql8.0-php7.2

Show full log
There were 2 warnings:

1) Test\Files\ViewTest::testRenameFailDeleteTargetKeepSource
Trying to configure method "writeStream" which cannot be configured because it does not exist, has not been specified, is final, or is static

2) Test\Files\ViewTest::testCopyFailDeleteTargetKeepSource
Trying to configure method "writeStream" which cannot be configured because it does not exist, has not been specified, is final, or is static

--

There was 1 failure:

1) Test\Files\ObjectStore\ObjectStoreStorageTest::testMoveOverwrite with data set #5 ('/sòurcē.txt', '/target.txt')
Expected /target.txt to be a copy of /drone/src/tests/data/lorem.txt
Failed asserting that false matches expected 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\n
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\n
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.'.

/drone/src/tests/lib/Files/Storage/Storage.php:222
/drone/src/tests/lib/Files/Storage/Storage.php:277

Copy link
Member

@MorrisJobke MorrisJobke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good 👍

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
The files:transfer-ownership performs a sanitization of users with
"risky" display names (including characters like "\" or "/").

In order to allow (escaped) double quotes in the display name the
regular expression used in the "user XXX with displayname YYY exists"
step had to be adjusted.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Until recently (it was fixed in ac2999a) when a path was transferred
other shares with the target user were removed, so a test was added to
ensure that it does not happen again.

Besides that a test to ensure that other files with the target user are
not transferred was added too (it did not fail before, but seemed
convenient to have that covered too :-) ).

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
@rullzer rullzer merged commit 164096a into stable19 Sep 28, 2020
@rullzer rullzer deleted the backport/stable19/22116-22648-22761 branch September 28, 2020 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants