GoogleCloudPlatform / GoogleCloudPlatform/gsutil

gsutil ls gs://bucket-directory lists itself

Open
#1,160 1 comment 3 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
918
Forks
335
PR merge metrics
No merged PRs in 30d

Description

When a folder is created through "Create Folder" in the UI, gsutil ls gs://bucket/folder lists itself.

Steps to reproduce:
1. Create a bucket
2. Create a folder through "CREATE FOLDER" in the UI
3. Upload a file to the newly created folder
3. Run gsutil ls gs://[bucket]/[folder]

Expected Output:
```
gs://bucket/folder/file
```

Actual Output:
```
gs://bucket/folder
gs://bucket/folder/file
```

I understand that this is because "folders" don't actually exist in GCS and creating a folder through the UI is really just creating an "object" which is why the folder is listed. However this can cause confusion as gsutil is supposed to provide the illusion of a filesystem and `gsutil ls` should be matched as closely as it can with `ls` for typical Unix/Unix-like OS. Can the 'folder' be abstracted during these ls commands?

Screenshot:

![testing-ls](https://user-images.githubusercontent.com/56038328/101411815-354f1080-38a7-11eb-955b-3f10ee7d38a6.png)

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the reported `gsutil ls gs://bucket/folder` behavior with a UI-created folder marker and an uploaded file. Trace the `gsutil ls` entry point and its handling of folder objects; done means the marker is omitted while the file remains listed, with coverage for the reported command.

Written by the indexing model from the issue text.

Assessment

Tech stack
google-cloud, python
Domain
cli, cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.