-
-
Notifications
You must be signed in to change notification settings - Fork 167
fix: use release-health
flag in sentry-actix
and remove it from subcrates where unneeded
#787
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
Conversation
…ubcrates where not needed
sentry-actix/src/lib.rs
Outdated
@@ -294,6 +296,7 @@ where | |||
.map(|client| client.options().max_request_body_size) | |||
.unwrap_or(MaxRequestBodySize::None); | |||
if track_sessions { |
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.
you should probably move the #[cfg]
up to where you define this field. I believe the client options auto_session_tracking
is also not available with this feature, right?
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.
At the moment the option is available even without the flag, I've just added a doc line on it to make it clear that the feature flag needs to be enabled for that option to have any effect.
But, I think both auto_session_tracking
and session_mode
in ClientOptions
should instead not be available if the feature is not enabled.
This way, if someone uses those options but their deps don't bring in sentry-core/release-health
, it will fail to compile. Better than no-opping silently.
I will update the PR.
Now it should be good. |
sentry-core/src/session.rs
Outdated
@@ -432,6 +432,7 @@ mod session_impl { | |||
} | |||
|
|||
#[test] | |||
#[cfg(feature = "release-health")] |
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.
I think we are still running this test in CI, are we?
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.
Actually the whole session.rs
is wrapped in:
#[cfg(feature = "release-health")]
mod session_impl {
So effectively these extra cfg
macros inside it are useless. Removed them.
Removes the
release-health
feature fromsentry-tower
andsentry-tracing
, where it was used unnecessarily.It's still a feature flag, enabled by default, in
sentry-actix
, as it's used there to create a session per request.This was the default behavior previously, with no way of opting out, so it makes sense to keep it enabled by default there.
sentry-rust/sentry-actix/Cargo.toml
Line 16 in 3cc461a
I've fixed it to actually be used in the code because compilation would fail otherwise due to the
hub.start_session();
call.There is no change to the
sentry
crate, where this flag is part of the default features as intended:sentry-rust/sentry/Cargo.toml
Line 30 in 3cc461a
Note that
sentry
has no way to bring insentry-actix
via feature flags.Is there a reason for that?
I'll create a separate PR to enable it, similarly to other integrations.