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

With objectstore, scan from sourcescanner for shared files #32377

Merged
merged 1 commit into from
Aug 21, 2018

Conversation

mrow4a
Copy link
Contributor

@mrow4a mrow4a commented Aug 19, 2018

In #32337 (scan function has been added, but is not needed). Similarly scanFile gets correction (typo).

@DeepDiver1975

if ($sourceScanner instanceof NoopScanner) {
// No Operation Scanner will not update share permission (scanFile won't call getData)
list(, $internalPath) = $this->storage->resolvePath($file);
return $sourceScanner->scanFile($internalPath, $reuseExisting, $parentId, $cacheData, $lock);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Due to the fact that we use "source scanner" directly, and not use inheritance, function getData is not being called for objectstorage (NoopScanner).

I tried to implement the wrapper, but it is nearly impossible due to how Storage interfaces are implemented (https://github.com/owncloud/core/blob/master/lib/private/Files/Storage/Storage.php#L51) - storage has function getScanner, which in turn can accept another storage as argument.

@PVince81 @DeepDiver1975 @butonic

@codecov
Copy link

codecov bot commented Aug 19, 2018

Codecov Report

Merging #32377 into master will decrease coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #32377      +/-   ##
============================================
- Coverage     64.03%   64.03%   -0.01%     
+ Complexity    18579    18577       -2     
============================================
  Files          1171     1171              
  Lines         69876    69870       -6     
  Branches       1267     1267              
============================================
- Hits          44747    44743       -4     
+ Misses        24759    24757       -2     
  Partials        370      370
Flag Coverage Δ Complexity Δ
#javascript 52.84% <ø> (ø) 0 <ø> (ø) ⬇️
#phpunit 65.31% <100%> (-0.01%) 18577 <4> (-2)
Impacted Files Coverage Δ Complexity Δ
apps/files_sharing/lib/Scanner.php 95.23% <100%> (+6.34%) 7 <4> (-2) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 06d726f...a052500. Read the comment docs.

*
* @inheritdoc
*/
public function scan($path, $recursive = self::SCAN_RECURSIVE, $reuse = -1, $lock = true) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removing "scan" as might be better if parent method will be executed (It does some locking before running scanFile). CC @DeepDiver1975

@mrow4a
Copy link
Contributor Author

mrow4a commented Aug 21, 2018

@DeepDiver1975 I just tested it on smashbox and all good. In reviewing, please use split diff

@DeepDiver1975 DeepDiver1975 merged commit 2cef533 into master Aug 21, 2018
@DeepDiver1975 DeepDiver1975 deleted the share_scanner_obj branch August 21, 2018 07:07
@phil-davis
Copy link
Contributor

@DeepDiver1975 the referenced PR #32337 was backported.
So is this also relevant for backport?

@DeepDiver1975
Copy link
Member

yes - baskport is required - but I tend to postpone this once we have smashbox green

@mrow4a please keep a list of necessary backports - bet in a ticker in here in core to track this all - THX

@mrow4a
Copy link
Contributor Author

mrow4a commented Aug 21, 2018

@DeepDiver1975 exactly, I will backport all scanner related stuff together if needed. Or objectstore related in general

@phil-davis
Copy link
Contributor

@mrow4a ping - is this still waiting for a "major backport of scanner related stuff"?

@mrow4a
Copy link
Contributor Author

mrow4a commented Dec 20, 2018

@phil-davis we dont have smashbox green yet. There is some missing files_primary_s3 functionality. CC @DeepDiver1975

@phil-davis
Copy link
Contributor

I noticed this while backporting "Introduce PHPstan" in PR #35774
In the current stable10 phpstan told me about a wrong call to scan
c2902e6#r300867878

Backporting this PR would/should bypass having to massage this in stable10 - the backport will "fix it".

@DeepDiver1975 @mrow4a

@phil-davis phil-davis mentioned this pull request Jul 8, 2019
10 tasks
@mrow4a
Copy link
Contributor Author

mrow4a commented Jul 8, 2019

@phil-davis this is just a performance optimization to avoid unnecessary calls to "locks" with objectstorage. Other storages are not affected

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants