Skip to content

allow storages to explicitly opt-out of uploading .part files - #37755

Merged
karakayasemi merged 2 commits into
masterfrom
curiousercreative-patch
Jul 31, 2020
Merged

karakayasemi merged 2 commits into
masterfrom
curiousercreative-patch

Conversation

@karakayasemi

@karakayasemi karakayasemi commented Jul 30, 2020 •

Copy link
Copy Markdown
Contributor

Continuation of #37062

  • Commits have been rebased and squashed
  • Some unit tests have been added (Hard to write meaningful tests, I just asserted the boolean value according to related Storage class.)

Description

Allow for storage classes to decide whether to use .part files. Default to using part files to preserve previous behavior.

Related Issue

Motivation and Context

Google Drive external storage (and others?) should not create a duplicate file with the same name every time a file is changed.

How Has This Been Tested?

  • no serious testing, just UAT that ownCloud is no longer generating duplicate Google Drive files

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Database schema changes (next release will require increase of minor version instead of patch)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests only (no source changes)

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:
  • Changelog item, see TEMPLATE

@karakayasemi karakayasemi self-assigned this Jul 30, 2020
@karakayasemi karakayasemi changed the title Curiousercreative patch allow storages to explicitly opt-out of uploading .part files Jul 30, 2020
@codecov

codecov Bot commented Jul 30, 2020

Copy link
Copy Markdown

Codecov Report

Merging #37755 into master will decrease coverage by 0.00%.
The diff coverage is 53.84%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #37755      +/-   ##
============================================
- Coverage     64.71%   64.71%   -0.01%     
- Complexity    19387    19388       +1     
============================================
  Files          1283     1283              
  Lines         75737    75746       +9     
  Branches       1333     1333              
============================================
+ Hits          49013    49016       +3     
- Misses        26332    26338       +6     
  Partials        392      392              
Flag Coverage Δ Complexity Δ
#javascript 54.03% <ø> (ø) 0.00 <ø> (ø)
#phpunit 65.88% <53.84%> (-0.01%) 19388.00 <4.00> (+1.00) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ Complexity Δ
apps/files_external/lib/Lib/Storage/Google.php 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
apps/files_external/lib/Lib/Storage/OwnCloud.php 85.18% <0.00%> (-6.82%) 0.00 <0.00> (ø)
apps/files_sharing/lib/External/Storage.php 28.14% <0.00%> (-0.43%) 50.00 <1.00> (+1.00) ⬇️
apps/dav/lib/Connector/Sabre/File.php 83.81% <100.00%> (-0.16%) 114.00 <0.00> (-3.00)
...b/private/Files/ObjectStore/ObjectStoreStorage.php 76.10% <100.00%> (+0.16%) 106.00 <1.00> (+1.00)
lib/private/Files/Storage/Common.php 84.80% <100.00%> (+0.09%) 139.00 <1.00> (+1.00)
lib/private/Files/Storage/Wrapper/Wrapper.php 94.55% <100.00%> (+0.07%) 73.00 <1.00> (+1.00)

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 b4e4e2e...844cb80. Read the comment docs.

@codecov

codecov Bot commented Jul 30, 2020 •

Copy link
Copy Markdown

Codecov Report

Merging #37755 into master will increase coverage by 0.00%.
The diff coverage is 86.36%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master   #37755   +/-   ##
=========================================
  Coverage     64.71%   64.71%           
- Complexity    19387    19388    +1     
=========================================
  Files          1283     1283           
  Lines         75737    75746    +9     
  Branches       1333     1333           
=========================================
+ Hits          49013    49020    +7     
- Misses        26332    26334    +2     
  Partials        392      392           
Flag Coverage Δ Complexity Δ
#javascript 54.03% <ø> (ø) 0.00 <ø> (ø)
#phpunit 65.89% <86.36%> (+<0.01%) 19388.00 <5.00> (+1.00)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ Complexity Δ
apps/files_external/lib/Lib/Storage/Google.php 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
apps/dav/lib/Connector/Sabre/File.php 83.81% <90.00%> (-0.16%) 114.00 <1.00> (-3.00)
apps/files_external/lib/Lib/Storage/OwnCloud.php 92.59% <100.00%> (+0.59%) 0.00 <0.00> (ø)
apps/files_sharing/lib/External/Storage.php 29.62% <100.00%> (+1.05%) 50.00 <1.00> (+1.00)
...b/private/Files/ObjectStore/ObjectStoreStorage.php 76.10% <100.00%> (+0.16%) 106.00 <1.00> (+1.00)
lib/private/Files/Storage/Common.php 84.80% <100.00%> (+0.09%) 139.00 <1.00> (+1.00)
lib/private/Files/Storage/Wrapper/Wrapper.php 94.55% <100.00%> (+0.07%) 73.00 <1.00> (+1.00)

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 b4e4e2e...fa8c45f. Read the comment docs.

@karakayasemi
karakayasemi force-pushed the curiousercreative-patch branch from 844cb80 to 5a62887 Compare July 30, 2020 21:20
@mmattel

mmattel commented Jul 31, 2020

Copy link
Copy Markdown
Contributor

Only a minor question, wouldnt it be better to name it usePartFile just to make it more clear what it is about?

@karakayasemi
karakayasemi force-pushed the curiousercreative-patch branch 5 times, most recently from dd29611 to 866de18 Compare July 31, 2020 12:06
@karakayasemi
karakayasemi requested review from micbar and mmattel July 31, 2020 12:12
Comment thread lib/public/Files/Storage/IStorage.php Resolved

@VicDeo VicDeo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good

@karakayasemi
karakayasemi force-pushed the curiousercreative-patch branch from 866de18 to fa8c45f Compare July 31, 2020 14:41
@karakayasemi
karakayasemi merged commit d57fb68 into master Jul 31, 2020
@delete-merged-branch
delete-merged-branch Bot deleted the curiousercreative-patch branch July 31, 2020 15:52
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.

Make it possible for storage implementations to disable part files

4 participants