-
-
Notifications
You must be signed in to change notification settings - Fork 101
Description
lab currently uses hcl as it's config format, and offers limited configuration. In large part minimal config options have been added to lab because hcl hasn't played super nicely with viper overall (particularly the automatic env vars functionality, which we want to leverage). For 1.0 I'd like to completely redo this, with a simpler file format that plays nice with automatic env vars. The main issue that arises has to do with ambiguity among file formats on if keys are implicitly treated as arrays or not, hcl has this issue, I think yaml may as well. So I suspect json is going to be a top candidate here. It's also possible that viper simply has better support for this in other formats (regardless of array considerations), so it's worth looking into yaml and ini (git config like option).
We aren't setup for this today, but in theory by using viper we should be able to read config from any number of formats. So we don't need to enforce what lab accepts, we should allow any viper formats to work (where reasonable / enabling ext suffices), but we should also settle on what the default is going to be go forward.
Lastly, out of the box this should provide improved (if not complete) support for #151 (multiple gitlab providers), this includes:
- Looking for config not just in the current directory, but in the repo root (hopefully tackled in pre 1.0 as well)
- Looking up credentials based on by host
- Support reading tokens from command output (such as
pass) Read token from other sources (like secret/password manager) #382
Related issues:
- config file usage? #402 -- Config Questions
- Read token from other sources (like secret/password manager) #382 -- load config from other sources
- Load Config From Env #155 -- first env var issues that arised