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

add Storage.upload(Path) #179

Closed
dmitry-fa opened this issue Mar 13, 2020 · 14 comments · Fixed by #214 or #269
Closed

add Storage.upload(Path) #179

dmitry-fa opened this issue Mar 13, 2020 · 14 comments · Fixed by #214 or #269
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: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@dmitry-fa
Copy link
Contributor

dmitry-fa commented Mar 13, 2020

In addition to Blob.uploadFrom() methods which require a Blob instance to be created first there should be a way to upload a resource to the storage without creating an instance of Blob:

interface Storage {
    void upload(BlobInfo blobInfo, Path path, BlobWriteOption... options);
    void upload(BlobInfo blobInfo, InputStream content, BlobWriteOption... options);
}

Implementing this feature means extending of public interface.

@dmitry-fa dmitry-fa added the semver: major Hint for users that this is an API breaking change. label Mar 13, 2020
@dmitry-fa dmitry-fa self-assigned this Mar 13, 2020
@product-auto-label product-auto-label bot added the api: storage Issues related to the googleapis/java-storage API. label Mar 13, 2020
@dmitry-fa dmitry-fa removed the semver: major Hint for users that this is an API breaking change. label Mar 13, 2020
@yoshi-automation yoshi-automation added the triage me I really want to be triaged. label Mar 14, 2020
@yoshi-automation yoshi-automation added the 🚨 This issue needs some love. label Mar 18, 2020
@frankyn frankyn added type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. priority: p2 Moderately-important priority. Fix may not be included in next release. and removed 🚨 This issue needs some love. triage me I really want to be triaged. labels Mar 18, 2020
@dmitry-fa
Copy link
Contributor Author

Extension the Storage interface is incompatible change. Such a minor feature as adding helper upload methods should not break compatibility. Instead of extending the main interface it's better to introduce a new class like StorageUtilities and put various helpers there.

@frankyn
Copy link
Member

frankyn commented Apr 1, 2020

How is Storage interface change incompatible change in this case? I still think we should add the method under Storage and not create a separate helper utility.

@frankyn frankyn reopened this Apr 1, 2020
@dmitry-fa
Copy link
Contributor Author

Interface extension is backward incompatible change.

@frankyn
Copy link
Member

frankyn commented Apr 1, 2020

We've been adding new methods to the interface for several features outside of this request. Could you clarify what you mean?

If we move forward with the feature added in #214 it will create a fracture in developer experience. We can try to do something else, but I'd prefer Storage.upload() over a separate helper class.

cc: @JesseLovelace @elharo @crwilcox

@dmitry-fa
Copy link
Contributor Author

dmitry-fa commented Apr 1, 2020

Extending interface breaks the API and requires a major version update since this API post 1.0.
Adding upload functionality is rather a small feature, it just adds a few helper methods. I don't think it deserves a major version update. The helper class will allow to add small feature like this without breaking the API.

@frankyn
Copy link
Member

frankyn commented Apr 2, 2020

I agree that this doesn't substantiate a major version bump.
I don't agree that we should do this as a separate utility class. It is a fracture in the experience.

What is the failure that you're hitting by updating the Storage API surface?

@elharo
Copy link
Contributor

elharo commented Apr 2, 2020

You can't add a method to an interface without breaking the API.

@frankyn
Copy link
Member

frankyn commented Apr 2, 2020

I misunderstood. damn, we have breaking the API without major version bumps for a couple of years then.

What other alternatives do we have to continue supporting requests in Storage.java? It really changes the way we execute work so I'm a bit confused.

@elharo
Copy link
Contributor

elharo commented Apr 2, 2020

There are at least 3 ways forward:

  1. Use concrete classes for new functionality.
  2. Add a new subinterface.
  3. Increment the major version.

There's a fourth once we drop Java 7 support. Maybe some others I haven't thought of.

@frankyn
Copy link
Member

frankyn commented Apr 2, 2020

Shared an internal document to help unblock the existing dev path for now. It will hold up other work as well that needs to be released this way.

@dmitry-fa
Copy link
Contributor Author

@frankyn

Shared an internal document

What the document did you share?

@frankyn
Copy link
Member

frankyn commented Apr 9, 2020

It's an internal document with Googlers right now. I'm sorting it out. I'll follow-up later today. Thanks for your patience @dmitry-fa

@frankyn
Copy link
Member

frankyn commented Apr 9, 2020

Hi @dmitry-fa, could you send me an email at coderfrank@google.com, I'm not able to find your email.

@dmitry-fa
Copy link
Contributor Author

To move further with this issue:

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: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
4 participants