-
Notifications
You must be signed in to change notification settings - Fork 92
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
ref(processor): Remove the config from the state #4393
Conversation
} | ||
|
||
/// New type representing the normalization state of the event. | ||
#[derive(Copy, Clone)] |
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.
Just moved everything.
/// based on a feature flag. | ||
/// | ||
/// If the project config did not come from the upstream, we keep the items. | ||
fn should_filter(config: &Config, feature: Feature, project_info: &ProjectInfo) -> bool { |
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.
Arguably you could just pass the mode in here, since that's the only relevant part of the config. This extends up to the callers of this function.
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.
nit: The argument list is now the feature sandwiched by two configs, I would either choose (config, project_info, feature)
or (feature, config, project_info)
.
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.
Will do! I did the same for other functions, thanks for the nit!
@@ -72,6 +72,7 @@ pub fn validate_and_set_dsc( | |||
/// Computes the sampling decision on the incoming event | |||
pub fn run<Group>( | |||
state: &mut ProcessEnvelopeState<Group>, | |||
config: Arc<Config>, |
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.
Likewise, I believe this can just be processing_enabled: bool
.
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.
LGTM, apart from the fact that in a lot of places you pass around the config when only one of its fields is actually required. Still, that might be a deliberate abstraction.
Yes, this is a great comment. I plan to improve those things in a second pass. Right now I am aiming for chirurgical changes. |
060fe31
to
a133f4f
Compare
This PR removes the
config
from the processor state.#skip-changelog