Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds support for selecting the CLI configuration file via a KOYEB_CONFIG environment variable, with precedence between --config, KOYEB_CONFIG, and the default $HOME/.koyeb.yaml.
Changes:
- Add
KOYEB_CONFIGenv var fallback when resolving the config path inloginand during root command config initialization. - Update CLI help text and the generated reference docs to mention the new env var behavior.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| pkg/koyeb/login.go | Allows koyeb login to use KOYEB_CONFIG when --config is not provided. |
| pkg/koyeb/koyeb.go | Adds KOYEB_CONFIG handling in initConfig and updates --config flag help text. |
| docs/reference.md | Updates --config option text across the generated reference docs (and includes other regen deltas). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if cfgFile != "" { | ||
| // Use config file from the flag. | ||
| viper.SetConfigFile(cfgFile) | ||
| } else if envConfig := os.Getenv("KOYEB_CONFIG"); envConfig != "" { | ||
| log.Debugf("Using config file from KOYEB_CONFIG environment variable: %s", envConfig) | ||
| viper.SetConfigFile(envConfig) |
There was a problem hiding this comment.
The config file selection logic (flag -> KOYEB_CONFIG -> $HOME/.koyeb.yaml) is now duplicated here and also in pkg/koyeb/login.go. To avoid future drift (e.g., adding another precedence rule in one place but not the other), consider extracting this into a shared helper (e.g., resolveConfigPath/resolveConfigFile) and reusing it in both initConfig and Login.
| * [koyeb snapshots](#koyeb-snapshots) - Manage snapshots | ||
| * [koyeb version](#koyeb-version) - Get version | ||
| * [koyeb volumes](#koyeb-volumes) - Manage persistent volumes | ||
| * [koyeb whoami](#koyeb-whoami) - Show information about the currently authenticated user or organization |
There was a problem hiding this comment.
The command index now links to koyeb whoami, but this reference doc does not include a corresponding ## koyeb whoami section, so the link is broken. Either include the whoami markdown in the reference concatenation step (see Makefile gen-doc target) or remove the index entry until the section is generated.
| * [koyeb whoami](#koyeb-whoami) - Show information about the currently authenticated user or organization |
bchatelard
left a comment
There was a problem hiding this comment.
Hydra review
Reviewed head: bdb998042544b558bcd0d4235017d72096a01546
The code change for KOYEB_CONFIG looks sound, but the regenerated reference docs introduce a broken index link for koyeb whoami.
| * [koyeb snapshots](#koyeb-snapshots) - Manage snapshots | ||
| * [koyeb version](#koyeb-version) - Get version | ||
| * [koyeb volumes](#koyeb-volumes) - Manage persistent volumes | ||
| * [koyeb whoami](#koyeb-whoami) - Show information about the currently authenticated user or organization |
There was a problem hiding this comment.
[P2] Restore the missing whoami reference section
The regenerated command index now links to koyeb whoami, but this file still has no matching section, so the anchor is broken and readers cannot navigate to the command details from the index. Either include the generated whoami section or remove the index entry from this update.
No description provided.