Skip to content

Conversation

@nmanoogian
Copy link
Contributor

@nmanoogian nmanoogian commented Apr 29, 2025

The DOPPLER_CONFIG_DIR was being appropriately used for reading/writing the configuration files but was not being used as the default for fallback and metadata files. This change hoists the default metadata and fallback directories to the configuration controller so it can be defined in the same spot as configuration.UserConfigFile.

@nmanoogian nmanoogian requested a review from a team as a code owner April 29, 2025 20:18
@nmanoogian nmanoogian force-pushed the nic/fix-config-dir branch 3 times, most recently from a3a297a to 520c9c9 Compare April 29, 2025 22:06
@nmanoogian nmanoogian requested a review from apazzolini April 29, 2025 22:19
var UserConfigFile string

// UserFallbackDir (e.g. /home/user/doppler/.doppler.yaml)
var UserFallbackDir string
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would these be better named as FallbackDir and MetadataDir since they're still used even if the user hasn't configured them? Or am I misunderstanding that part?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question -- SetConfigDir is called in the init function with the default $HOME/.doppler directory, which is invoked automatically when the module loads. SetConfigDir already updates UserConfigDir and UserConfigFile so I'm mostly just following the existing naming pattern

func init() {
SetConfigDir(filepath.Join(utils.HomeDir(), ".doppler"))
}
func SetConfigDir(dir string) {
UserConfigDir = dir
UserConfigFile = filepath.Join(UserConfigDir, configFileName)
}

@nmanoogian nmanoogian merged commit 12947ee into master May 29, 2025
29 of 30 checks passed
@nmanoogian nmanoogian deleted the nic/fix-config-dir branch May 29, 2025 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants