-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
server: remove RandomGenerator from everywhere except Api #13360
Conversation
Replaces accesses to RandomGenerator with the equivalent calls through Api::Api::randomGenerator(). Signed-off-by: Alex Konradi <[email protected]>
Remove the RandomGenerator accessor on Server and change the remaining call sites to use Api::randomGenerator(). Signed-off-by: Alex Konradi <[email protected]>
This appears to be failing coverage because enough covered lines were removed to drop the |
Signed-off-by: Alex Konradi <[email protected]>
This PR makes no functional changes but removes some code that was previously covered, which dropped the measured coverage fraction below the previous limit. Decrease the limit to accommodate the refactoring. Signed-off-by: Alex Konradi <[email protected]>
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.
this is fine I think. I didn't think the previous state was that bad though. Taken too far toward bundling everything in one giant context collection and passing that everywhere results in arguably a lot of unnecessary dependencies across layers, but I didn't see that here.
Like, if I need to have some functionality that requires random numbers, I wouldn't want to have to construct a thread factory and whatever else API needs in order to get that tunneled down. So I'm a little leary of this but I'll pass this to @envoyproxy/senior-maintainers as it doesn't look too bad yet.
Agreed, and there are still places where |
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.
Overall this seems like an improvement to me. Thanks!
Commit Message: Remove RandomGenerator from everywhere except Api
Additional Description:
Remove the RandomGenerator accessor on Server and change the remaining call sites to
use
Api::randomGenerator()
.Risk Level: low
Testing: ran all affected tests
Docs Changes: n/a
Release Notes: n/a
Fixes: #13243