-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat: implement remote configuration and logging level updates #2498
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: development
Are you sure you want to change the base?
Conversation
443dc6e to
9b79f98
Compare
|
@coolwednesday and @aryanmehrotra kindly review the PR. |
Umang01-hash
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-
Consider renaming interfaces for better clarity:
RemoteConfigurable→ ConfigSubscriber andRemoteConfiguration→ ConfigProvider -
All the newly added tests inside remotelogger_test.go have if conditions in the end like:
if atomic.LoadInt32(&logger.changeCnt) != 0 {
t.Errorf("expected no ChangeLevel when invalid key present")
} if !foundErrorLog {
t.Errorf("expected error log message for invalid JSON response, got logs: %v", logger.messages)
} if client.lastConfig["logLevel"] != "DEBUG" {
t.Errorf("expected logLevel=DEBUG, got %v", client.lastConfig["logLevel"])
}We should generally avoid all these if-else conditions inside test methods. Please refactor your tests too.
-
Same if-else conditions inside test lies in file r
emote_config_test.go. Please refactor it also. -
It would be nicer if you can also attach a screenshot of the functionality working after your changes so other developers can easily review.
|
@ckshitij Thank you for contributing to GoFr. I have left some review comments on your PR. Please address them and we will review it again after all comments are resolved. |
|
@ckshitij Are you still working on this PR? If yes, let's resolve the review comments quickly so we can further review your PR. |
@Umang01-hash Yes I’m still working on the same, got busy with something , will try to address the comments by this weekend. |
27300a9 to
601fde3
Compare
|
@ckshitij Have you resolved all the review comments. if yes we can re-review the PR then.... |
@Umang01-hash yes, all the review comments are resolved. |
Umang01-hash
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ckshitij a few issues in the current PR:
- The names provided in PR description: Added RemoteConfigurable and RemoteConfiguration interfaces for runtime configuration management. don't match the actual interface names. Please correct it.
- In the PR description please provide any example of the functionality so it can be easily tested and also we need to update the documentation properly regarding this change.
Hi @Umang01-hash, Thanks for the review! I have updated the interface names in the PR description, and since the example is already added in the test file, I’ll reference it there for easier testing of the runtime configuration flow test. Regarding the documentation update, could you please point me to the exact reference or starting point where the documentation for this module should be updated? I want to ensure the changes are added in the right place and follow the existing structure. |
|
@ckshitij I think we can update this Page in the doucmentation: https://gofr.dev/docs/advanced-guide/remote-log-level-change Right now it only talks about Remote Log Level Change you can refactor it to include the new improvements remote config etc. |
|
@ckshitij Did we updated the documentation? Can i re-review the PR ?? |
@Umang01-hash I have updated the doc. You can re-review the PR. |
- Added RemoteConfigurable and RemoteConfiguration interfaces for runtime configuration management. - Introduced mock implementations for testing remote configuration behavior. - Enhanced remote logger to support dynamic log level updates via remote configuration. - Implemented HTTP-based remote configuration fetching and client registration. - Added comprehensive tests for remote configuration and logger functionality.
…ndling (linting-issues)
…ation to Subscriber and Provider for clarity
Pull Request
Description:
Checklist:
goimportandgolangci-lint.