Skip to content

config management for targets / surgen #3

@toumorokoshi

Description

@toumorokoshi

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:

  1. prefixing commits with bug numbers
  2. customizing the git author
  3. 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:

  1. pass the generic config top level object to all targets
  2. 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?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions