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

Handle generation numbers in BlobId#{to,from}GsUtilUri #1928

Closed
davidmandle opened this issue Mar 7, 2023 · 5 comments · Fixed by #1929
Closed

Handle generation numbers in BlobId#{to,from}GsUtilUri #1928

davidmandle opened this issue Mar 7, 2023 · 5 comments · Fixed by #1929
Assignees
Labels
api: storage Issues related to the googleapis/java-storage API. priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@davidmandle
Copy link
Contributor

Unlike gsutil, BlobId#toGsUtilUri currently ignores a BlobId's generation number, and BlobId#fromGsUtilUri doesn't parse generation numbers. It would be nice if, consistent with gsutil, fromGsUtilUri parsed any generation number in the URI so that references to particular versions of blobs could be made in URI format.

@product-auto-label product-auto-label bot added the api: storage Issues related to the googleapis/java-storage API. label Mar 7, 2023
@andrewsg andrewsg added type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. priority: p2 Moderately-important priority. Fix may not be included in next release. labels Mar 9, 2023
@jjathman
Copy link

I think this should have been noted as a potentially breaking change and likely created a new API for this usage. In our applications we had application A which is generating the GS URI using version 2.22.0 which now includes the generation in the URL. However, other applications are still using 2.11.x which incorrectly reads the new String.

@BenWhitehead
Copy link
Collaborator

Apologies for that @jjathman, I'll try and get a fix posted for the next release.

@BenWhitehead BenWhitehead reopened this Apr 26, 2023
BenWhitehead added a commit that referenced this issue Apr 26, 2023
When BlobId#toGsUtilUri was updated to output generation if defined, this broken older clients ability to parse the value via BlobId#fromGsUtilUri. This adds the new method toGsUtilUriWithGeneration to explicitly opt in to generation being okay in the output.

Related to #1928
Related to #1929
BenWhitehead added a commit that referenced this issue Apr 26, 2023
When BlobId#toGsUtilUri was updated to output generation if defined, this broken older clients ability to parse the value via BlobId#fromGsUtilUri. This adds the new method toGsUtilUriWithGeneration to explicitly opt in to generation being okay in the output.

Related to #1928
Related to #1929
sydney-munro pushed a commit that referenced this issue Apr 26, 2023
When BlobId#toGsUtilUri was updated to output generation if defined, this broken older clients ability to parse the value via BlobId#fromGsUtilUri. This adds the new method toGsUtilUriWithGeneration to explicitly opt in to generation being okay in the output.

Related to #1928
Related to #1929
@BenWhitehead
Copy link
Collaborator

v2.22.1 has been cut which restores the previous behavior to toGsutilUri and adds a new method toGsutilUriWithGeneration if the generation can be included.

@davidmandle you'll want to switch to using the new method

@jjathman this fix version should now make uris compatible with the v2.11.x series

@jjathman
Copy link

@BenWhitehead really appreciate it!

@davidmandle
Copy link
Contributor Author

Apologies for the breakage. Thank you for resolving it!

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the googleapis/java-storage API. priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants