Repository navigation
Operations on Buckets should use Storage.*Option types #702
Copy link
Copy link
Closed
Labels
api: storageIssues related to the Cloud Storage API.Issues related to the Cloud Storage API.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Description
Activity
Nice catch!
We should provide dedicatedBlobTargetOptionandBlobWriteOptioninBucket. I am assigning this to myself and I'll work on it ASAP.Reacted by Ivan A Sanchez V- addedtype: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.api: storageIssues related to the Cloud Storage API.Issues related to the Cloud Storage API.
on Mar 2, 2016 #705 adds
BlobTargetOptionandBlobWriteOptiontoBucketand fixes the bug reported by this issue.Storage.BlobListOptionis still used inBucketas it makes little sense to me to copy-paste the class given that it applies as-is.You could have
Storage.BlobListOptionandBucket.BlobListOptionextend a shared parent. That saves too much typing but makes it much clearer to callers that they're doing the right thing. When I was getting set up theStorage/Bucketoverlap was one of the more confusing parts of the API.- added 6 commits that reference this issue
on Jun 21, 2022 15 remaining items
- added a commit that references this issue
on Feb 1, 2023 - added a commit that references this issue
on Dec 22, 2025 - added a commit that references this issue
on Jan 6, 2026 - added a commit that references this issue
on Jan 22, 2026 - added 2 commits that reference this issue
on Feb 24, 2026 - added a commit that references this issue
on Mar 11, 2026 - added 2 commits that reference this issue
on Mar 12, 2026 - added a commit that references this issue
on Mar 23, 2026 - added a commit that references this issue
on Mar 30, 2026 - added 2 commits that reference this issue
on Apr 29, 2026 - added a commit that references this issue
on Jul 13, 2026
Metadata
Metadata
Assignees
Labels
api: storageIssues related to the Cloud Storage API.Issues related to the Cloud Storage API.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Some of the static classes in
Storage, such asBlobTargetOptionwhich is used byStorage.create(), are also being erroneously used inBucket. This is problematic becauseBucketkeys of of pathStrings, notBlobInfoinstances, and therefore isn't able to extract information like the blob's generation, causing a line like this:to fail:
And there is no way in
Storage.BlobTargetOptionto actually specify a generation.I don't think
Bucketshould have any dependency on theStorage.*Optiontypes. There's clearly a good amount of overlap, but I don't think that's a good enough reason for them to share these types. Even where they behave the same it's confusing for the caller.They could extend from a shared parent if we wanted, but that should be an implementation detail.
I can put together a patch to remove the dependencies on
Storage.*OptionfromBucketif that's desired.