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

*Suggestion* Remove AWS from core library #10

Open
tyler-eon opened this issue Sep 2, 2019 · 11 comments
Open

*Suggestion* Remove AWS from core library #10

tyler-eon opened this issue Sep 2, 2019 · 11 comments

Comments

@tyler-eon
Copy link

Suggestion

Extract the AWS integration from the core Waffle library to a separate project.

Reasoning

Two reasons:

  1. Subjectively, I think that a general-purpose library for uploading and transforming files should not include any code that is dependent on a library that might never be used. I know some other popular libraries do this sort of thing, but generally they integrate multiple options and check, at compile-time or run-time, what external libraries are available and select the appropriate one. Waffle (formerly Arc?) does not exhibit that kind of behavior. I imagine the AWS integration was the use case that spurred the creation of the library, but as it grows in use I think it's best to separate out the AWS integration like it is with the other integrations (e.g. GCS, Rackspace).
  2. Objectively, Waffle clutters my logs. Because ExAws is an optional dependency but there is code that references it in Waffle, the compiler process spits out warnings about ExAws not being a valid reference to anything. I'd rather compile warnings stick to things like "this is a deprecated function" or "this feature is only available in X version of elixir".

Additionally, because there's now an umbrella account (elixir-waffle) I think it makes even more sense to split this out as something like waffle_aws (similar to how there's waffle_ecto).

@tyler-eon
Copy link
Author

I'm not able to set labels which is why I put "*Suggestion*" in the title. If there's a way to label this as a suggestion and remove that from the title itself, I'm down for that.

@achempion
Copy link
Member

Thank you for suggestion!

I completely agree with you. I think we should have a S3 integration as a separate project. I'll look into it as I'll be more comfortable with the codebase of the project.

For now I want to focus to review and merge all current pull requests.

p.s. I'm fine with the current title :)

@lstrzebinczyk
Copy link

@achempion so what about this? It continues to clutter the logs : V

@ykurtbas
Copy link

I think these are all related to what you have created the issue for?

I am only ever going to use local and configured to work with local.

==> waffle
Compiling 14 files (.ex)
warning: ExAws.request/1 is undefined (module ExAws is not available or is yet to be defined)
Found at 3 locations:
  lib/waffle/storage/s3.ex:161: Waffle.Storage.S3.delete/3
  lib/waffle/storage/s3.ex:176: Waffle.Storage.S3.do_put/2
  lib/waffle/storage/s3.ex:188: Waffle.Storage.S3.do_put/2

warning: ExAws.Config.new/2 is undefined (module ExAws.Config is not available or is yet to be defined)
  lib/waffle/storage/s3.ex:216: Waffle.Storage.S3.build_signed_url/4

warning: ExAws.Request.Url.sanitize/2 is undefined (module ExAws.Request.Url is not available or is yet to be defined)
  lib/waffle/storage/s3.ex:204: Waffle.Storage.S3.build_url/4

warning: ExAws.S3.delete_object/2 is undefined (module ExAws.S3 is not available or is yet to be defined)
  lib/waffle/storage/s3.ex:160: Waffle.Storage.S3.delete/3

warning: ExAws.S3.presigned_url/5 is undefined (module ExAws.S3 is not available or is yet to be defined)
  lib/waffle/storage/s3.ex:219: Waffle.Storage.S3.build_signed_url/4

warning: ExAws.S3.put_object/4 is undefined (module ExAws.S3 is not available or is yet to be defined)
  lib/waffle/storage/s3.ex:175: Waffle.Storage.S3.do_put/2

warning: ExAws.S3.upload/4 is undefined (module ExAws.S3 is not available or is yet to be defined)
  lib/waffle/storage/s3.ex:187: Waffle.Storage.S3.do_put/2

warning: ExAws.S3.Upload.stream_file/1 is undefined (module ExAws.S3.Upload is not available or is yet to be defined)
  lib/waffle/storage/s3.ex:186: Waffle.Storage.S3.do_put/2

@achempion
Copy link
Member

The solution seems to extract AWS integration into a separate library or disable warnings somehow (which is not good).

@harrygr
Copy link

harrygr commented Aug 21, 2021

@achempion Has there been any progress made for this? As a non-user of AWS my logs also get cluttered quite a bit with warnings from the undefined modules.

Is there anything we can do to speed things along?

Am I right in thinking it's just the Waffle.Storage.S3 module that should be extracted? So I guess we just need a new repo to house it. Once it's published to hex as a new package we can remove it from this repo.

@tyler-eon
Copy link
Author

If we could at least get a repo under the umbrella project opened up with maybe a placeholder README or something, that would allow the community to work on the extraction, moving all the AWS-specific bits to the new project, and open a PR or something for the "initial commit". That's the best solution I can think of to speed this along if the elixir-waffle owners/maintainers don't have the time to do this.

@achempion
Copy link
Member

I've created a repo to move S3 integration into.

PR is welcome

@tyler-eon
Copy link
Author

See this PR and this waffle_s3 PR.

I can't guarantee either one works 100%, this is just for the sake of getting the ball rolling. If we want, we could create a branch of waffle and merge my work in there and give other community developers a chance to work off that, but really a majority of the work we need to happen is in the waffle_s3 repo.

@markholmes
Copy link

Wanted to bump this. It looks like elixir-waffle/waffle_s3#1 was merged a while back. Is there any plan for a major release to separate these?

@achempion
Copy link
Member

achempion commented Oct 21, 2021

Hey, I do plan to separate it but thinking about slightly modifying current DSL as well to make file management more flexible for different configuration needs/demands

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants