Skip to content

Commit 57a46c4

Browse files
authored
meta: Draft a changelog and update docs/features (#228)
* Updates the main documentation. * Renames the transport-related feature flags. * Drafts a changelog highlighting the breaking changes.
1 parent 9adb66f commit 57a46c4

File tree

12 files changed

+153
-184
lines changed

12 files changed

+153
-184
lines changed

CHANGELOG.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,43 @@
11
# Changelog
22

3+
## Unreleased
4+
5+
**Highlights**:
6+
7+
The `sentry` crate has been split up into a `sentry-core`, and many smaller per-integration crates. Application users should continue using the `sentry` crate, but library users and integration/transport authors are encouraged to use the `sentry-core` crate instead.
8+
9+
Additionally, sentry can now be extended via `Integration`s.
10+
11+
**Breaking Changes**:
12+
13+
- The `utils` module has been removed, and most utils have been moved into integrations.
14+
- The `integrations` module was completely rewritten.
15+
- When constructing a `Client` using a `ClientOptions` struct manually, it does not have any default integrations, and it does not resolve default options from environment variables any more. Please use the explicit `apply_defaults` function instead. The `init` function will automatically call `apply_defaults`.
16+
- The `init` function can’t be called with a `Client` anymore.
17+
18+
**Features**:
19+
20+
- Sentry can now capture `std::error::Error` types, using the `capture_error` and `Hub::capture_error` functions, and an additional `event_from_error` utility function.
21+
- Sentry now has built-in support to bind a `Hub` to a `Future`.
22+
- Sentry can now be extended with `Integration`s.
23+
- The `ClientInitGuard`, `Future` and `ScopeGuard` structs and `apply_defaults`, `capture_error`, `event_from_error`, `with_integration` and `parse_type_from_debug` functions have been added to the root exports.
24+
- The `FutureExt`, `Integration`, `IntoBreadcrumbs`, `IntoDsn`, `Transport` and `TransportFactory` traits are now exported.
25+
- The `types` module now re-exports `sentry-types`.
26+
27+
**Deprecations**:
28+
29+
- The `internals` module is deprecated. Please `use` items from the crate root or the `types` module instead.
30+
- All the feature flags have been renamed, the old names are still available but
31+
32+
## 0.18.1
33+
34+
- Fix potential segfault with `with_debug_meta` (#211).
35+
- Fix panic when running inside of tokio (#186).
36+
337
## 0.18.0
438

539
- Upgrade most dependencies to their current versions (#183):
40+
641
- `env_logger 0.7`
742
- `reqwest 0.10`
843
- `error-chain 0.12`

Makefile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ test: checkall testall
4040

4141
testfast:
4242
@echo 'TESTSUITE'
43-
cd sentry && cargo test --features=with_test_support
43+
cd sentry && cargo test --features=test
4444
.PHONY: testfast
4545

4646
testall:
@@ -73,24 +73,24 @@ check-no-default-features:
7373

7474
check-failure:
7575
@echo 'NO CLIENT + FAILURE'
76-
@cd sentry && RUSTFLAGS=-Dwarnings cargo check --no-default-features --features 'with_failure'
76+
@cd sentry && RUSTFLAGS=-Dwarnings cargo check --no-default-features --features 'failure'
7777
.PHONY: check-failure
7878

7979
check-panic:
8080
@echo 'NO CLIENT + PANIC'
81-
@cd sentry && RUSTFLAGS=-Dwarnings cargo check --no-default-features --features 'with_panic'
81+
@cd sentry && RUSTFLAGS=-Dwarnings cargo check --no-default-features --features 'panic'
8282
.PHONY: check-panic
8383

8484
check-all-impls:
8585
@echo 'NO CLIENT + ALL IMPLS'
86-
@cd sentry && RUSTFLAGS=-Dwarnings cargo check --no-default-features --features 'with_failure,with_panic'
86+
@cd sentry && RUSTFLAGS=-Dwarnings cargo check --no-default-features --features 'failure,panic'
8787
.PHONY: check-all-impls
8888

8989
check-curl-transport:
9090
@echo 'CURL TRANSPORT'
91-
@cd sentry && RUSTFLAGS=-Dwarnings cargo check --features with_curl_transport
91+
@cd sentry && RUSTFLAGS=-Dwarnings cargo check --features curl
9292
@echo 'CURL TRANSPORT ONLY'
93-
@cd sentry && RUSTFLAGS=-Dwarnings cargo check --no-default-features --features 'with_curl_transport,with_panic'
93+
@cd sentry && RUSTFLAGS=-Dwarnings cargo check --no-default-features --features 'curl,panic'
9494
.PHONY: check-curl-transport
9595

9696
check-actix:

sentry-actix/Cargo.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,8 @@ all-features = true
1717
[features]
1818
default = ["with_sentry_default"]
1919
with_sentry_default = [
20-
"sentry/with_default_transport",
21-
"sentry/with_panic",
22-
"sentry/with_native_tls"
20+
"sentry/transport",
21+
"sentry/panic",
2322
]
2423

2524
[dependencies]

sentry-contexts/src/integration.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ use crate::utils::{device_context, os_context, rust_context, server_name};
88

99
/// Adds Contexts to Sentry Events.
1010
///
11-
/// See https://develop.sentry.dev/sdk/event-payloads/contexts/
11+
/// See the [Contexts Interface] documentation for more info.
12+
///
13+
/// [Contexts Interface]: https://develop.sentry.dev/sdk/event-payloads/contexts/
1214
pub struct ContextIntegration {
1315
/// Add `os` context, enabled by default.
1416
pub add_os: bool,

sentry-contexts/src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//! and `rust` contexts to Events, as well as sets a `server_name` if not
55
//! already defined.
66
//!
7-
//! See https://develop.sentry.dev/sdk/event-payloads/contexts/
7+
//! See the [Contexts Interface] documentation for more info.
88
//!
99
//! # Examples
1010
//!
@@ -15,6 +15,8 @@
1515
//! };
1616
//! let _sentry = sentry::init(sentry::ClientOptions::default().add_integration(integration));
1717
//! ```
18+
//!
19+
//! [Contexts Interface]: https://develop.sentry.dev/sdk/event-payloads/contexts/
1820
1921
#![deny(missing_docs)]
2022

sentry-core/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
//! the concepts of [`Client`], [`Hub`] and [`Scope`], as well as the extension
2121
//! points via the [`Integration`], [`Transport`] and [`TransportFactory`] traits.
2222
//!
23-
//!
2423
//! # Minimal API
2524
//!
2625
//! By default, this crate comes with a so-called "minimal" mode. This mode will

sentry-core/src/macros.rs

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -55,21 +55,16 @@ macro_rules! with_client_impl {
5555
#[doc(hidden)]
5656
macro_rules! sentry_debug {
5757
($($arg:tt)*) => {
58-
#[cfg(feature = "client")] {
59-
#[cfg(feature = "debug-logs")] {
60-
::log_::debug!(target: "sentry", $($arg)*);
61-
}
62-
#[cfg(not(feature = "debug-logs"))] {
63-
$crate::Hub::with(|hub| {
64-
if hub.client().map_or(false, |c| c.options().debug) {
65-
eprint!("[sentry] ");
66-
eprintln!($($arg)*);
67-
}
68-
});
69-
}
58+
#[cfg(feature = "debug-logs")] {
59+
::log_::debug!(target: "sentry", $($arg)*);
7060
}
71-
#[cfg(not(feature = "client"))] {
72-
let _ = ($($arg)*);
61+
#[cfg(not(feature = "debug-logs"))] {
62+
$crate::Hub::with(|hub| {
63+
if hub.client().map_or(false, |c| c.options().debug) {
64+
eprint!("[sentry] ");
65+
eprintln!($($arg)*);
66+
}
67+
});
7368
}
7469
}
7570
}

sentry-types/CHANGELOG.md

Lines changed: 0 additions & 8 deletions
This file was deleted.

sentry-types/src/protocol/mod.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,5 @@ pub mod v7;
66
/// The latest version of the protocol.
77
pub const LATEST: u16 = 7;
88

9-
/// The always latest sentry protocol version.
109
#[cfg(feature = "protocol")]
11-
pub mod latest {
12-
pub use super::v7::*;
13-
}
10+
pub use v7 as latest;

sentry/Cargo.toml

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,7 @@ autoexamples = true
1616
all-features = true
1717

1818
[features]
19-
default = ["client", "backtrace", "contexts", "failure", "panic", "transport"]
20-
21-
# we still need a "client" feature, here, because `sentry_debug!` tests for that
22-
client = []
23-
debug-logs = ["log_", "sentry-core/debug-logs"]
19+
default = ["backtrace", "contexts", "failure", "panic", "transport"]
2420

2521
# default integrations
2622
backtrace = ["sentry-backtrace"]
@@ -33,14 +29,20 @@ debug-images = ["sentry-debug-images"]
3329
error-chain = ["sentry-error-chain"]
3430
log = ["sentry-log"]
3531
slog = ["sentry-slog"]
36-
3732
# other features
3833
test = ["sentry-core/test"]
39-
transport = ["with_default_transport"]
34+
debug-logs = ["log_", "sentry-core/debug-logs"]
35+
# transports
36+
transport = ["reqwest", "native-tls"]
37+
reqwest = ["reqwest_", "httpdate"]
38+
curl = ["curl_", "httpdate", "serde_json"]
39+
surf = ["surf_", "httpdate", "http-client", "futures"]
40+
native-tls = ["reqwest_/default-tls"]
41+
rustls = ["reqwest_/rustls-tls"]
4042

4143
# deprecated feature flags, here for backwards compatibility, will be removed
4244
# at some point
43-
with_client_implementation = ["client"]
45+
with_client_implementation = []
4446
with_backtrace = ["backtrace"]
4547
with_failure = ["failure"]
4648
with_panic = ["panic"]
@@ -50,14 +52,12 @@ with_test_support = ["test"]
5052
with_debug_meta = ["debug-images"]
5153
with_device_info = ["contexts"]
5254
with_rust_info = ["contexts"]
53-
54-
# transport related features, should be cleaned up further in the future
55-
with_default_transport = ["with_reqwest_transport", "with_native_tls"]
56-
with_reqwest_transport = ["reqwest", "httpdate", "with_client_implementation"]
57-
with_curl_transport = ["curl", "httpdate", "serde_json", "with_client_implementation"]
58-
with_surf_transport = ["surf", "httpdate", "http-client", "futures", "with_client_implementation"]
59-
with_rustls = ["reqwest/rustls-tls"]
60-
with_native_tls = ["reqwest/default-tls"]
55+
with_default_transport = ["transport"]
56+
with_reqwest_transport = ["reqwest"]
57+
with_curl_transport = ["curl"]
58+
with_surf_transport = ["surf"]
59+
with_native_tls = ["native-tls"]
60+
with_rustls = ["rustls"]
6161

6262
[dependencies]
6363
sentry-core = { version = "0.18.0", path = "../sentry-core", features = ["client"] }
@@ -71,9 +71,9 @@ sentry-log = { version = "0.18.0", path = "../sentry-log", optional = true }
7171
sentry-panic = { version = "0.18.0", path = "../sentry-panic", optional = true }
7272
sentry-slog = { version = "0.18.0", path = "../sentry-slog", optional = true }
7373
log_ = { package = "log", version = "0.4.8", optional = true, features = ["std"] }
74-
reqwest = { version = "0.10.1", optional = true, features = ["blocking", "json"], default-features = false }
75-
curl = { version = "0.4.25", optional = true }
76-
surf = { version = "=2.0.0-alpha.3", optional = true }
74+
reqwest_ = { package = "reqwest", version = "0.10.1", optional = true, features = ["blocking", "json"], default-features = false }
75+
curl_ = { package = "curl", version = "0.4.25", optional = true }
76+
surf_ = { package = "surf", version = "=2.0.0-alpha.4", optional = true }
7777
http-client = { version = "3.0", optional = true }
7878
futures = { version = "0.3", optional = true }
7979
httpdate = { version = "0.3.2", optional = true }

0 commit comments

Comments
 (0)