-
Notifications
You must be signed in to change notification settings - Fork 0
refactoring kindling usage and improve dnstt config #253
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
…ist of dnstt configs
…t emit events when a new client is available
…mprove-dnstt-config-list
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.
Pull request overview
This PR refactors the handling of the Kindling HTTP client by introducing a dedicated kindling package that centralizes client management and enables dynamic updates. The key improvements include consolidating Kindling initialization logic, supporting runtime updates when DNSTT configurations change, and improving the structure of DNSTT configuration handling to support multiple configurations instead of a single one.
Key changes:
- Created a new
kindlingpackage that manages HTTP client lifecycle and notifies consumers when new configurations are available - Modified DNSTT configuration parsing to support multiple configurations (
dnsttConfigsarray) instead of a singlednsttobject - Added mutex-protected HTTP client updates across API, config fetcher, and issue reporter components
Reviewed changes
Copilot reviewed 10 out of 15 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| radiance.go | Simplified Radiance initialization by delegating Kindling setup to the new package |
| kindling/client.go | New package file implementing centralized HTTP client management with event-based updates |
| kindling/dnstt/parser.go | Refactored to parse multiple DNSTT configurations and emit update events |
| kindling/dnstt/parser_test.go | Updated tests to reflect new multi-config structure |
| api/api.go | Added mutex and event subscription to handle HTTP client updates |
| api/user.go | Added mutex locks around HTTP client usage in user-related API calls |
| api/subscription.go | Added mutex locks around HTTP client usage in subscription-related API calls |
| config/fetcher.go | Added mutex and event subscription for HTTP client updates |
| issue/issue.go | Added mutex and event subscription for HTTP client updates |
| config/fetcher_test.go | Updated import path for fronted package |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
fixing typo and using correct `newHTTPClient` Co-authored-by: Copilot <[email protected]>
garmr-ulfr
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.
A couple of comments, otherwise, LGTM.
…nstead of fetching it Suggestion from @garmr-ulfr
…ntern/radiance into feat/improve-dnstt-config-list
|
Definitely opposed to adding all this locking and storing of http client state. I would revert the change here: that also breaks all other uses of DefaultClient, and just create call tbh I also don't think we should go to such lengths to support DNSTT config changes from the config server. why DNSTT and not other transports? |
This PR creates a package for handling kindling http client and places that refer to the http client now get notified to retrieve a new http client with new config available.
It also improve the list of DNSTT configurations available.
Out of scope:
This PR isn't loading the configurations since dnstt integration tests are still failing and getlantern/engineering#2872 should cover that
Resolve getlantern/engineering#2869