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

Update NIO to understand new directory stand-ins #5204

Conversation

jean-philippe-martin
Copy link

The web interface has a "create folder" button, and that creates
a file ending in '/' that is used to pretend the folder exists.
The web interface maintains the illusion but of course this is still only a file,
so all clients (this one included) has to play along and pretend the directory
exists (or users get confused).

Those fake folders used to be 0-byte, but no longer. This pull request
updates our code so it just looks at the trailing slash, ignoring the size
of the file.

It also adds a test, and in order to write the test we had to add the ability
to create files whose name ends in '/', for test purpose only.

Fixes #5203

The web interface has a "create folder" button, and that creates
a file ending in '/' that is used to pretend the folder exists.
The web interface maintains the illusion but of course this is still only a file,
so all clients (this one included) has to play along and pretend the directory
exists (or users get confused).

Those fake folders used to be 0-byte, but no longer. This pull request
updates our code so it just looks at the trailing slash, ignoring the size
of the file.

It also adds a test, and in order to write the test we had to add the ability
to create files whose name ends in '/', for test purpose only.
@jean-philippe-martin jean-philippe-martin requested a review from a team as a code owner May 20, 2019 22:50
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label May 20, 2019
@pmakani pmakani added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label May 21, 2019
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label May 21, 2019
@codecov
Copy link

codecov bot commented May 21, 2019

Codecov Report

Merging #5204 into master will increase coverage by <.01%.
The diff coverage is 75%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #5204      +/-   ##
============================================
+ Coverage     50.42%   50.42%   +<.01%     
- Complexity    23796    23816      +20     
============================================
  Files          2251     2252       +1     
  Lines        226836   226841       +5     
  Branches      24966    24961       -5     
============================================
+ Hits         114371   114380       +9     
+ Misses       103858   103855       -3     
+ Partials       8607     8606       -1
Impacted Files Coverage Δ Complexity Δ
.../storage/contrib/nio/OptionAllowTrailingSlash.java 100% <100%> (ø) 2 <2> (?)
...cloud/storage/contrib/nio/CloudStorageOptions.java 80% <100%> (+2.22%) 8 <1> (+1) ⬆️
...ge/contrib/nio/CloudStorageFileSystemProvider.java 62.76% <62.5%> (+1.02%) 73 <7> (+2) ⬆️
...le/cloud/compute/v1/ProjectGlobalSnapshotName.java 56.36% <0%> (ø) 8% <0%> (ø) ⬇️
...cloud/compute/v1/ProjectZoneInstanceGroupName.java 57.14% <0%> (ø) 8% <0%> (ø) ⬇️
...1/ProjectZoneNetworkEndpointGroupResourceName.java 57.14% <0%> (ø) 8% <0%> (ø) ⬇️
...ompute/v1/ProjectRegionSubnetworkResourceName.java 57.14% <0%> (ø) 8% <0%> (ø) ⬇️
...ud/compute/v1/ProjectGlobalSecurityPolicyName.java 56.36% <0%> (ø) 8% <0%> (ø) ⬇️
...ud/compute/v1/ProjectGlobalTargetTcpProxyName.java 56.36% <0%> (ø) 8% <0%> (ø) ⬇️
...oud/compute/v1/ProjectGlobalBackendBucketName.java 56.36% <0%> (ø) 8% <0%> (ø) ⬇️
... and 72 more

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 575eca4...5615f46. Read the comment docs.

@pmakani pmakani added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label May 22, 2019
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label May 22, 2019
@sduskis
Copy link
Contributor

sduskis commented May 22, 2019

Please run mvn com.coveo:fmt-maven-plugin:format to fix the code formatting issues.

@sduskis sduskis requested a review from a team May 22, 2019 18:26
@jean-philippe-martin
Copy link
Author

@sduskis done.

@chingor13 chingor13 self-assigned this May 22, 2019
@chingor13 chingor13 added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label May 23, 2019
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label May 23, 2019
@jean-philippe-martin
Copy link
Author

I hope everyone had a good weekend! @chingor13 the code should be ready, let me know in case there's still a ball in my camp!

@chingor13 chingor13 merged commit 722508f into googleapis:master May 28, 2019
@jean-philippe-martin
Copy link
Author

Thank you very much!

@jean-philippe-martin jean-philippe-martin deleted the jp_update_to_latest_fake_folder_convention branch May 28, 2019 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New Google Cloud Storage folders not recognized by NIO
6 participants