-
-
Notifications
You must be signed in to change notification settings - Fork 185
feat: add dynamic flagset reloading without restart #4462
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- Add config file watcher to monitor configuration changes - Implement ReloadFlagsets method to add/remove flagsets dynamically - Validate that existing flagsets haven't been modified - Reject configuration changes if existing flagsets are modified - Add comprehensive tests for reload functionality Resolves #4288
✅ Deploy Preview for go-feature-flag-doc-preview canceled.
|
- Extract event handling logic from startConfigWatcher into separate functions - Split ReloadFlagsets into smaller, focused helper methods - Improve code readability and maintainability Fixes SonarQube cognitive complexity issues
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #4462 +/- ##
==========================================
- Coverage 85.33% 84.61% -0.73%
==========================================
Files 145 145
Lines 6056 6233 +177
==========================================
+ Hits 5168 5274 +106
- Misses 663 730 +67
- Partials 225 229 +4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Simplify the return statement by removing the intermediate variable. This fixes SonarQube issue AZsKQJmYYhhLTmDGVjcX.
- Replace custom fsnotify implementation with koanf's file.Provider().Watch() - Remove direct fsnotify dependency from main.go - Simplify file watching code by leveraging koanf's abstraction - Add WatchConfigFile function in config package using koanf's Watch() method - Fix linter issues: add missing ReloadFlagsets to mock and fix line length violations This change reduces code complexity and uses the library's built-in functionality as recommended in koanf documentation.
…warnings - Prefix unused apiKey parameters with _ to indicate they're intentionally unused - Fixes SonarQube rule godre:S1172 warnings
- Move fsnotify from direct to indirect dependency - It's now only needed indirectly through koanf's file provider
|



Description
This PR implements dynamic flagset reloading for the relay-proxy, allowing flagsets to be added or removed without restarting the service. The implementation follows the requirements from issue #4288:
Implementation Details
fsnotifythat monitors the configuration file for changesHow to Test
Closes issue(s)
Resolves #4288
Checklist
README.mdand/website/docs)