reg-viz / reg-suit

:recycle: Visual Regression Testing tool
https://reg-viz.github.io/reg-suit
MIT License
1.17k stars 101 forks source link

Support AWS profile for reg-publish-s3-plugin #634

Open csohei opened 7 months ago

csohei commented 7 months ago

Is your feature request related to a problem? Please describe.

Currently, I'm working on preparing for the VRT for some project and found that the plugin is not supposing the aws-profile for S3 upload. As the S3Config provides the feature to use profile as an IdentityProvider function, we cannot specify it through the config file and it's a bit troublesome when having several profile in local. I am wanting to let our developers to choose profile so that they do not have to specify it through the environment variable everytime they run.

Describe the solution you'd like

Support AWS profile in plugin config and use it for S3 client.

Describe alternatives you've considered

Currently, I'm implementing some script to register profile name and export it before running reg-suit. However, thinking that this is a bit redundant.

Additional context

Add any other context or screenshots about the feature request here.

Quramy commented 7 months ago

Does the following work for you ?

export AWS_PROFILE=PRFILE_FOR_S3_UPLOAD
npx reg-suit run
csohei commented 7 months ago

@Quramy hi, thanks for your reply!!

Unfortunately no, it's what I'm doing as workaround, as described in alternative.

csohei commented 7 months ago

As the profile name for AWS account is not always the same among developers, I've prepared installation shell scripts and stored the setting data as JSON.

And running the VRT as following command.

AWS_PROFILE=$(jq -r ".aws_profile" ./config/setting.json) reg-suit run

However, asking each developers to run installation every time is a bit redundant and this script only works for Linux/Mac users.

Also, I would like to avoid asking each developer to install jq(or any JSON parser) just for this script.

Is it possible to ask you for review if I make PR for this issue??

Quramy commented 7 months ago

Hi @csohei Thanks for the detailed explanation of the workaround.

I have not yet been able to imagine the code for the pull request you envision, but at least at this point I disagree with your proposed feature.

I am completely comfortable delegating to the aws-sdk how to identify AWS credentials. We do not want to complicate this process.