facebook / grocery-delivery

The Grocery Delivery utility for managing cookbook uploads to distributed Chef backends.
Apache License 2.0
154 stars 55 forks source link

Add all config options as CLI args (+new opt for repo_update) #64

Closed ChefAustin closed 2 years ago

ChefAustin commented 2 years ago

This pull request will make the following changes:

Context: This change is targeted at those that want to run Grocery Delivery within a container, in CI, or -- more generally -- in any environment whereby updating the cookbook repo is unnecessary. In some deployment workflows the build system already clones the repository's primary branch directly to the build host and then executes the build steps to deploy the cookbooks via a Grocery Delivery container. In such a deployment workflow, one could then configure their build/deployment process to copy the entire repo into the container (whereby Grocery Delivery would be invoked). When using this style of deployment workflow, there is no need to update the local clone of the cookbook repository to ensure it is up-to-date (furthermore, the host's container might not be configured to have access to the VCS).

ChefAustin commented 2 years ago

On second thought, I am beginning to wonder if there might be even more value to be had by adding (in another PR) the capacity for all gd-config.rb options to be passed in as CLI arguments.

Just wanted to get some thoughts from maintainers to see if this is something you would consider merging in.

ChefAustin commented 2 years ago

@jaymzh :

Thanks!

Code looks fine. Feature seems reasonable, but please add some info to the README.md about the motivation here.

Done.

And yeah, the fact that there's config-file options that don't have command-line options is just an oversight, feel free.

Added CLI args for all available config file options.

Updated PR description to better describe changeset. Feel free to let me know if you hate my choice of shorthand-format CLI args (or I've mucked something up/overlooked anything amidst all my changes).

Thanks!

jaymzh commented 2 years ago

You can run rubocop with -a to auto-fix all that ruby styling

ChefAustin commented 2 years ago

@jaymzh Friendly bump on this one.

ChefAustin commented 2 years ago

@jaymzh Thanks for merging.

Quick question: Does GD have a defined release cadence (i.e. can I expect a new release to be cut at any specific point in time)?

jaymzh commented 2 years ago

It does not. FB builds from main internally. Usually once they've deployed it they'll get around to releasing it, but I still have access to make a release if that's important to you, I can follow up with the folks still there and check that's OK. But it's a crazy week for a bunch of other reasons, so maybe ping in a week or so if you want that.

ChefAustin commented 2 years ago

Not important for me at the moment. I figured I will just add that detail into the contributing doc when I raise a future PR.