humanmade / hm-platform

HM Hosting platform required plugins
https://engineering.hmn.md/platform/plugins/
23 stars 4 forks source link

Consider managing AWS SDK (and potentially others) via composer #101

Open roborourke opened 5 years ago

roborourke commented 5 years ago

Now that hm-platform can be installed via composer (props to @paulgibbs) I think we should switch to using composer to install other 3rd party code, notably the AWS SDK.

Given that all the SDK files are committed anyway I don't see a difference in just committing the vendor folder.

This will also make it easier for us to package and manage other libraries that we can provide credentials for on provision such as Google Cloud features like analytics, translate and vision.

First thing to establish is what are the tweaks / mods made to the AWS SDK / Guzzle that led to the current approach? cc @joehoyle

joehoyle commented 5 years ago

Generally 👍, however we need to do this in a back compat way. Right now many projects submodule hm-platform, and don't run composer as a built step, so I think this would either need both, or a new branch, or something. We don't break compat in hm-platform so this needs some thinking about for sure!

As for why we bundle vendor currently, that was more about distribution, we don't have any hacks to AWS SDK / Guzzle (any more!)

roborourke commented 5 years ago

@joehoyle sweet! So for back compat we'll need to provide a built release with everything in that can be submoduled, and for composer installs a non built release.

I have some code I can modify to do this via Circle CI on a few repos eg. Workflows. What do we think of the following:

On merge to master:

The above is easy to do. Can you think of any issues with this approach?

joehoyle commented 5 years ago

I think we might need to keep master as the "built" version, as we have some build-script automatically pulling that in. Perhaps develop or something. This is also probably better as we'd only update master once we do a release of a new version (I think) as frankly some things pull master which isn't always super tested!

roborourke commented 5 years ago

I'll experiment on a fork then I think :)

rmccue commented 5 years ago

Rather than a new branch, we can use Composer's archive.exclude to just avoid bundling vendor when the package is built.

joehoyle commented 5 years ago

Ah nice

joehoyle commented 5 years ago

Put together https://github.com/humanmade/hm-platform/pull/104 as a first bash.