cli / go-gh

A Go module for interacting with gh and the GitHub API from the command line.
https://pkg.go.dev/github.com/cli/go-gh/v2
MIT License
322 stars 45 forks source link

Remove default configuration and add fallback configuration #142

Closed samcoe closed 8 months ago

samcoe commented 8 months ago

This PR removes the knowledge of a default configuration from go-gh and replaces it with the ability to supply a fallback configuration to the config.Read function. This removes application level knowledge from go-gh and allows us to push it back into gh. One decision I made was that the fallback configuration would not be used unless both config.yml and hosts.yml were not found, previously the default configuration would be used whenever config.yml was not found. This change feels appropriate as we are now treating config.yml and hosts.yml as one single configuration and hides the details that they are actually two separate files from the caller.

⚠️ Note that this is a breaking change to the interface for config.Read which is exported, but in located in the config package which is only meant for use inside gh and has a warning about non-backwards compatible changes.