I think within Zillow Group, we have enough experience to start porting some stuff back to the main project.
One such idea is that of configuring the way the targets behave. The benefit's I've observed with zillow-surgen having this is:
- prefixing commits with bug numbers
- customizing the git author
- more general configuration like stash targets.
I think it's certainly possible to create some sort of generic config loader / manager, and have surgen's core targets use that, with extensibility for internal usage. Something like:
git:
commit_prefix: foo
author: yusuket@tsutsumi.io
# example of stash extension
stash:
username: foo
password: bar
The ways I can think of wiring through that config is:
- pass the generic config top level object to all targets
- have a dependency injection framework effectively, where the global config is loaded and configured during startup, then can be imported as a singleton anywhere.
If we do this, we could probably have a fairly useful surgen cli where invocations are in the form of:
surgen --config=<config_file> --driver=stash
for doing all repos remotely, and
surgen --config=<config_file> <directory>
for doing a single one.
The other entirely different option I see is to make surgen more of a first-class library rather than a CLI. Then, people would configure and wire whatever they want to, they just have a nice utility library to quickly construct surgen-based CLIs with their preference.
Thoughts on either approach?
I think within Zillow Group, we have enough experience to start porting some stuff back to the main project.
One such idea is that of configuring the way the targets behave. The benefit's I've observed with zillow-surgen having this is:
I think it's certainly possible to create some sort of generic config loader / manager, and have surgen's core targets use that, with extensibility for internal usage. Something like:
The ways I can think of wiring through that config is:
If we do this, we could probably have a fairly useful surgen cli where invocations are in the form of:
surgen --config=<config_file> --driver=stashfor doing all repos remotely, and
surgen --config=<config_file> <directory>for doing a single one.
The other entirely different option I see is to make surgen more of a first-class library rather than a CLI. Then, people would configure and wire whatever they want to, they just have a nice utility library to quickly construct surgen-based CLIs with their preference.
Thoughts on either approach?