feat: make config file a stable feature#897
Conversation
📝 WalkthroughWalkthroughThis PR promotes experimental file configuration to stable status by moving ChangesExperimental file configuration promotion and config expansion
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
internal/utils/loaders/loader_file.go (1)
21-29:⚠️ Potential issue | 🟠 Major | ⚡ Quick winKeep legacy env-var fallback to avoid silent config-file disablement.
Line 22 drops
TINYAUTH_EXPERIMENTAL_CONFIGFILE; setups still using it now hit thereturn false, nilpath and won’t load the file config.Proposed compatibility patch
// I guess we are using traefik as the root name (we can't change it) configFileFlag := "traefik.configfile" envVar := "TINYAUTH_CONFIGFILE" + legacyEnvVar := "TINYAUTH_EXPERIMENTAL_CONFIGFILE" if _, ok := flags[configFileFlag]; !ok { - if value := os.Getenv(envVar); value != "" { + value := os.Getenv(envVar) + if value == "" { + value = os.Getenv(legacyEnvVar) + } + if value != "" { flags[configFileFlag] = value } else { return false, nil } }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@internal/utils/loaders/loader_file.go` around lines 21 - 29, The code in loader_file.go currently only checks TINYAUTH_CONFIGFILE (envVar) when populating flags[configFileFlag], which causes setups using the legacy TINYAUTH_EXPERIMENTAL_CONFIGFILE to fall through and return false; fix this by adding a fallback check for the legacy env var (TINYAUTH_EXPERIMENTAL_CONFIGFILE) before returning, i.e., when value := os.Getenv(envVar) is empty then check os.Getenv("TINYAUTH_EXPERIMENTAL_CONFIGFILE") and if present assign that to flags[configFileFlag] so the existing loadConfig behavior (in the surrounding function that uses configFileFlag) continues to work for legacy users.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@internal/utils/loaders/loader_file.go`:
- Around line 21-29: The code in loader_file.go currently only checks
TINYAUTH_CONFIGFILE (envVar) when populating flags[configFileFlag], which causes
setups using the legacy TINYAUTH_EXPERIMENTAL_CONFIGFILE to fall through and
return false; fix this by adding a fallback check for the legacy env var
(TINYAUTH_EXPERIMENTAL_CONFIGFILE) before returning, i.e., when value :=
os.Getenv(envVar) is empty then check
os.Getenv("TINYAUTH_EXPERIMENTAL_CONFIGFILE") and if present assign that to
flags[configFileFlag] so the existing loadConfig behavior (in the surrounding
function that uses configFileFlag) continues to work for legacy users.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 22c6e51f-8e81-414c-8523-c9e6e36ecf3b
📒 Files selected for processing (3)
.env.exampleinternal/model/config.gointernal/utils/loaders/loader_file.go
Summary by CodeRabbit